netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: release skbuf when nlmsg put fail
@ 2014-10-13  6:50 Houcheng Lin
  2014-10-13 11:42 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Houcheng Lin @ 2014-10-13  6:50 UTC (permalink / raw)
  To: pablo, kaber, kadlec, davem, netfilter-devel
  Cc: coreteam, netdev, Linux Kernel Mailing List

When system is under heavy loading, the __nfulnl_send() may may failed
to put nlmsg into skbuf of nfulnl_instance. If not clear the skbuff on failed,
the __nfulnl_send() will still try to put next nlmsg onto this half-full skbuf
and cause the user program can never receive packet.

This patch fix this issue by releasing skbuf immediately after nlmst put
failed.

Signed-off-by: Houcheng Lin <houcheng@gmail.com>

---
 net/netfilter/nfnetlink_log.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index a11c5ff..0cb9ede 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -358,10 +358,9 @@ __nfulnl_send(struct nfulnl_instance *inst)
     }
     status = nfnetlink_unicast(inst->skb, inst->net, inst->peer_portid,
                    MSG_DONTWAIT);
-
+out:
     inst->qlen = 0;
     inst->skb = NULL;
-out:
     return status;
 }

-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-14  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13  6:50 [PATCH] netfilter: release skbuf when nlmsg put fail Houcheng Lin
2014-10-13 11:42 ` Florian Westphal
2014-10-14  9:39   ` Houcheng Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).