提交 2afa650c 编写于 作者: J Jiri Benc 提交者: David S. Miller

ipvlan: protect against concurrent link removal

Adding and removing to the 'ipvlans' list is already done using _rcu list
operations.
Signed-off-by: NJiri Benc <jbenc@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 27705f70
...@@ -193,7 +193,8 @@ static void ipvlan_multicast_frame(struct ipvl_port *port, struct sk_buff *skb, ...@@ -193,7 +193,8 @@ static void ipvlan_multicast_frame(struct ipvl_port *port, struct sk_buff *skb,
if (skb->protocol == htons(ETH_P_PAUSE)) if (skb->protocol == htons(ETH_P_PAUSE))
return; return;
list_for_each_entry(ipvlan, &port->ipvlans, pnode) { rcu_read_lock();
list_for_each_entry_rcu(ipvlan, &port->ipvlans, pnode) {
if (local && (ipvlan == in_dev)) if (local && (ipvlan == in_dev))
continue; continue;
...@@ -220,6 +221,7 @@ static void ipvlan_multicast_frame(struct ipvl_port *port, struct sk_buff *skb, ...@@ -220,6 +221,7 @@ static void ipvlan_multicast_frame(struct ipvl_port *port, struct sk_buff *skb,
mcast_acct: mcast_acct:
ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true); ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true);
} }
rcu_read_unlock();
/* Locally generated? ...Forward a copy to the main-device as /* Locally generated? ...Forward a copy to the main-device as
* well. On the RX side we'll ignore it (wont give it to any * well. On the RX side we'll ignore it (wont give it to any
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册