Skip to content

Commit 0344338

Browse files
gospodavem330
authored andcommitted
net: addr IFLA_OPERSTATE to netlink message for ipv6 ifinfo
This is useful information to include in ipv6 netlink messages that report interface information. IFLA_OPERSTATE is already included in ipv4 messages, but missing for ipv6. This closes that gap. Signed-off-by: Andy Gospodarek <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent da65ad1 commit 0344338

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/ipv6/addrconf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4706,6 +4706,7 @@ static inline size_t inet6_if_nlmsg_size(void)
47064706
+ nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */
47074707
+ nla_total_size(4) /* IFLA_MTU */
47084708
+ nla_total_size(4) /* IFLA_LINK */
4709+
+ nla_total_size(1) /* IFLA_OPERSTATE */
47094710
+ nla_total_size(inet6_ifla6_size()); /* IFLA_PROTINFO */
47104711
}
47114712

@@ -4962,7 +4963,9 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
49624963
nla_put(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr)) ||
49634964
nla_put_u32(skb, IFLA_MTU, dev->mtu) ||
49644965
(dev->ifindex != dev_get_iflink(dev) &&
4965-
nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev))))
4966+
nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev))) ||
4967+
nla_put_u8(skb, IFLA_OPERSTATE,
4968+
netif_running(dev) ? dev->operstate : IF_OPER_DOWN))
49664969
goto nla_put_failure;
49674970
protoinfo = nla_nest_start(skb, IFLA_PROTINFO);
49684971
if (!protoinfo)

0 commit comments

Comments
 (0)