Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31348
b: refs/heads/master
c: e49060c
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jun 30, 2006
1 parent a4a33d4 commit 34a2710
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: caf430f37119af5faac9252ec4e18cb1c55dde26
refs/heads/master: e49060c7cab6ca856d048e1e10d71c0e6fedf376
11 changes: 6 additions & 5 deletions trunk/net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* net/tipc/link.c: TIPC link code
*
* Copyright (c) 1996-2006, Ericsson AB
* Copyright (c) 2004-2005, Wind River Systems
* Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -988,17 +988,18 @@ static int link_bundle_buf(struct link *l_ptr,
struct tipc_msg *bundler_msg = buf_msg(bundler);
struct tipc_msg *msg = buf_msg(buf);
u32 size = msg_size(msg);
u32 to_pos = align(msg_size(bundler_msg));
u32 rest = link_max_pkt(l_ptr) - to_pos;
u32 bundle_size = msg_size(bundler_msg);
u32 to_pos = align(bundle_size);
u32 pad = to_pos - bundle_size;

if (msg_user(bundler_msg) != MSG_BUNDLER)
return 0;
if (msg_type(bundler_msg) != OPEN_MSG)
return 0;
if (rest < align(size))
if (skb_tailroom(bundler) < (pad + size))
return 0;

skb_put(bundler, (to_pos - msg_size(bundler_msg)) + size);
skb_put(bundler, pad + size);
memcpy(bundler->data + to_pos, buf->data, size);
msg_set_size(bundler_msg, to_pos + size);
msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1);
Expand Down

0 comments on commit 34a2710

Please sign in to comment.