netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] ipv4: per-datagram IP_TOS and IP_TTL via sendmsg()
@ 2013-08-14 15:48 Francesco Fusco
  2013-08-14 15:48 ` [PATCH net-next 1/2] ipv4: IP_TOS and IP_TTL can be specified as ancillary data Francesco Fusco
  2013-08-14 15:48 ` [PATCH net-next 2/2] ipv4: processing ancillary IP_TOS or IP_TTL Francesco Fusco
  0 siblings, 2 replies; 6+ messages in thread
From: Francesco Fusco @ 2013-08-14 15:48 UTC (permalink / raw)
  To: davem; +Cc: netdev

There is no way to set the IP_TOS field on a per-packet basis in IPv4, while
IPv6 has such a mechanism. Therefore one has to fall back to the setsockopt()
in case of IPv4. 

Using the existing per-socket option is not convenient particularly in the
situations where multiple threads have to use the same socket data requiring
per-thread TOS values. In fact this would involve calling setsockopt() before
sendmsg() every time.

An old patch was submitted to the netdev mailing list to add support for
setting TOS on a per-packet basis, but was never integrated into the kernel.
The old patch can be found here:
http://marc.info/?l=linux-netdev&m=118388241201593 

This patch contains the changes from the original patch, updated for the
current kernel.

Francesco Fusco (2):
  ipv4: IP_TOS and IP_TTL can be specified as ancillary data
  ipv4: processing ancillary IP_TOS or IP_TTL

 include/net/inet_sock.h |  3 +++
 include/net/ip.h        |  3 +++
 net/ipv4/icmp.c         | 11 ++++++-----
 net/ipv4/ip_output.c    | 17 ++++++++++++++---
 net/ipv4/ip_sockglue.c  | 20 +++++++++++++++++++-
 net/ipv4/raw.c          |  3 +++
 net/ipv4/udp.c          |  3 +++
 7 files changed, 51 insertions(+), 9 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-16  4:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14 15:48 [PATCH net-next 0/2] ipv4: per-datagram IP_TOS and IP_TTL via sendmsg() Francesco Fusco
2013-08-14 15:48 ` [PATCH net-next 1/2] ipv4: IP_TOS and IP_TTL can be specified as ancillary data Francesco Fusco
2013-08-15 20:51   ` David Miller
2013-08-14 15:48 ` [PATCH net-next 2/2] ipv4: processing ancillary IP_TOS or IP_TTL Francesco Fusco
2013-08-16  4:26   ` Eric Dumazet
2013-08-16  4:35   ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).