diff options
author | Ben Greear <greearb@candelatech.com> | 2012-03-29 08:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:46 -0400 |
commit | edbc0bb3fb72ec4645a242520cf1d0b9b6b02261 (patch) | |
tree | 71455d026ea30221a0d1d7c2d170c0330a7a8d55 /net | |
parent | e4422b2d31983ee651d51cb6e25943d56ef63387 (diff) |
net: Report dev->promiscuity in netlink reports.
The standard ways of probing a device's promiscuity
(ifi_flags, for instance) does not report the actual
state of the device. This patch adds dev->promiscuity
to the netlink netdevice report so that users can know
for certain if the device is acting PROMISC or not.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/rtnetlink.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 71a1920a23a1..b76f8fa3fc64 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -784,6 +784,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, | |||
784 | + nla_total_size(4) /* IFLA_MTU */ | 784 | + nla_total_size(4) /* IFLA_MTU */ |
785 | + nla_total_size(4) /* IFLA_LINK */ | 785 | + nla_total_size(4) /* IFLA_LINK */ |
786 | + nla_total_size(4) /* IFLA_MASTER */ | 786 | + nla_total_size(4) /* IFLA_MASTER */ |
787 | + nla_total_size(4) /* IFLA_PROMISCUITY */ | ||
787 | + nla_total_size(1) /* IFLA_OPERSTATE */ | 788 | + nla_total_size(1) /* IFLA_OPERSTATE */ |
788 | + nla_total_size(1) /* IFLA_LINKMODE */ | 789 | + nla_total_size(1) /* IFLA_LINKMODE */ |
789 | + nla_total_size(ext_filter_mask | 790 | + nla_total_size(ext_filter_mask |
@@ -901,6 +902,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, | |||
901 | nla_put_u8(skb, IFLA_LINKMODE, dev->link_mode) || | 902 | nla_put_u8(skb, IFLA_LINKMODE, dev->link_mode) || |
902 | nla_put_u32(skb, IFLA_MTU, dev->mtu) || | 903 | nla_put_u32(skb, IFLA_MTU, dev->mtu) || |
903 | nla_put_u32(skb, IFLA_GROUP, dev->group) || | 904 | nla_put_u32(skb, IFLA_GROUP, dev->group) || |
905 | nla_put_u32(skb, IFLA_PROMISCUITY, dev->promiscuity) || | ||
904 | (dev->ifindex != dev->iflink && | 906 | (dev->ifindex != dev->iflink && |
905 | nla_put_u32(skb, IFLA_LINK, dev->iflink)) || | 907 | nla_put_u32(skb, IFLA_LINK, dev->iflink)) || |
906 | (dev->master && | 908 | (dev->master && |
@@ -1117,6 +1119,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = { | |||
1117 | [IFLA_PORT_SELF] = { .type = NLA_NESTED }, | 1119 | [IFLA_PORT_SELF] = { .type = NLA_NESTED }, |
1118 | [IFLA_AF_SPEC] = { .type = NLA_NESTED }, | 1120 | [IFLA_AF_SPEC] = { .type = NLA_NESTED }, |
1119 | [IFLA_EXT_MASK] = { .type = NLA_U32 }, | 1121 | [IFLA_EXT_MASK] = { .type = NLA_U32 }, |
1122 | [IFLA_PROMISCUITY] = { .type = NLA_U32 }, | ||
1120 | }; | 1123 | }; |
1121 | EXPORT_SYMBOL(ifla_policy); | 1124 | EXPORT_SYMBOL(ifla_policy); |
1122 | 1125 | ||