• Francesco Fusco's avatar
    ipv4: processing ancillary IP_TOS or IP_TTL · aa661581
    Francesco Fusco authored
    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: default avatarFrancesco Fusco <ffusco@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    aa661581
ip_output.c 37.8 KB