mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
sk-inet: Add IP TOS socket option
The TOS(type of service) field in the ip header allows you specify the priority of the socket data. Signed-off-by: Suraj Shirvankar <surajshirvankar@gmail.com>
This commit is contained in:
parent
4c1a2ac41b
commit
04cdbd6106
2 changed files with 5 additions and 0 deletions
|
|
@ -416,9 +416,11 @@ static int dump_ip_opts(int sk, int family, int type, int proto, IpOptsEntry *io
|
|||
} else {
|
||||
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);
|
||||
}
|
||||
ioe->has_freebind = ioe->freebind;
|
||||
ioe->has_pktinfo = !!ioe->pktinfo;
|
||||
ioe->has_tos = !!ioe->tos;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -813,6 +815,8 @@ int restore_ip_opts(int sk, int family, int proto, IpOptsEntry *ioe)
|
|||
ret |= restore_opt(sk, SOL_IP, IP_FREEBIND, &ioe->freebind);
|
||||
if (ioe->has_pktinfo)
|
||||
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->raw)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ message ip_opts_entry {
|
|||
optional ip_opts_raw_entry raw = 4;
|
||||
|
||||
optional bool pktinfo = 5;
|
||||
optional uint32 tos = 6;
|
||||
}
|
||||
|
||||
message inet_sk_entry {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue