Skip to content

Commit

Permalink
kerndat: bind ipv6-socket only if ipv6 is enabled
Browse files Browse the repository at this point in the history
Fixes: checkpoint-restore#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>
  • Loading branch information
yevzman authored and ancientmodern committed Jul 26, 2023
1 parent 9a9a729 commit d9e043b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions criu/kerndat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit d9e043b

Please sign in to comment.