ipv4: processing ancillary IP_TOS or IP_TTL
If IP_TOS or IP_TTL are specified as ancillary data, then sendmsg() sends out packets with the specified TTL or TOS overriding the socket values specified with the traditional setsockopt(). The struct inet_cork stores the values of TOS, TTL and priority that are passed through the struct ipcm_cookie. If there are user-specified TOS (tos != -1) or TTL (ttl != 0) in the struct ipcm_cookie, these values are used to override the per-socket values. In case of TOS also the priority is changed accordingly. Two helper functions get_rttos and get_rtconn_flags are defined to take into account the presence of a user specified TOS value when computing RT_TOS and RT_CONN_FLAGS. Signed-off-by:Francesco Fusco <ffusco@redhat.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/inet_sock.h 3 additions, 0 deletionsinclude/net/inet_sock.h
- include/net/ip.h 11 additions, 0 deletionsinclude/net/ip.h
- include/net/route.h 1 addition, 0 deletionsinclude/net/route.h
- net/ipv4/icmp.c 5 additions, 0 deletionsnet/ipv4/icmp.c
- net/ipv4/ip_output.c 10 additions, 3 deletionsnet/ipv4/ip_output.c
- net/ipv4/ping.c 3 additions, 1 deletionnet/ipv4/ping.c
- net/ipv4/raw.c 3 additions, 1 deletionnet/ipv4/raw.c
- net/ipv4/udp.c 3 additions, 1 deletionnet/ipv4/udp.c
Loading
Please register or sign in to comment