diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 2a9f44a203eb..4bab139d5e74 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -92,7 +92,8 @@ static int link_recv_changeover_msg(struct link **l_ptr, struct sk_buff **buf); | |||
92 | static void link_set_supervision_props(struct link *l_ptr, u32 tolerance); | 92 | static void link_set_supervision_props(struct link *l_ptr, u32 tolerance); |
93 | static int link_send_sections_long(struct tipc_port *sender, | 93 | static int link_send_sections_long(struct tipc_port *sender, |
94 | struct iovec const *msg_sect, | 94 | struct iovec const *msg_sect, |
95 | u32 num_sect, u32 destnode); | 95 | u32 num_sect, unsigned int total_len, |
96 | u32 destnode); | ||
96 | static void link_check_defragm_bufs(struct link *l_ptr); | 97 | static void link_check_defragm_bufs(struct link *l_ptr); |
97 | static void link_state_event(struct link *l_ptr, u32 event); | 98 | static void link_state_event(struct link *l_ptr, u32 event); |
98 | static void link_reset_statistics(struct link *l_ptr); | 99 | static void link_reset_statistics(struct link *l_ptr); |
@@ -1043,6 +1044,7 @@ int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) | |||
1043 | int tipc_link_send_sections_fast(struct tipc_port *sender, | 1044 | int tipc_link_send_sections_fast(struct tipc_port *sender, |
1044 | struct iovec const *msg_sect, | 1045 | struct iovec const *msg_sect, |
1045 | const u32 num_sect, | 1046 | const u32 num_sect, |
1047 | unsigned int total_len, | ||
1046 | u32 destaddr) | 1048 | u32 destaddr) |
1047 | { | 1049 | { |
1048 | struct tipc_msg *hdr = &sender->phdr; | 1050 | struct tipc_msg *hdr = &sender->phdr; |
@@ -1058,8 +1060,8 @@ again: | |||
1058 | * (Must not hold any locks while building message.) | 1060 | * (Must not hold any locks while building message.) |
1059 | */ | 1061 | */ |
1060 | 1062 | ||
1061 | res = tipc_msg_build(hdr, msg_sect, num_sect, sender->max_pkt, | 1063 | res = tipc_msg_build(hdr, msg_sect, num_sect, total_len, |
1062 | !sender->user_port, &buf); | 1064 | sender->max_pkt, !sender->user_port, &buf); |
1063 | 1065 | ||
1064 | read_lock_bh(&tipc_net_lock); | 1066 | read_lock_bh(&tipc_net_lock); |
1065 | node = tipc_node_find(destaddr); | 1067 | node = tipc_node_find(destaddr); |
@@ -1104,7 +1106,8 @@ exit: | |||
1104 | goto again; | 1106 | goto again; |
1105 | 1107 | ||
1106 | return link_send_sections_long(sender, msg_sect, | 1108 | return link_send_sections_long(sender, msg_sect, |
1107 | num_sect, destaddr); | 1109 | num_sect, total_len, |
1110 | destaddr); | ||
1108 | } | 1111 | } |
1109 | tipc_node_unlock(node); | 1112 | tipc_node_unlock(node); |
1110 | } | 1113 | } |
@@ -1116,7 +1119,7 @@ exit: | |||
1116 | return tipc_reject_msg(buf, TIPC_ERR_NO_NODE); | 1119 | return tipc_reject_msg(buf, TIPC_ERR_NO_NODE); |
1117 | if (res >= 0) | 1120 | if (res >= 0) |
1118 | return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect, | 1121 | return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect, |
1119 | TIPC_ERR_NO_NODE); | 1122 | total_len, TIPC_ERR_NO_NODE); |
1120 | return res; | 1123 | return res; |
1121 | } | 1124 | } |
1122 | 1125 | ||
@@ -1137,12 +1140,13 @@ exit: | |||
1137 | static int link_send_sections_long(struct tipc_port *sender, | 1140 | static int link_send_sections_long(struct tipc_port *sender, |
1138 | struct iovec const *msg_sect, | 1141 | struct iovec const *msg_sect, |
1139 | u32 num_sect, | 1142 | u32 num_sect, |
1143 | unsigned int total_len, | ||
1140 | u32 destaddr) | 1144 | u32 destaddr) |
1141 | { | 1145 | { |
1142 | struct link *l_ptr; | 1146 | struct link *l_ptr; |
1143 | struct tipc_node *node; | 1147 | struct tipc_node *node; |
1144 | struct tipc_msg *hdr = &sender->phdr; | 1148 | struct tipc_msg *hdr = &sender->phdr; |
1145 | u32 dsz = msg_data_sz(hdr); | 1149 | u32 dsz = total_len; |
1146 | u32 max_pkt, fragm_sz, rest; | 1150 | u32 max_pkt, fragm_sz, rest; |
1147 | struct tipc_msg fragm_hdr; | 1151 | struct tipc_msg fragm_hdr; |
1148 | struct sk_buff *buf, *buf_chain, *prev; | 1152 | struct sk_buff *buf, *buf_chain, *prev; |
@@ -1269,7 +1273,7 @@ reject: | |||
1269 | buf_discard(buf_chain); | 1273 | buf_discard(buf_chain); |
1270 | } | 1274 | } |
1271 | return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect, | 1275 | return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect, |
1272 | TIPC_ERR_NO_NODE); | 1276 | total_len, TIPC_ERR_NO_NODE); |
1273 | } | 1277 | } |
1274 | 1278 | ||
1275 | /* Append whole chain to send queue: */ | 1279 | /* Append whole chain to send queue: */ |