mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 08:02:56 +00:00
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>
This commit is contained in:
parent
f02db315b8
commit
aa66158145
8 changed files with 39 additions and 6 deletions
|
@ -103,6 +103,9 @@ struct inet_cork {
|
|||
int length; /* Total length of all frames */
|
||||
struct dst_entry *dst;
|
||||
u8 tx_flags;
|
||||
__u8 ttl;
|
||||
__s16 tos;
|
||||
char priority;
|
||||
};
|
||||
|
||||
struct inet_cork_full {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue