aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 647f2ecfde50..ef203a1581cd 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -977,8 +977,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
977 l_ptr->next_out = buf; 977 l_ptr->next_out = buf;
978 return res; 978 return res;
979 } 979 }
980 } 980 } else
981 else
982 *used_max_pkt = l_ptr->max_pkt; 981 *used_max_pkt = l_ptr->max_pkt;
983 } 982 }
984 return tipc_link_send_buf(l_ptr, buf); /* All other cases */ 983 return tipc_link_send_buf(l_ptr, buf); /* All other cases */
@@ -1132,10 +1131,10 @@ static int link_send_sections_long(struct port *sender,
1132 struct tipc_node *node; 1131 struct tipc_node *node;
1133 struct tipc_msg *hdr = &sender->publ.phdr; 1132 struct tipc_msg *hdr = &sender->publ.phdr;
1134 u32 dsz = msg_data_sz(hdr); 1133 u32 dsz = msg_data_sz(hdr);
1135 u32 max_pkt,fragm_sz,rest; 1134 u32 max_pkt, fragm_sz, rest;
1136 struct tipc_msg fragm_hdr; 1135 struct tipc_msg fragm_hdr;
1137 struct sk_buff *buf,*buf_chain,*prev; 1136 struct sk_buff *buf, *buf_chain, *prev;
1138 u32 fragm_crs,fragm_rest,hsz,sect_rest; 1137 u32 fragm_crs, fragm_rest, hsz, sect_rest;
1139 const unchar *sect_crs; 1138 const unchar *sect_crs;
1140 int curr_sect; 1139 int curr_sect;
1141 u32 fragm_no; 1140 u32 fragm_no;
@@ -1212,7 +1211,7 @@ error:
1212 /* Initiate new fragment: */ 1211 /* Initiate new fragment: */
1213 if (rest <= fragm_sz) { 1212 if (rest <= fragm_sz) {
1214 fragm_sz = rest; 1213 fragm_sz = rest;
1215 msg_set_type(&fragm_hdr,LAST_FRAGMENT); 1214 msg_set_type(&fragm_hdr, LAST_FRAGMENT);
1216 } else { 1215 } else {
1217 msg_set_type(&fragm_hdr, FRAGMENT); 1216 msg_set_type(&fragm_hdr, FRAGMENT);
1218 } 1217 }
@@ -1229,8 +1228,7 @@ error:
1229 fragm_crs = INT_H_SIZE; 1228 fragm_crs = INT_H_SIZE;
1230 fragm_rest = fragm_sz; 1229 fragm_rest = fragm_sz;
1231 } 1230 }
1232 } 1231 } while (rest > 0);
1233 while (rest > 0);
1234 1232
1235 /* 1233 /*
1236 * Now we have a buffer chain. Select a link and check 1234 * Now we have a buffer chain. Select a link and check
@@ -1333,7 +1331,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1333 buf = l_ptr->proto_msg_queue; 1331 buf = l_ptr->proto_msg_queue;
1334 if (buf) { 1332 if (buf) {
1335 msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); 1333 msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1));
1336 msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in); 1334 msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in);
1337 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { 1335 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) {
1338 l_ptr->unacked_window = 0; 1336 l_ptr->unacked_window = 0;
1339 buf_discard(buf); 1337 buf_discard(buf);
@@ -1847,8 +1845,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
1847 } 1845 }
1848 prev = crs; 1846 prev = crs;
1849 crs = crs->next; 1847 crs = crs->next;
1850 } 1848 } while (crs);
1851 while (crs);
1852 1849
1853 /* Message is a duplicate of an existing message */ 1850 /* Message is a duplicate of an existing message */
1854 1851
@@ -2215,11 +2212,11 @@ void tipc_link_changeover(struct link *l_ptr)
2215 2212
2216 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) { 2213 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) {
2217 struct tipc_msg *m = msg_get_wrapped(msg); 2214 struct tipc_msg *m = msg_get_wrapped(msg);
2218 unchar* pos = (unchar*)m; 2215 unchar *pos = (unchar *)m;
2219 2216
2220 msgcount = msg_msgcnt(msg); 2217 msgcount = msg_msgcnt(msg);
2221 while (msgcount--) { 2218 while (msgcount--) {
2222 msg_set_seqno(m,msg_seqno(msg)); 2219 msg_set_seqno(m, msg_seqno(msg));
2223 tipc_link_tunnel(l_ptr, &tunnel_hdr, m, 2220 tipc_link_tunnel(l_ptr, &tunnel_hdr, m,
2224 msg_link_selector(m)); 2221 msg_link_selector(m));
2225 pos += align(msg_size(m)); 2222 pos += align(msg_size(m));
@@ -2321,7 +2318,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
2321 if (msg_typ == DUPLICATE_MSG) { 2318 if (msg_typ == DUPLICATE_MSG) {
2322 if (less(msg_seqno(msg), mod(dest_link->next_in_no))) 2319 if (less(msg_seqno(msg), mod(dest_link->next_in_no)))
2323 goto exit; 2320 goto exit;
2324 *buf = buf_extract(tunnel_buf,INT_H_SIZE); 2321 *buf = buf_extract(tunnel_buf, INT_H_SIZE);
2325 if (*buf == NULL) { 2322 if (*buf == NULL) {
2326 warn("Link changeover error, duplicate msg dropped\n"); 2323 warn("Link changeover error, duplicate msg dropped\n");
2327 goto exit; 2324 goto exit;
@@ -2552,8 +2549,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2552 /* Prepare buffer for subsequent fragments. */ 2549 /* Prepare buffer for subsequent fragments. */
2553 2550
2554 set_long_msg_seqno(pbuf, long_msg_seq_no); 2551 set_long_msg_seqno(pbuf, long_msg_seq_no);
2555 set_fragm_size(pbuf,fragm_sz); 2552 set_fragm_size(pbuf, fragm_sz);
2556 set_expected_frags(pbuf,exp_fragm_cnt - 1); 2553 set_expected_frags(pbuf, exp_fragm_cnt - 1);
2557 } else { 2554 } else {
2558 warn("Link unable to reassemble fragmented message\n"); 2555 warn("Link unable to reassemble fragmented message\n");
2559 } 2556 }
@@ -2580,7 +2577,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2580 *m = buf_msg(pbuf); 2577 *m = buf_msg(pbuf);
2581 return 1; 2578 return 1;
2582 } 2579 }
2583 set_expected_frags(pbuf,exp_frags); 2580 set_expected_frags(pbuf, exp_frags);
2584 return 0; 2581 return 0;
2585 } 2582 }
2586 buf_discard(fbuf); 2583 buf_discard(fbuf);