Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322734
b: refs/heads/master
c: 4c3a5bd
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Sep 3, 2012
1 parent 9f60a34 commit 4d8eb9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 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: e812347ccf9e8ce073b0ba0c49d03b124707b2b4
refs/heads/master: 4c3a5bdae293f75cdf729c6c00124e8489af2276
21 changes: 20 additions & 1 deletion trunk/net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,25 @@ sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *packet,
return retval;
}

static void sctp_packet_release_owner(struct sk_buff *skb)
{
sk_free(skb->sk);
}

static void sctp_packet_set_owner_w(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sctp_packet_release_owner;

/*
* The data chunks have already been accounted for in sctp_sendmsg(),
* therefore only reserve a single byte to keep socket around until
* the packet has been transmitted.
*/
atomic_inc(&sk->sk_wmem_alloc);
}

/* All packets are sent to the network through this function from
* sctp_outq_tail().
*
Expand Down Expand Up @@ -405,7 +424,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
/* Set the owning socket so that we know where to get the
* destination IP address.
*/
skb_set_owner_w(nskb, sk);
sctp_packet_set_owner_w(nskb, sk);

if (!sctp_transport_dst_check(tp)) {
sctp_transport_route(tp, NULL, sctp_sk(sk));
Expand Down

0 comments on commit 4d8eb9b

Please sign in to comment.