Skip to content

Commit

Permalink
sk-inet: Added IP_TTL socket option
Browse files Browse the repository at this point in the history
Signed-off-by: rahulk789 <[email protected]>
  • Loading branch information
rahulk789 authored and avagin committed Feb 5, 2024
1 parent 9d9ae29 commit 66cab1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion criu/sk-inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,12 @@ static int dump_ip_opts(int sk, int family, int type, int proto, IpOptsEntry *io
ret |= dump_opt(sk, SOL_IP, IP_FREEBIND, &ioe->freebind);
ret |= dump_opt(sk, SOL_IP, IP_PKTINFO, &ioe->pktinfo);
ret |= dump_opt(sk, SOL_IP, IP_TOS, &ioe->tos);
ret |= dump_opt(sk, SOL_IP, IP_TTL, &ioe->ttl);
}
ioe->has_freebind = ioe->freebind;
ioe->has_pktinfo = !!ioe->pktinfo;
ioe->has_tos = !!ioe->tos;
ioe->has_ttl = !!ioe->ttl;

return ret;
}
Expand Down Expand Up @@ -817,7 +819,10 @@ int restore_ip_opts(int sk, int family, int proto, IpOptsEntry *ioe)
ret |= restore_opt(sk, SOL_IP, IP_PKTINFO, &ioe->pktinfo);
if (ioe->has_tos)
ret |= restore_opt(sk, SOL_IP, IP_TOS, &ioe->tos);
}
if (ioe->has_ttl)
ret |= restore_opt(sk, SOL_IP, IP_TTL, &ioe->ttl);

}

if (ioe->raw)
ret |= restore_ip_raw_opts(sk, family, proto, ioe->raw);
Expand Down
1 change: 1 addition & 0 deletions images/sk-inet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ message ip_opts_entry {

optional bool pktinfo = 5;
optional uint32 tos = 6;
optional uint32 ttl = 7;
}

message inet_sk_entry {
Expand Down

0 comments on commit 66cab1f

Please sign in to comment.