iptables: iptables-compat translation for TCPMSS
PATCH 1/1 iptables: iptables-compat translation for TCPMSS
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.
--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
extensions/libxt_TCPMSS.c +12 -0
@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params) +{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data; +if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU ) +xt_xlate_add (xl,"tcp option maxseg size set rt mtu" ); + +return 1 ; +} +static struct xtables_target tcpmss_tg_reg[] = { { .family =NFPROTO_IPV4 ,
@@ -104,6 +115,7 @@ static struct xtables_target tcpmss_tg_reg[] = { .x6_parse = TCPMSS_parse, .x6_fcheck = TCPMSS_check, .x6_options = TCPMSS4_opts, + .xlate = TCPMSS_xlate, }, { .family = NFPROTO_IPV6,
Signature · 1 line
2.7.4
Quoted 13 lines · Aastha Gupta
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.Signed-off-by Aastha Gupta <[email protected]>--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)extensions/libxt_TCPMSS.c +0
-0
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 95
Quoted 5 lines
extensions/libxt_TCPMSS.c +2
-0@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params)
The argument list seems to be quite oddly formatted. Line the second line up with the right side of the (
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 98
Quoted 3 lines
extensions/libxt_TCPMSS.c +3
-0+{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data;
Is the cast really necessary? It should not be necessary if the data field has type void *.
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 99
Quoted 1 line
extensions/libxt_TCPMSS.c +1
-0+if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU )
Kernel code requires a space after if
extensions/libxt_TCPMSS.c static struct xtables_target tcpmss_tg_reg[] = { · line 118
Quoted 13 lines
extensions/libxt_TCPMSS.c +6
-0+xt_xlate_add (xl,"tcp option maxseg size set rt mtu" ); + +return 1 ; +} +static struct xtables_target tcpmss_tg_reg[] = { { .family =NFPROTO_IPV4 ,@@ -104,6 +115,7 @@ static struct xtables_target tcpmss_tg_reg[] = { .x6_parse = TCPMSS_parse, .x6_fcheck = TCPMSS_check, .x6_options = TCPMSS4_opts, + .xlate = TCPMSS_xlate,
Follow the same alignment strategy as for the other fields.
julia
Quoted 13 lines
extensions/libxt_TCPMSS.c +0
-1}, { .family = NFPROTO_IPV6, --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1508067107-13649-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 26 lines · Julia Lawall
Quoted 13 lines · Aastha Gupta
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.Signed-off-by Aastha Gupta <[email protected]>--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)extensions/libxt_TCPMSS.c +0
-0extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 95
Quoted 5 lines
extensions/libxt_TCPMSS.c +2
-0@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params)The argument list seems to be quite oddly formatted. Line the second line up with the right side of the (
Quoted 6 lines
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 98
Quoted 3 lines
extensions/libxt_TCPMSS.c +3
-0+{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data;Is the cast really necessary? It should not be necessary if the data field has type void *.
Data field is not type void but unsigned char.
Quoted 36 lines
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 99
Quoted 2 lines
extensions/libxt_TCPMSS.c +1
-0+if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU )Kernel code requires a space after if
extensions/libxt_TCPMSS.c static struct xtables_target tcpmss_tg_reg[] = { · line 118
Quoted 13 lines
extensions/libxt_TCPMSS.c +6
-0+xt_xlate_add (xl,"tcp option maxseg size set rt mtu" ); + +return 1 ; +} +static struct xtables_target tcpmss_tg_reg[] = { { .family =NFPROTO_IPV4 ,@@ -104,6 +115,7 @@ static struct xtables_target tcpmss_tg_reg[] = { .x6_parse = TCPMSS_parse, .x6_fcheck = TCPMSS_check, .x6_options = TCPMSS4_opts, + .xlate = TCPMSS_xlate,Follow the same alignment strategy as for the other fields.
julia
Quoted 13 lines
extensions/libxt_TCPMSS.c +0
-1}, { .family = NFPROTO_IPV6, --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1508067107-13649-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 53 lines · Julia Lawall
Quoted 13 lines · Aastha Gupta
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.Signed-off-by Aastha Gupta <[email protected]>--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)extensions/libxt_TCPMSS.c +0
-0extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 95
Quoted 5 lines
extensions/libxt_TCPMSS.c +2
-0@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params)The argument list seems to be quite oddly formatted. Line the second line up with the right side of the (
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 98
Quoted 3 lines
extensions/libxt_TCPMSS.c +3
-0+{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data;Is the cast really necessary? It should not be necessary if the data field has type void *.
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 99
Quoted 1 line
extensions/libxt_TCPMSS.c +1
-0+if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU )Kernel code requires a space after if
extensions/libxt_TCPMSS.c static struct xtables_target tcpmss_tg_reg[] = { · line 118
Quoted 13 lines
extensions/libxt_TCPMSS.c +6
-0+xt_xlate_add (xl,"tcp option maxseg size set rt mtu" ); + +return 1 ; +} +static struct xtables_target tcpmss_tg_reg[] = { { .family =NFPROTO_IPV4 ,@@ -104,6 +115,7 @@ static struct xtables_target tcpmss_tg_reg[] = { .x6_parse = TCPMSS_parse, .x6_fcheck = TCPMSS_check, .x6_options = TCPMSS4_opts, + .xlate = TCPMSS_xlate,Follow the same alignment strategy as for the other fields.
Quoted 1 line
julia
I don't know why the alignment gets like this when I send it.
Quoted 14 lines
Quoted 14 lines
extensions/libxt_TCPMSS.c +0
-1}, { .family = NFPROTO_IPV6, --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1508067107-13649-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 54 lines · Aastha Gupta
Quoted 53 lines · Julia Lawall
Quoted 13 lines · Aastha Gupta
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.Signed-off-by Aastha Gupta <[email protected]>--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)extensions/libxt_TCPMSS.c +0
-0extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 95
Quoted 5 lines
extensions/libxt_TCPMSS.c +2
-0@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params)The argument list seems to be quite oddly formatted. Line the second line up with the right side of the (
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 98
Quoted 3 lines
extensions/libxt_TCPMSS.c +3
-0+{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data;Is the cast really necessary? It should not be necessary if the data field has type void *.
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 99
Quoted 1 line
extensions/libxt_TCPMSS.c +1
-0+if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU )Kernel code requires a space after if
extensions/libxt_TCPMSS.c static struct xtables_target tcpmss_tg_reg[] = { · line 118
Quoted 13 lines
extensions/libxt_TCPMSS.c +6
-0+xt_xlate_add (xl,"tcp option maxseg size set rt mtu" ); + +return 1 ; +} +static struct xtables_target tcpmss_tg_reg[] = { { .family =NFPROTO_IPV4 ,@@ -104,6 +115,7 @@ static struct xtables_target tcpmss_tg_reg[] = { .x6_parse = TCPMSS_parse, .x6_fcheck = TCPMSS_check, .x6_options = TCPMSS4_opts, + .xlate = TCPMSS_xlate,Follow the same alignment strategy as for the other fields.
Quoted 3 lines
Quoted 1 line
julia
I don't know why the alignment gets like this when I send it.
OK, maybe it is related to tabs. If the code looks ok when you apply the patch, then that's fine.
julia
Quoted 15 lines
Quoted 14 lines
Quoted 14 lines
extensions/libxt_TCPMSS.c +0
-1}, { .family = NFPROTO_IPV6, --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1508067107-13649-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 13 lines · Aastha Gupta
Since path mtu support was added, we can now add
iptables-compat translation for TCPMSS extension.Signed-off-by Aastha Gupta <[email protected]>--- extensions/libxt_TCPMSS.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)extensions/libxt_TCPMSS.c +0
-0
extensions/libxt_TCPMSS.c static void TCPMSS_save(const void *ip, const struct xt_entry_target *target) · line 100
Quoted 10 lines
extensions/libxt_TCPMSS.c +7
-0@@ -91,6 +91,17 @@ static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)printf (" --set-mss %u" , mssinfo->mss); } +static int TCPMSS_xlate (struct xt_xlate *xl, +const struct xt_xlate_tg_params *params) +{ +const struct xt_tcpmss_info *mssinfo = + (const struct xt_tcpmss_info *)params->target->data; +if (mssinfo->mss ==XT_TCPMSS_CLAMP_PMTU ) +xt_xlate_add (xl,"tcp option maxseg size set rt mtu" );
Could you also translate other options in man iptables-extensions, under the TCPMSS target extension?
BTW, please Cc [email protected] in your netfilter patches.
Thanks!