Skip to content

Commit

Permalink
net-netlink: Add a new attribute to expose TCLASS values via netlink
Browse files Browse the repository at this point in the history
commit 3ceca74 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maciej Żenczykowski authored and David S. Miller committed Nov 14, 2011
1 parent 6d74eb9 commit 06236ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/linux/inet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 06236ac

Please sign in to comment.