Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73253
b: refs/heads/master
c: bf13886
h: refs/heads/master
i:
  73251: d14b013
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 7, 2007
1 parent edae6ba commit 19f4dc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 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: 429f08e950a88cd826b203ea898c2f2d0f7db9de
refs/heads/master: bf138862b162b6eaf3d7336f759f6e6485e481df
36 changes: 15 additions & 21 deletions trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,19 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
return err;
}

static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np)
{
inet->cork.flags &= ~IPCORK_OPT;
kfree(np->cork.opt);
np->cork.opt = NULL;
if (np->cork.rt) {
dst_release(&np->cork.rt->u.dst);
np->cork.rt = NULL;
inet->cork.flags &= ~IPCORK_ALLFRAG;
}
memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
}

int ip6_push_pending_frames(struct sock *sk)
{
struct sk_buff *skb, *tmp_skb;
Expand Down Expand Up @@ -1415,24 +1428,14 @@ int ip6_push_pending_frames(struct sock *sk)
}

out:
inet->cork.flags &= ~IPCORK_OPT;
kfree(np->cork.opt);
np->cork.opt = NULL;
if (np->cork.rt) {
dst_release(&np->cork.rt->u.dst);
np->cork.rt = NULL;
inet->cork.flags &= ~IPCORK_ALLFRAG;
}
memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
ip6_cork_release(inet, np);
return err;
error:
goto out;
}

void ip6_flush_pending_frames(struct sock *sk)
{
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct sk_buff *skb;

while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
Expand All @@ -1442,14 +1445,5 @@ void ip6_flush_pending_frames(struct sock *sk)
kfree_skb(skb);
}

inet->cork.flags &= ~IPCORK_OPT;

kfree(np->cork.opt);
np->cork.opt = NULL;
if (np->cork.rt) {
dst_release(&np->cork.rt->u.dst);
np->cork.rt = NULL;
inet->cork.flags &= ~IPCORK_ALLFRAG;
}
memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
ip6_cork_release(inet_sk(sk), inet6_sk(sk));
}

0 comments on commit 19f4dc9

Please sign in to comment.