netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net-netlink: Add a new attribute to expose TCLASS values via netlink
@ 2011-11-08  0:23 Maciej Żenczykowski
  2011-11-08  0:25 ` Maciej Żenczykowski
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Maciej Żenczykowski @ 2011-11-08  0:23 UTC (permalink / raw)
  To: Maciej Żenczykowski
  Cc: netdev, Maciej Żenczykowski, Murali Raja, Stephen Hemminger,
	Eric Dumazet, David S. Miller

From: Maciej Żenczykowski <maze@google.com>

commit 3ceca749668a52bd795585e0f71c6f0b04814f7b added a TOS attribute.

Unfortunately TOS and TCLASS are both present in a dual-stack v6 socket,
furthermore they can have different values.  As such one cannot in a
sane way expose both through a single attribute.

Signed-off-by: Maciej Żenczyowski <maze@google.com>
CC: Murali Raja <muralira@google.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: David S. Miller <davem@davemloft.net>
---
 include/linux/inet_diag.h |    3 ++-
 net/ipv4/inet_diag.c      |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index 80b480c..abf5028 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -98,9 +98,10 @@ enum {
 	INET_DIAG_VEGASINFO,
 	INET_DIAG_CONG,
 	INET_DIAG_TOS,
+	INET_DIAG_TCLASS,
 };
 
-#define INET_DIAG_MAX INET_DIAG_TOS
+#define INET_DIAG_MAX INET_DIAG_TCLASS
 
 
 /* INET_DIAG_MEM */
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index f5e2bda..68e8ac5 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -133,8 +133,8 @@ static int inet_csk_diag_fill(struct sock *sk,
 			       &np->rcv_saddr);
 		ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
 			       &np->daddr);
-		if (ext & (1 << (INET_DIAG_TOS - 1)))
-			RTA_PUT_U8(skb, INET_DIAG_TOS, np->tclass);
+		if (ext & (1 << (INET_DIAG_TCLASS - 1)))
+			RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass);
 	}
 #endif
 
-- 
1.7.3.1

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

end of thread, other threads:[~2011-11-22 21:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08  0:23 [PATCH] net-netlink: Add a new attribute to expose TCLASS values via netlink Maciej Żenczykowski
2011-11-08  0:25 ` Maciej Żenczykowski
2011-11-08  0:27 ` Stephen Hemminger
2011-11-08  0:29   ` Maciej Żenczykowski
2011-11-08  1:46 ` [PATCH] [RFC] net-netlink: fix tos/tclass for dual-stack ipv6 sockets Maciej Żenczykowski
2011-11-09 20:35   ` David Miller
2011-11-10  1:52     ` Maciej Żenczykowski
2011-11-09 20:34 ` [PATCH] net-netlink: Add a new attribute to expose TCLASS values via netlink David Miller
2011-11-10  1:50   ` Maciej Żenczykowski
2011-11-10  1:53     ` David Miller
     [not found]       ` <CAHo-OoybYpiusVFbDLEhS2ayPOVC1sXt7WZvpgW-Fk7ZqKj+SQ@mail.gmail.com>
     [not found]         ` <20111114.010752.2129864130433732501.davem@davemloft.net>
2011-11-15  6:13           ` Maciej Żenczykowski
2011-11-22  1:50             ` [PATCH] net-netlink: fix diag to export IPv4 tos for dual-stack IPv6 sockets Maciej Żenczykowski
2011-11-22  1:52               ` Maciej Żenczykowski
2011-11-22 21:03                 ` David Miller
2011-11-22 21:03               ` David Miller

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).