bonding:Don't received packets if bonding is not up
Subsystems (3)
PATCH 1/1 bonding:Don't received packets if bonding is not up
From: Chunhe Li <[email protected]>
If the bonding device is down, it should not receive packets to network stack or other upper flow stack.
--- drivers/net/bonding/bond_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/bonding/bond_main.c +6 -3
@@ -1110,6 +1110,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)int (*recv_probe)(const struct sk_buff *,struct bonding *,struct slave *);int ret =RX_HANDLER_ANOTHER ; + + slave =bond_slave_get_rcu (skb->dev); + bond = slave->bond; + +if (unlikely (!(bond->dev->flags &IFF_UP ))) +return RX_HANDLER_PASS ; skb =skb_share_check (skb,GFP_ATOMIC );if (unlikely (!skb))
@@ -1117,9 +1123,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) *pskb = skb; - slave =bond_slave_get_rcu (skb->dev); - bond = slave->bond; - recv_probe =ACCESS_ONCE (bond->recv_probe);if (recv_probe) { ret =recv_probe (skb, bond, slave);
Signature · 1 line
1.9.2.0
Quoted 4 lines · On Mon, Aug 04, 2014 at 11:15:13AM +0800, [email protected] wrote:
From: Chunhe Li <[email protected]>
If the bonding device is down, it should not receive packets to network stack or other upper flow stack.
This breaks arp monitoring and 802.3ad modes, as they won't ever come up.
Also, please cc netdev next times.
Quoted 37 lines
Signed-off-by Chunhe Li <[email protected]>---
drivers/net/bonding/bond_main.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)drivers/net/bonding/bond_main.c +6
-3@@ -1110,6 +1110,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)int (*recv_probe)(const struct sk_buff *,struct bonding *,struct slave *);int ret =RX_HANDLER_ANOTHER ; + + slave =bond_slave_get_rcu (skb->dev); + bond = slave->bond; + +if (unlikely (!(bond->dev->flags &IFF_UP ))) +return RX_HANDLER_PASS ; skb =skb_share_check (skb,GFP_ATOMIC );if (unlikely (!skb))@@ -1117,9 +1123,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) *pskb = skb; - slave =bond_slave_get_rcu (skb->dev); - bond = slave->bond; - recv_probe =ACCESS_ONCE (bond->recv_probe);if (recv_probe) { ret =recv_probe (skb, bond, slave);Signature · 1 line
1.9.2.0
Thanks for your reply.
You mean that even the bonding device is down, it also should receive packets for refreshing slaves status by arp monitoring or 802.3ad protocol. But the bonding device is down, the status of slaves maybe is not useful, when it is up, it could check it quickly.
Quoted 58 lines
-----Original Message-----
From: Veaceslav Falico [mailto:[email protected]]
Sent: Monday, August 04, 2014 2:13 PM
To: Lichunhe
Cc: [email protected]; [email protected]; [email protected]; Dingtianhong; Qianhuibin (Huibin QIAN, Euler)
Subject: Re: [PATCHnet/net-next] bonding:Don't received packets if bonding is not upQuoted 4 lines · On Mon, Aug 04, 2014 at 11:15:13AM +0800, [email protected] wrote:
From: Chunhe Li <[email protected]>
If the bonding device is down, it should not receive packets to network stack or other upper flow stack.
This breaks arp monitoring and 802.3ad modes, as they won't ever come up.
Also, please cc netdev next times.
drivers/net/bonding/bond_main.c static rx_handler_result_t
Quoted 11 lines
Signed-off-by Chunhe Li <[email protected]>---
drivers/net/bonding/bond_main.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/bonding/bond_main.cindex 701f86c..48a127b 100644drivers/net/bonding/bond_main.c +0
-0@@ -1110,6 +1110,12 @@ static rx_handler_result_t
bond_handle_frame(struct sk_buff **pskb)Quoted 27 lines
drivers/net/bonding/bond_main.c +6
-3int (*recv_probe)(const struct sk_buff *,struct bonding *,struct slave *);int ret =RX_HANDLER_ANOTHER ; + + slave =bond_slave_get_rcu (skb->dev); + bond = slave->bond; + +if (unlikely (!(bond->dev->flags &IFF_UP ))) +return RX_HANDLER_PASS ; skb =skb_share_check (skb,GFP_ATOMIC );if (unlikely (!skb))@@ -1117,9 +1123,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) *pskb = skb; - slave =bond_slave_get_rcu (skb->dev); - bond = slave->bond; - recv_probe =ACCESS_ONCE (bond->recv_probe);if (recv_probe) {ret = recv_probe(skb, bond, slave);--
1.9.2.0