mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-20 16:51:37 +00:00
kerndat: bind ipv6-socket only if ipv6 is enabled
Fixes: #2222
Fixes: f1c8d38 ("kerndat: check if setsockopt IPV6_FREEBIND is supported")
Signed-off-by: Yan Evzman <yevzman@gmail.com>
Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
parent
6b8107cd1b
commit
8ee35bebb5
1 changed files with 5 additions and 0 deletions
|
|
@ -1578,6 +1578,11 @@ static int kerndat_has_ipv6_freebind(void)
|
|||
{
|
||||
int sk, val;
|
||||
|
||||
if (!kdat.ipv6) {
|
||||
kdat.has_ipv6_freebind = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sk = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (sk == -1) {
|
||||
pr_perror("Unable to create a ipv6 dgram socket");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue