diff options
author | Patrick McHardy <kaber@trash.net> | 2005-08-18 20:59:37 +0200 |
---|---|---|
committer | Chris Wright <chrisw@osdl.org> | 2005-08-29 09:55:12 -0700 |
commit | 3ad543d4783e47b413300715d790b5ad652567ff (patch) | |
tree | ef3324c48f625e227412713658969b5ae7055fbf /net | |
parent | 6e5ca4f13185dea47ef4c151d32e9e387e7bb47b (diff) | |
download | linux-stable-3ad543d4783e47b413300715d790b5ad652567ff.tar.gz linux-stable-3ad543d4783e47b413300715d790b5ad652567ff.tar.bz2 linux-stable-3ad543d4783e47b413300715d790b5ad652567ff.zip |
[PATCH] Fix DST leak in icmp_push_reply()
Based upon a bug report and initial patch by
Ollie Wild.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/icmp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index cb759484979d..62bded75f773 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, { struct sk_buff *skb; - ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, - icmp_param->data_len+icmp_param->head_len, - icmp_param->head_len, - ipc, rt, MSG_DONTWAIT); - - if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { + if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, + icmp_param->data_len+icmp_param->head_len, + icmp_param->head_len, + ipc, rt, MSG_DONTWAIT) < 0) + ip_flush_pending_frames(icmp_socket->sk); + else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { struct icmphdr *icmph = skb->h.icmph; unsigned int csum = 0; struct sk_buff *skb1; |