forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rtnetlink: catch -EOPNOTSUPP errors from ndo_bridge_getlink (sonic-ne…
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
commit 10c9f8f890dcff762b74fc71aaac6402aa1660c9 | ||
Author: Jipan Yang <[email protected]> | ||
Date: Tue Jun 13 16:36:16 2017 -0700 | ||
|
||
rtnetlink: catch -EOPNOTSUPP errors from ndo_bridge_getlink | ||
https://github.com/torvalds/linux/commit/d64f69b0373a7d0bcec8b5da7712977518a8f42b | ||
|
||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c | ||
index e4666af..a7e13b5 100644 | ||
--- a/net/core/rtnetlink.c | ||
+++ b/net/core/rtnetlink.c | ||
@@ -2623,6 +2623,7 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | ||
u32 seq = cb->nlh->nlmsg_seq; | ||
struct nlattr *extfilt; | ||
u32 filter_mask = 0; | ||
+ int err; | ||
|
||
extfilt = nlmsg_find_attr(cb->nlh, sizeof(struct ifinfomsg), | ||
IFLA_EXT_MASK); | ||
@@ -2635,18 +2636,22 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | ||
struct net_device *br_dev = netdev_master_upper_dev_get(dev); | ||
|
||
if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { | ||
- if (idx >= cb->args[0] && | ||
- br_dev->netdev_ops->ndo_bridge_getlink( | ||
- skb, portid, seq, dev, filter_mask) < 0) | ||
- break; | ||
+ if (idx >= cb->args[0]) { | ||
+ err = br_dev->netdev_ops->ndo_bridge_getlink( | ||
+ skb, portid, seq, dev, filter_mask); | ||
+ if (err < 0 && err != -EOPNOTSUPP) | ||
+ break; | ||
+ } | ||
idx++; | ||
} | ||
|
||
if (ops->ndo_bridge_getlink) { | ||
- if (idx >= cb->args[0] && | ||
- ops->ndo_bridge_getlink(skb, portid, seq, dev, | ||
- filter_mask) < 0) | ||
- break; | ||
+ if (idx >= cb->args[0]) { | ||
+ err = ops->ndo_bridge_getlink(skb, portid, seq, dev, | ||
+ filter_mask); | ||
+ if (err < 0 && err != -EOPNOTSUPP) | ||
+ break; | ||
+ } | ||
idx++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters