aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-23 02:44:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-23 02:44:31 -0400
commit107df03203bb66de56e2caec3bde6d22b55480c5 (patch)
treecff42c091a4a9f43203bbb85c9cf526857470a8f /net/tipc
parent88083e9845612826dfd44a5215647b4f6567317c (diff)
parentf8e7718cc0445587fe8530fc2d240d9aac2c9072 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix memory leak in nftables, from Liping Zhang. 2) Need to check result of vlan_insert_tag() in batman-adv otherwise we risk NULL skb derefs, from Sven Eckelmann. 3) Check for dev_alloc_skb() failures in cfg80211, from Gregory Greenman. 4) Handle properly when we have ppp_unregister_channel() happening in parallel with ppp_connect_channel(), from WANG Cong. 5) Fix DCCP deadlock, from Eric Dumazet. 6) Bail out properly in UDP if sk_filter() truncates the packet to be smaller than even the space that the protocol headers need. From Michal Kubecek. 7) Similarly for rose, dccp, and sctp, from Willem de Bruijn. 8) Make TCP challenge ACKs less predictable, from Eric Dumazet. 9) Fix infinite loop in bgmac_dma_tx_add() from Florian Fainelli. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits) packet: propagate sock_cmsg_send() error net/mlx5e: Fix del vxlan port command buffer memset packet: fix second argument of sock_tx_timestamp() net: switchdev: change ageing_time type to clock_t Update maintainer for EHEA driver. net/mlx4_en: Add resilience in low memory systems net/mlx4_en: Move filters cleanup to a proper location sctp: load transport header after sk_filter net/sched/sch_htb: clamp xstats tokens to fit into 32-bit int net: cavium: liquidio: Avoid dma_unmap_single on uninitialized ndata net: nb8800: Fix SKB leak in nb8800_receive() et131x: Fix logical vs bitwise check in et131x_tx_timeout() vlan: use a valid default mtu value for vlan over macsec net: bgmac: Fix infinite loop in bgmac_dma_tx_add() mlxsw: spectrum: Prevent invalid ingress buffer mapping mlxsw: spectrum: Prevent overwrite of DCB capability fields mlxsw: spectrum: Don't emit errors when PFC is disabled mlxsw: spectrum: Indicate support for autonegotiation mlxsw: spectrum: Force link training according to admin state r8152: add MODULE_VERSION ...
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/bearer.c15
-rw-r--r--net/tipc/bearer.h1
-rw-r--r--net/tipc/link.c9
-rw-r--r--net/tipc/node.c15
4 files changed, 35 insertions, 5 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index bf8f05c3eb82..a597708ae381 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -330,6 +330,21 @@ static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b)
330 return 0; 330 return 0;
331} 331}
332 332
333/* tipc_bearer_reset_all - reset all links on all bearers
334 */
335void tipc_bearer_reset_all(struct net *net)
336{
337 struct tipc_net *tn = tipc_net(net);
338 struct tipc_bearer *b;
339 int i;
340
341 for (i = 0; i < MAX_BEARERS; i++) {
342 b = rcu_dereference_rtnl(tn->bearer_list[i]);
343 if (b)
344 tipc_reset_bearer(net, b);
345 }
346}
347
333/** 348/**
334 * bearer_disable 349 * bearer_disable
335 * 350 *
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index f686e41b5abb..60e49c3be19c 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -198,6 +198,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest);
198void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest); 198void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest);
199struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name); 199struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name);
200struct tipc_media *tipc_media_find(const char *name); 200struct tipc_media *tipc_media_find(const char *name);
201void tipc_bearer_reset_all(struct net *net);
201int tipc_bearer_setup(void); 202int tipc_bearer_setup(void);
202void tipc_bearer_cleanup(void); 203void tipc_bearer_cleanup(void);
203void tipc_bearer_stop(struct net *net); 204void tipc_bearer_stop(struct net *net);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 67b6ab9f4c8d..7d89f8713d49 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -349,6 +349,8 @@ void tipc_link_remove_bc_peer(struct tipc_link *snd_l,
349 u16 ack = snd_l->snd_nxt - 1; 349 u16 ack = snd_l->snd_nxt - 1;
350 350
351 snd_l->ackers--; 351 snd_l->ackers--;
352 rcv_l->bc_peer_is_up = true;
353 rcv_l->state = LINK_ESTABLISHED;
352 tipc_link_bc_ack_rcv(rcv_l, ack, xmitq); 354 tipc_link_bc_ack_rcv(rcv_l, ack, xmitq);
353 tipc_link_reset(rcv_l); 355 tipc_link_reset(rcv_l);
354 rcv_l->state = LINK_RESET; 356 rcv_l->state = LINK_RESET;
@@ -1559,7 +1561,12 @@ void tipc_link_bc_sync_rcv(struct tipc_link *l, struct tipc_msg *hdr,
1559 if (!msg_peer_node_is_up(hdr)) 1561 if (!msg_peer_node_is_up(hdr))
1560 return; 1562 return;
1561 1563
1562 l->bc_peer_is_up = true; 1564 /* Open when peer ackowledges our bcast init msg (pkt #1) */
1565 if (msg_ack(hdr))
1566 l->bc_peer_is_up = true;
1567
1568 if (!l->bc_peer_is_up)
1569 return;
1563 1570
1564 /* Ignore if peers_snd_nxt goes beyond receive window */ 1571 /* Ignore if peers_snd_nxt goes beyond receive window */
1565 if (more(peers_snd_nxt, l->rcv_nxt + l->window)) 1572 if (more(peers_snd_nxt, l->rcv_nxt + l->window))
diff --git a/net/tipc/node.c b/net/tipc/node.c
index e01e2c71b5a1..23d4761842a0 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1297,10 +1297,6 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
1297 1297
1298 rc = tipc_bcast_rcv(net, be->link, skb); 1298 rc = tipc_bcast_rcv(net, be->link, skb);
1299 1299
1300 /* Broadcast link reset may happen at reassembly failure */
1301 if (rc & TIPC_LINK_DOWN_EVT)
1302 tipc_node_reset_links(n);
1303
1304 /* Broadcast ACKs are sent on a unicast link */ 1300 /* Broadcast ACKs are sent on a unicast link */
1305 if (rc & TIPC_LINK_SND_BC_ACK) { 1301 if (rc & TIPC_LINK_SND_BC_ACK) {
1306 tipc_node_read_lock(n); 1302 tipc_node_read_lock(n);
@@ -1320,6 +1316,17 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
1320 spin_unlock_bh(&be->inputq2.lock); 1316 spin_unlock_bh(&be->inputq2.lock);
1321 tipc_sk_mcast_rcv(net, &be->arrvq, &be->inputq2); 1317 tipc_sk_mcast_rcv(net, &be->arrvq, &be->inputq2);
1322 } 1318 }
1319
1320 if (rc & TIPC_LINK_DOWN_EVT) {
1321 /* Reception reassembly failure => reset all links to peer */
1322 if (!tipc_link_is_up(be->link))
1323 tipc_node_reset_links(n);
1324
1325 /* Retransmission failure => reset all links to all peers */
1326 if (!tipc_link_is_up(tipc_bc_sndlink(net)))
1327 tipc_bearer_reset_all(net);
1328 }
1329
1323 tipc_node_put(n); 1330 tipc_node_put(n);
1324} 1331}
1325 1332