]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - include/net/inet_sock.h
ipv4: processing ancillary IP_TOS or IP_TTL
authorFrancesco Fusco <ffusco@redhat.com>
Tue, 24 Sep 2013 13:43:09 +0000 (15:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 28 Sep 2013 22:21:52 +0000 (15:21 -0700)
commitaa6615814533c634190019ee3a5b10490026d545
tree08543d020bd7e2500046143440d58cd031f9754c
parentf02db315b8d888570cb0d4496cfbb7e4acb047cb
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>
include/net/inet_sock.h
include/net/ip.h
include/net/route.h
net/ipv4/icmp.c
net/ipv4/ip_output.c
net/ipv4/ping.c
net/ipv4/raw.c
net/ipv4/udp.c