Skip to content

Commit 948fa2d

Browse files
Erik Hugnedavem330
authored andcommitted
tipc: increase size of tipc discovery messages
The payload area following the TIPC discovery message header is an opaque area defined by the media. INT_H_SIZE was enough for Ethernet/IB/IPv4 but needs to be expanded to carry IPv6 addressing information. Signed-off-by: Erik Hugne <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 33f8b9e commit 948fa2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

net/tipc/discover.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type,
8686

8787
msg = buf_msg(buf);
8888
tipc_msg_init(tn->own_addr, msg, LINK_CONFIG, type,
89-
INT_H_SIZE, dest_domain);
89+
MAX_H_SIZE, dest_domain);
9090
msg_set_non_seq(msg, 1);
9191
msg_set_node_sig(msg, tn->random);
9292
msg_set_dest_domain(msg, dest_domain);
@@ -249,7 +249,7 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *buf,
249249

250250
/* Send response, if necessary */
251251
if (respond && (mtyp == DSC_REQ_MSG)) {
252-
rbuf = tipc_buf_acquire(INT_H_SIZE);
252+
rbuf = tipc_buf_acquire(MAX_H_SIZE);
253253
if (rbuf) {
254254
tipc_disc_init_msg(net, rbuf, DSC_RESP_MSG, bearer);
255255
tipc_bearer_send(net, bearer->identity, rbuf, &maddr);
@@ -359,8 +359,7 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr,
359359
req = kmalloc(sizeof(*req), GFP_ATOMIC);
360360
if (!req)
361361
return -ENOMEM;
362-
363-
req->buf = tipc_buf_acquire(INT_H_SIZE);
362+
req->buf = tipc_buf_acquire(MAX_H_SIZE);
364363
if (!req->buf) {
365364
kfree(req);
366365
return -ENOMEM;

0 commit comments

Comments
 (0)