diff options
author | David S. Miller <davem@davemloft.net> | 2016-10-30 12:42:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-30 12:42:58 -0400 |
commit | 27058af401e49d88a905df000dd26f443fcfa8ce (patch) | |
tree | 819f32113d3b8374b9fbf72e2202d4c4d4511a60 /net/tipc | |
parent | 357f4aae859b5d74554b0ccbb18556f1df4166c3 (diff) | |
parent | 2a26d99b251b8625d27aed14e97fc10707a3a81f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Mostly simple overlapping changes.
For example, David Ahern's adjacency list revamp in 'net-next'
conflicted with an adjacency list traversal bug fix in 'net'.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bcast.c | 14 | ||||
-rw-r--r-- | net/tipc/bcast.h | 3 | ||||
-rw-r--r-- | net/tipc/link.c | 2 | ||||
-rw-r--r-- | net/tipc/msg.h | 17 | ||||
-rw-r--r-- | net/tipc/name_distr.c | 1 | ||||
-rw-r--r-- | net/tipc/node.c | 2 |
6 files changed, 33 insertions, 6 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 753f774cb46f..aa1babbea385 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -247,11 +247,17 @@ int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb) | |||
247 | * | 247 | * |
248 | * RCU is locked, no other locks set | 248 | * RCU is locked, no other locks set |
249 | */ | 249 | */ |
250 | void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, u32 acked) | 250 | void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, |
251 | struct tipc_msg *hdr) | ||
251 | { | 252 | { |
252 | struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; | 253 | struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; |
254 | u16 acked = msg_bcast_ack(hdr); | ||
253 | struct sk_buff_head xmitq; | 255 | struct sk_buff_head xmitq; |
254 | 256 | ||
257 | /* Ignore bc acks sent by peer before bcast synch point was received */ | ||
258 | if (msg_bc_ack_invalid(hdr)) | ||
259 | return; | ||
260 | |||
255 | __skb_queue_head_init(&xmitq); | 261 | __skb_queue_head_init(&xmitq); |
256 | 262 | ||
257 | tipc_bcast_lock(net); | 263 | tipc_bcast_lock(net); |
@@ -279,11 +285,11 @@ int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l, | |||
279 | __skb_queue_head_init(&xmitq); | 285 | __skb_queue_head_init(&xmitq); |
280 | 286 | ||
281 | tipc_bcast_lock(net); | 287 | tipc_bcast_lock(net); |
282 | if (msg_type(hdr) == STATE_MSG) { | 288 | if (msg_type(hdr) != STATE_MSG) { |
289 | tipc_link_bc_init_rcv(l, hdr); | ||
290 | } else if (!msg_bc_ack_invalid(hdr)) { | ||
283 | tipc_link_bc_ack_rcv(l, msg_bcast_ack(hdr), &xmitq); | 291 | tipc_link_bc_ack_rcv(l, msg_bcast_ack(hdr), &xmitq); |
284 | rc = tipc_link_bc_sync_rcv(l, hdr, &xmitq); | 292 | rc = tipc_link_bc_sync_rcv(l, hdr, &xmitq); |
285 | } else { | ||
286 | tipc_link_bc_init_rcv(l, hdr); | ||
287 | } | 293 | } |
288 | tipc_bcast_unlock(net); | 294 | tipc_bcast_unlock(net); |
289 | 295 | ||
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index 5ffe34472ccd..855d53c64ab3 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -55,7 +55,8 @@ void tipc_bcast_dec_bearer_dst_cnt(struct net *net, int bearer_id); | |||
55 | int tipc_bcast_get_mtu(struct net *net); | 55 | int tipc_bcast_get_mtu(struct net *net); |
56 | int tipc_bcast_xmit(struct net *net, struct sk_buff_head *list); | 56 | int tipc_bcast_xmit(struct net *net, struct sk_buff_head *list); |
57 | int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb); | 57 | int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb); |
58 | void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, u32 acked); | 58 | void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, |
59 | struct tipc_msg *hdr); | ||
59 | int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l, | 60 | int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l, |
60 | struct tipc_msg *hdr); | 61 | struct tipc_msg *hdr); |
61 | int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg); | 62 | int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index b36e16cdc945..1055164c6232 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1312,6 +1312,7 @@ static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe, | |||
1312 | msg_set_next_sent(hdr, l->snd_nxt); | 1312 | msg_set_next_sent(hdr, l->snd_nxt); |
1313 | msg_set_ack(hdr, l->rcv_nxt - 1); | 1313 | msg_set_ack(hdr, l->rcv_nxt - 1); |
1314 | msg_set_bcast_ack(hdr, bcl->rcv_nxt - 1); | 1314 | msg_set_bcast_ack(hdr, bcl->rcv_nxt - 1); |
1315 | msg_set_bc_ack_invalid(hdr, !node_up); | ||
1315 | msg_set_last_bcast(hdr, l->bc_sndlink->snd_nxt - 1); | 1316 | msg_set_last_bcast(hdr, l->bc_sndlink->snd_nxt - 1); |
1316 | msg_set_link_tolerance(hdr, tolerance); | 1317 | msg_set_link_tolerance(hdr, tolerance); |
1317 | msg_set_linkprio(hdr, priority); | 1318 | msg_set_linkprio(hdr, priority); |
@@ -1574,6 +1575,7 @@ static void tipc_link_build_bc_init_msg(struct tipc_link *l, | |||
1574 | __skb_queue_head_init(&list); | 1575 | __skb_queue_head_init(&list); |
1575 | if (!tipc_link_build_bc_proto_msg(l->bc_rcvlink, false, 0, &list)) | 1576 | if (!tipc_link_build_bc_proto_msg(l->bc_rcvlink, false, 0, &list)) |
1576 | return; | 1577 | return; |
1578 | msg_set_bc_ack_invalid(buf_msg(skb_peek(&list)), true); | ||
1577 | tipc_link_xmit(l, &list, xmitq); | 1579 | tipc_link_xmit(l, &list, xmitq); |
1578 | } | 1580 | } |
1579 | 1581 | ||
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index c3832cdf2278..50a739860d37 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h | |||
@@ -714,6 +714,23 @@ static inline void msg_set_peer_stopping(struct tipc_msg *m, u32 s) | |||
714 | msg_set_bits(m, 5, 13, 0x1, s); | 714 | msg_set_bits(m, 5, 13, 0x1, s); |
715 | } | 715 | } |
716 | 716 | ||
717 | static inline bool msg_bc_ack_invalid(struct tipc_msg *m) | ||
718 | { | ||
719 | switch (msg_user(m)) { | ||
720 | case BCAST_PROTOCOL: | ||
721 | case NAME_DISTRIBUTOR: | ||
722 | case LINK_PROTOCOL: | ||
723 | return msg_bits(m, 5, 14, 0x1); | ||
724 | default: | ||
725 | return false; | ||
726 | } | ||
727 | } | ||
728 | |||
729 | static inline void msg_set_bc_ack_invalid(struct tipc_msg *m, bool invalid) | ||
730 | { | ||
731 | msg_set_bits(m, 5, 14, 0x1, invalid); | ||
732 | } | ||
733 | |||
717 | static inline char *msg_media_addr(struct tipc_msg *m) | 734 | static inline char *msg_media_addr(struct tipc_msg *m) |
718 | { | 735 | { |
719 | return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET]; | 736 | return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET]; |
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index a04fe9be1c60..c1cfd92de17a 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c | |||
@@ -156,6 +156,7 @@ static void named_distribute(struct net *net, struct sk_buff_head *list, | |||
156 | pr_warn("Bulk publication failure\n"); | 156 | pr_warn("Bulk publication failure\n"); |
157 | return; | 157 | return; |
158 | } | 158 | } |
159 | msg_set_bc_ack_invalid(buf_msg(skb), true); | ||
159 | item = (struct distr_item *)msg_data(buf_msg(skb)); | 160 | item = (struct distr_item *)msg_data(buf_msg(skb)); |
160 | } | 161 | } |
161 | 162 | ||
diff --git a/net/tipc/node.c b/net/tipc/node.c index 7ef14e2d2356..9d2f4c2b08ab 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1535,7 +1535,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) | |||
1535 | if (unlikely(usr == LINK_PROTOCOL)) | 1535 | if (unlikely(usr == LINK_PROTOCOL)) |
1536 | tipc_node_bc_sync_rcv(n, hdr, bearer_id, &xmitq); | 1536 | tipc_node_bc_sync_rcv(n, hdr, bearer_id, &xmitq); |
1537 | else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack)) | 1537 | else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack)) |
1538 | tipc_bcast_ack_rcv(net, n->bc_entry.link, bc_ack); | 1538 | tipc_bcast_ack_rcv(net, n->bc_entry.link, hdr); |
1539 | 1539 | ||
1540 | /* Receive packet directly if conditions permit */ | 1540 | /* Receive packet directly if conditions permit */ |
1541 | tipc_node_read_lock(n); | 1541 | tipc_node_read_lock(n); |