mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
Merge branch 'tipc-buffer-reassignment-fixes'
Parthasarathy Bhuvaragan says: ==================== tipc: buffer reassignment fixes This series contains fixes for buffer reassignments and a context imbalance. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
c3d8d60e1e
@ -479,13 +479,14 @@ bool tipc_msg_make_bundle(struct sk_buff **skb, struct tipc_msg *msg,
|
||||
bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, int err)
|
||||
{
|
||||
struct sk_buff *_skb = *skb;
|
||||
struct tipc_msg *hdr = buf_msg(_skb);
|
||||
struct tipc_msg *hdr;
|
||||
struct tipc_msg ohdr;
|
||||
int dlen = min_t(uint, msg_data_sz(hdr), MAX_FORWARD_SIZE);
|
||||
int dlen;
|
||||
|
||||
if (skb_linearize(_skb))
|
||||
goto exit;
|
||||
hdr = buf_msg(_skb);
|
||||
dlen = min_t(uint, msg_data_sz(hdr), MAX_FORWARD_SIZE);
|
||||
if (msg_dest_droppable(hdr))
|
||||
goto exit;
|
||||
if (msg_errcode(hdr))
|
||||
@ -511,6 +512,8 @@ bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, int err)
|
||||
pskb_expand_head(_skb, BUF_HEADROOM, BUF_TAILROOM, GFP_ATOMIC))
|
||||
goto exit;
|
||||
|
||||
/* reassign after skb header modifications */
|
||||
hdr = buf_msg(_skb);
|
||||
/* Now reverse the concerned fields */
|
||||
msg_set_errcode(hdr, err);
|
||||
msg_set_non_seq(hdr, 0);
|
||||
|
@ -1126,8 +1126,8 @@ int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 addr,
|
||||
strncpy(linkname, tipc_link_name(link), len);
|
||||
err = 0;
|
||||
}
|
||||
exit:
|
||||
tipc_node_read_unlock(node);
|
||||
exit:
|
||||
tipc_node_put(node);
|
||||
return err;
|
||||
}
|
||||
@ -1557,6 +1557,8 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
|
||||
|
||||
/* Check/update node state before receiving */
|
||||
if (unlikely(skb)) {
|
||||
if (unlikely(skb_linearize(skb)))
|
||||
goto discard;
|
||||
tipc_node_write_lock(n);
|
||||
if (tipc_node_check_state(n, skb, bearer_id, &xmitq)) {
|
||||
if (le->link) {
|
||||
|
Loading…
Reference in New Issue
Block a user