--- net/ipv4/ip_output.c | 12 ++---------- net/ipv4/raw.c | 5 ++++- net/ipv4/udp.c | 2 ++ 3 files changed, 8 insertions(+), 11 deletions(-) Index: linux-2.6/net/ipv4/ip_output.c =================================================================== --- linux-2.6.orig/net/ipv4/ip_output.c 2009-08-24 20:55:49.000000000 +0000 +++ linux-2.6/net/ipv4/ip_output.c 2009-08-25 15:48:32.000000000 +0000 @@ -1300,20 +1300,12 @@ int ip_push_pending_frames(struct sock * /* Netfilter gets whole the not fragmented skb. */ err = ip_local_out(skb); - if (err) { - if (err > 0) - err = inet->recverr ? net_xmit_errno(err) : 0; - if (err) - goto error; - } + if (err && err != NET_XMIT_CN) + IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); out: ip_cork_release(inet); return err; - -error: - IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); - goto out; } /* Index: linux-2.6/net/ipv4/raw.c =================================================================== --- linux-2.6.orig/net/ipv4/raw.c 2009-08-24 20:55:49.000000000 +0000 +++ linux-2.6/net/ipv4/raw.c 2009-08-24 21:37:44.000000000 +0000 @@ -576,8 +576,11 @@ back_from_confirm: &ipc, &rt, msg->msg_flags); if (err) ip_flush_pending_frames(sk); - else if (!(msg->msg_flags & MSG_MORE)) + else if (!(msg->msg_flags & MSG_MORE)) { err = ip_push_pending_frames(sk); + if (err > 0) + err = inet->recverr ? net_xmit_errno(err) : 0; + } release_sock(sk); } done: Index: linux-2.6/net/ipv4/udp.c =================================================================== --- linux-2.6.orig/net/ipv4/udp.c 2009-08-24 20:55:49.000000000 +0000 +++ linux-2.6/net/ipv4/udp.c 2009-08-24 21:37:44.000000000 +0000 @@ -559,6 +559,8 @@ static int udp_push_pending_frames(struc send: err = ip_push_pending_frames(sk); + if (err > 0) + err = inet->recverr ? net_xmit_errno(err) : 0; out: up->len = 0; up->pending = 0;