Patchwork netfilter: xt_TCPMSS: correct return value in tcpmss_mangle_packet

login
register
mail settings
Submitter Phil Oester
Date Sept. 1, 2013, 3:32 p.m.
Message ID <20130901153221.GB10125@linuxace.com>
Download mbox | patch
Permalink /patch/271595/
State Accepted
Headers show

Comments

Phil Oester - Sept. 1, 2013, 3:32 p.m.
In commit b396966c4 (netfilter: xt_TCPMSS: Fix missing fragmentation handling),
I attempted to add safe fragment handling to xt_TCPMSS.  However, Andy Padavan
of Project N56U correctly points out that returning XT_CONTINUE in this
function does not work.  The callers (tcpmss_tg[46]) expect to receive a value
of 0 in order to return XT_CONTINUE.

Signed-off-by: Phil Oester <kernel@linuxace.com>
Pablo Neira - Sept. 4, 2013, 12:57 p.m.
On Sun, Sep 01, 2013 at 08:32:21AM -0700, Phil Oester wrote:
> In commit b396966c4 (netfilter: xt_TCPMSS: Fix missing fragmentation handling),
> I attempted to add safe fragment handling to xt_TCPMSS.  However, Andy Padavan
> of Project N56U correctly points out that returning XT_CONTINUE in this
> function does not work.  The callers (tcpmss_tg[46]) expect to receive a value
> of 0 in order to return XT_CONTINUE.

Applied, thanks Phil.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 6113cc7..cd24290 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -60,7 +60,7 @@  tcpmss_mangle_packet(struct sk_buff *skb,
 
 	/* This is a fragment, no TCP header is available */
 	if (par->fragoff != 0)
-		return XT_CONTINUE;
+		return 0;
 
 	if (!skb_make_writable(skb, skb->len))
 		return -1;