aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c4
-rw-r--r--net/tipc/msg.h10
-rw-r--r--net/tipc/name_distr.c6
-rw-r--r--net/tipc/port.c20
4 files changed, 20 insertions, 20 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 5bfe000b2a6b..f89570c54f54 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1572,7 +1572,7 @@ static struct sk_buff *link_insert_deferred_queue(struct link *l_ptr,
1572static int link_recv_buf_validate(struct sk_buff *buf) 1572static int link_recv_buf_validate(struct sk_buff *buf)
1573{ 1573{
1574 static u32 min_data_hdr_size[8] = { 1574 static u32 min_data_hdr_size[8] = {
1575 SHORT_H_SIZE, MCAST_H_SIZE, LONG_H_SIZE, DIR_MSG_H_SIZE, 1575 SHORT_H_SIZE, MCAST_H_SIZE, NAMED_H_SIZE, BASIC_H_SIZE,
1576 MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE 1576 MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE
1577 }; 1577 };
1578 1578
@@ -2553,7 +2553,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2553 u32 msg_sz = msg_size(imsg); 2553 u32 msg_sz = msg_size(imsg);
2554 u32 fragm_sz = msg_data_sz(fragm); 2554 u32 fragm_sz = msg_data_sz(fragm);
2555 u32 exp_fragm_cnt = msg_sz/fragm_sz + !!(msg_sz % fragm_sz); 2555 u32 exp_fragm_cnt = msg_sz/fragm_sz + !!(msg_sz % fragm_sz);
2556 u32 max = TIPC_MAX_USER_MSG_SIZE + LONG_H_SIZE; 2556 u32 max = TIPC_MAX_USER_MSG_SIZE + NAMED_H_SIZE;
2557 if (msg_type(imsg) == TIPC_MCAST_MSG) 2557 if (msg_type(imsg) == TIPC_MCAST_MSG)
2558 max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; 2558 max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE;
2559 if (msg_size(imsg) > max) { 2559 if (msg_size(imsg) > max) {
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index a58975ced222..d93178f2e852 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -68,10 +68,10 @@
68 * Message header sizes 68 * Message header sizes
69 */ 69 */
70 70
71#define SHORT_H_SIZE 24 /* Connected, in-cluster messages */ 71#define SHORT_H_SIZE 24 /* In-cluster basic payload message */
72#define DIR_MSG_H_SIZE 32 /* Directly addressed messages */ 72#define BASIC_H_SIZE 32 /* Basic payload message */
73#define LONG_H_SIZE 40 /* Named messages */ 73#define NAMED_H_SIZE 40 /* Named payload message */
74#define MCAST_H_SIZE 44 /* Multicast messages */ 74#define MCAST_H_SIZE 44 /* Multicast payload message */
75#define INT_H_SIZE 40 /* Internal messages */ 75#define INT_H_SIZE 40 /* Internal messages */
76#define MIN_H_SIZE 24 /* Smallest legal TIPC header size */ 76#define MIN_H_SIZE 24 /* Smallest legal TIPC header size */
77#define MAX_H_SIZE 60 /* Largest possible TIPC header size */ 77#define MAX_H_SIZE 60 /* Largest possible TIPC header size */
@@ -357,7 +357,7 @@ static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p)
357 357
358static inline int msg_short(struct tipc_msg *m) 358static inline int msg_short(struct tipc_msg *m)
359{ 359{
360 return msg_hdr_sz(m) == 24; 360 return msg_hdr_sz(m) == SHORT_H_SIZE;
361} 361}
362 362
363static inline u32 msg_orignode(struct tipc_msg *m) 363static inline u32 msg_orignode(struct tipc_msg *m)
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 80025a1b3bfd..cd356e504332 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -94,13 +94,13 @@ static void publ_to_item(struct distr_item *i, struct publication *p)
94 94
95static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest) 95static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
96{ 96{
97 struct sk_buff *buf = tipc_buf_acquire(LONG_H_SIZE + size); 97 struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size);
98 struct tipc_msg *msg; 98 struct tipc_msg *msg;
99 99
100 if (buf != NULL) { 100 if (buf != NULL) {
101 msg = buf_msg(buf); 101 msg = buf_msg(buf);
102 tipc_msg_init(msg, NAME_DISTRIBUTOR, type, LONG_H_SIZE, dest); 102 tipc_msg_init(msg, NAME_DISTRIBUTOR, type, INT_H_SIZE, dest);
103 msg_set_size(msg, LONG_H_SIZE + size); 103 msg_set_size(msg, INT_H_SIZE + size);
104 } 104 }
105 return buf; 105 return buf;
106} 106}
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 53118171b7e6..70e9de577113 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -222,7 +222,7 @@ struct tipc_port *tipc_createport_raw(void *usr_handle,
222 p_ptr->max_pkt = MAX_PKT_DEFAULT; 222 p_ptr->max_pkt = MAX_PKT_DEFAULT;
223 p_ptr->ref = ref; 223 p_ptr->ref = ref;
224 msg = &p_ptr->phdr; 224 msg = &p_ptr->phdr;
225 tipc_msg_init(msg, importance, TIPC_NAMED_MSG, LONG_H_SIZE, 0); 225 tipc_msg_init(msg, importance, TIPC_NAMED_MSG, NAMED_H_SIZE, 0);
226 msg_set_origport(msg, ref); 226 msg_set_origport(msg, ref);
227 INIT_LIST_HEAD(&p_ptr->wait_list); 227 INIT_LIST_HEAD(&p_ptr->wait_list);
228 INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list); 228 INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
@@ -339,10 +339,10 @@ static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode,
339 struct sk_buff *buf; 339 struct sk_buff *buf;
340 struct tipc_msg *msg; 340 struct tipc_msg *msg;
341 341
342 buf = tipc_buf_acquire(LONG_H_SIZE); 342 buf = tipc_buf_acquire(INT_H_SIZE);
343 if (buf) { 343 if (buf) {
344 msg = buf_msg(buf); 344 msg = buf_msg(buf);
345 tipc_msg_init(msg, usr, type, LONG_H_SIZE, destnode); 345 tipc_msg_init(msg, usr, type, INT_H_SIZE, destnode);
346 msg_set_errcode(msg, err); 346 msg_set_errcode(msg, err);
347 msg_set_destport(msg, destport); 347 msg_set_destport(msg, destport);
348 msg_set_origport(msg, origport); 348 msg_set_origport(msg, origport);
@@ -1247,7 +1247,7 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
1247 msg_set_type(msg, TIPC_NAMED_MSG); 1247 msg_set_type(msg, TIPC_NAMED_MSG);
1248 msg_set_orignode(msg, tipc_own_addr); 1248 msg_set_orignode(msg, tipc_own_addr);
1249 msg_set_origport(msg, ref); 1249 msg_set_origport(msg, ref);
1250 msg_set_hdr_sz(msg, LONG_H_SIZE); 1250 msg_set_hdr_sz(msg, NAMED_H_SIZE);
1251 msg_set_nametype(msg, name->type); 1251 msg_set_nametype(msg, name->type);
1252 msg_set_nameinst(msg, name->instance); 1252 msg_set_nameinst(msg, name->instance);
1253 msg_set_lookup_scope(msg, tipc_addr_scope(domain)); 1253 msg_set_lookup_scope(msg, tipc_addr_scope(domain));
@@ -1300,7 +1300,7 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
1300 msg_set_origport(msg, ref); 1300 msg_set_origport(msg, ref);
1301 msg_set_destnode(msg, dest->node); 1301 msg_set_destnode(msg, dest->node);
1302 msg_set_destport(msg, dest->ref); 1302 msg_set_destport(msg, dest->ref);
1303 msg_set_hdr_sz(msg, DIR_MSG_H_SIZE); 1303 msg_set_hdr_sz(msg, BASIC_H_SIZE);
1304 1304
1305 if (dest->node == tipc_own_addr) 1305 if (dest->node == tipc_own_addr)
1306 res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect, 1306 res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect,
@@ -1340,13 +1340,13 @@ int tipc_send_buf2port(u32 ref, struct tipc_portid const *dest,
1340 msg_set_origport(msg, ref); 1340 msg_set_origport(msg, ref);
1341 msg_set_destnode(msg, dest->node); 1341 msg_set_destnode(msg, dest->node);
1342 msg_set_destport(msg, dest->ref); 1342 msg_set_destport(msg, dest->ref);
1343 msg_set_hdr_sz(msg, DIR_MSG_H_SIZE); 1343 msg_set_hdr_sz(msg, BASIC_H_SIZE);
1344 msg_set_size(msg, DIR_MSG_H_SIZE + dsz); 1344 msg_set_size(msg, BASIC_H_SIZE + dsz);
1345 if (skb_cow(buf, DIR_MSG_H_SIZE)) 1345 if (skb_cow(buf, BASIC_H_SIZE))
1346 return -ENOMEM; 1346 return -ENOMEM;
1347 1347
1348 skb_push(buf, DIR_MSG_H_SIZE); 1348 skb_push(buf, BASIC_H_SIZE);
1349 skb_copy_to_linear_data(buf, msg, DIR_MSG_H_SIZE); 1349 skb_copy_to_linear_data(buf, msg, BASIC_H_SIZE);
1350 1350
1351 if (dest->node == tipc_own_addr) 1351 if (dest->node == tipc_own_addr)
1352 res = tipc_port_recv_msg(buf); 1352 res = tipc_port_recv_msg(buf);