diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 7d3b6e7d852a..819fb7163fa2 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -175,9 +175,12 @@ bool link_is_bc_rcvlink(struct tipc_link *l) | |||
175 | 175 | ||
176 | int tipc_link_is_active(struct tipc_link *l) | 176 | int tipc_link_is_active(struct tipc_link *l) |
177 | { | 177 | { |
178 | struct tipc_node *n = l->owner; | 178 | return l->active; |
179 | } | ||
179 | 180 | ||
180 | return (node_active_link(n, 0) == l) || (node_active_link(n, 1) == l); | 181 | void tipc_link_set_active(struct tipc_link *l, bool active) |
182 | { | ||
183 | l->active = active; | ||
181 | } | 184 | } |
182 | 185 | ||
183 | void tipc_link_add_bc_peer(struct tipc_link *snd_l, | 186 | void tipc_link_add_bc_peer(struct tipc_link *snd_l, |
@@ -250,7 +253,7 @@ static u32 link_own_addr(struct tipc_link *l) | |||
250 | * | 253 | * |
251 | * Returns true if link was created, otherwise false | 254 | * Returns true if link was created, otherwise false |
252 | */ | 255 | */ |
253 | bool tipc_link_create(struct tipc_node *n, char *if_name, int bearer_id, | 256 | bool tipc_link_create(struct net *net, char *if_name, int bearer_id, |
254 | int tolerance, char net_plane, u32 mtu, int priority, | 257 | int tolerance, char net_plane, u32 mtu, int priority, |
255 | int window, u32 session, u32 ownnode, u32 peer, | 258 | int window, u32 session, u32 ownnode, u32 peer, |
256 | u16 peer_caps, | 259 | u16 peer_caps, |
@@ -284,7 +287,7 @@ bool tipc_link_create(struct tipc_node *n, char *if_name, int bearer_id, | |||
284 | l->addr = peer; | 287 | l->addr = peer; |
285 | l->peer_caps = peer_caps; | 288 | l->peer_caps = peer_caps; |
286 | l->media_addr = maddr; | 289 | l->media_addr = maddr; |
287 | l->owner = n; | 290 | l->net = net; |
288 | l->peer_session = WILDCARD_SESSION; | 291 | l->peer_session = WILDCARD_SESSION; |
289 | l->bearer_id = bearer_id; | 292 | l->bearer_id = bearer_id; |
290 | l->tolerance = tolerance; | 293 | l->tolerance = tolerance; |
@@ -318,7 +321,7 @@ bool tipc_link_create(struct tipc_node *n, char *if_name, int bearer_id, | |||
318 | * | 321 | * |
319 | * Returns true if link was created, otherwise false | 322 | * Returns true if link was created, otherwise false |
320 | */ | 323 | */ |
321 | bool tipc_link_bc_create(struct tipc_node *n, u32 ownnode, u32 peer, | 324 | bool tipc_link_bc_create(struct net *net, u32 ownnode, u32 peer, |
322 | int mtu, int window, u16 peer_caps, | 325 | int mtu, int window, u16 peer_caps, |
323 | struct sk_buff_head *inputq, | 326 | struct sk_buff_head *inputq, |
324 | struct sk_buff_head *namedq, | 327 | struct sk_buff_head *namedq, |
@@ -327,7 +330,7 @@ bool tipc_link_bc_create(struct tipc_node *n, u32 ownnode, u32 peer, | |||
327 | { | 330 | { |
328 | struct tipc_link *l; | 331 | struct tipc_link *l; |
329 | 332 | ||
330 | if (!tipc_link_create(n, "", MAX_BEARERS, 0, 'Z', mtu, 0, window, | 333 | if (!tipc_link_create(net, "", MAX_BEARERS, 0, 'Z', mtu, 0, window, |
331 | 0, ownnode, peer, peer_caps, NULL, bc_sndlink, | 334 | 0, ownnode, peer, peer_caps, NULL, bc_sndlink, |
332 | NULL, inputq, namedq, link)) | 335 | NULL, inputq, namedq, link)) |
333 | return false; | 336 | return false; |
@@ -889,10 +892,10 @@ void tipc_link_push_packets(struct tipc_link *link) | |||
889 | msg_set_ack(msg, ack); | 892 | msg_set_ack(msg, ack); |
890 | msg_set_seqno(msg, seqno); | 893 | msg_set_seqno(msg, seqno); |
891 | seqno = mod(seqno + 1); | 894 | seqno = mod(seqno + 1); |
892 | msg_set_bcast_ack(msg, link->owner->bclink.last_in); | 895 | /* msg_set_bcast_ack(msg, link->owner->bclink.last_in); */ |
893 | link->rcv_unacked = 0; | 896 | link->rcv_unacked = 0; |
894 | __skb_queue_tail(&link->transmq, skb); | 897 | __skb_queue_tail(&link->transmq, skb); |
895 | tipc_bearer_send(link->owner->net, link->bearer_id, | 898 | tipc_bearer_send(link->net, link->bearer_id, |
896 | skb, link->media_addr); | 899 | skb, link->media_addr); |
897 | } | 900 | } |
898 | link->snd_nxt = seqno; | 901 | link->snd_nxt = seqno; |
@@ -966,8 +969,8 @@ void tipc_link_retransmit(struct tipc_link *l_ptr, struct sk_buff *skb, | |||
966 | break; | 969 | break; |
967 | msg = buf_msg(skb); | 970 | msg = buf_msg(skb); |
968 | msg_set_ack(msg, mod(l_ptr->rcv_nxt - 1)); | 971 | msg_set_ack(msg, mod(l_ptr->rcv_nxt - 1)); |
969 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); | 972 | /* msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); */ |
970 | tipc_bearer_send(l_ptr->owner->net, l_ptr->bearer_id, skb, | 973 | tipc_bearer_send(l_ptr->net, l_ptr->bearer_id, skb, |
971 | l_ptr->media_addr); | 974 | l_ptr->media_addr); |
972 | retransmits--; | 975 | retransmits--; |
973 | l_ptr->stats.retransmitted++; | 976 | l_ptr->stats.retransmitted++; |
@@ -1102,9 +1105,9 @@ static int tipc_link_input(struct tipc_link *l, struct sk_buff *skb, | |||
1102 | } | 1105 | } |
1103 | return 0; | 1106 | return 0; |
1104 | } else if (usr == BCAST_PROTOCOL) { | 1107 | } else if (usr == BCAST_PROTOCOL) { |
1105 | tipc_bcast_lock(l->owner->net); | 1108 | tipc_bcast_lock(l->net); |
1106 | tipc_link_bc_init_rcv(l->bc_rcvlink, hdr); | 1109 | tipc_link_bc_init_rcv(l->bc_rcvlink, hdr); |
1107 | tipc_bcast_unlock(l->owner->net); | 1110 | tipc_bcast_unlock(l->net); |
1108 | } | 1111 | } |
1109 | drop: | 1112 | drop: |
1110 | kfree_skb(skb); | 1113 | kfree_skb(skb); |
@@ -1300,7 +1303,7 @@ void tipc_link_proto_xmit(struct tipc_link *l, u32 msg_typ, int probe_msg, | |||
1300 | skb = __skb_dequeue(&xmitq); | 1303 | skb = __skb_dequeue(&xmitq); |
1301 | if (!skb) | 1304 | if (!skb) |
1302 | return; | 1305 | return; |
1303 | tipc_bearer_xmit_skb(l->owner->net, l->bearer_id, skb, l->media_addr); | 1306 | tipc_bearer_xmit_skb(l->net, l->bearer_id, skb, l->media_addr); |
1304 | l->rcv_unacked = 0; | 1307 | l->rcv_unacked = 0; |
1305 | } | 1308 | } |
1306 | 1309 | ||
@@ -2004,7 +2007,7 @@ static int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, | |||
2004 | if (tipc_link_is_up(link)) | 2007 | if (tipc_link_is_up(link)) |
2005 | if (nla_put_flag(msg->skb, TIPC_NLA_LINK_UP)) | 2008 | if (nla_put_flag(msg->skb, TIPC_NLA_LINK_UP)) |
2006 | goto attr_msg_full; | 2009 | goto attr_msg_full; |
2007 | if (tipc_link_is_active(link)) | 2010 | if (link->active) |
2008 | if (nla_put_flag(msg->skb, TIPC_NLA_LINK_ACTIVE)) | 2011 | if (nla_put_flag(msg->skb, TIPC_NLA_LINK_ACTIVE)) |
2009 | goto attr_msg_full; | 2012 | goto attr_msg_full; |
2010 | 2013 | ||