From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Jaco Kroon <jaco@uls.co.za>,
Netfilter Developer Mailing List
<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 1/2] [NETFILTER]: xt_TCPMSS: Consider incoming device's MTU in clamp-to-pmtu
Date: Wed, 23 Jan 2008 15:20:42 +0100 [thread overview]
Message-ID: <47974D3A.1020705@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0801222204290.9183@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> +static u_int16_t tcpmss_reverse_mtu4(const struct iphdr *iph)
> +{
> + struct rtable *rt = NULL;
> + struct flowi fl = {.nl_u = {.ip4_u = {
> + .daddr = iph->saddr,
> + .tos = RT_TOS(iph->tos),
> + .scope = RT_SCOPE_UNIVERSE,
> + }}};
> +
> + ip_route_output_key(&rt, &fl);
> + if (rt == NULL)
> + return ~(u_int16_t)0;
> + return dst_mtu(&rt->u.dst);
This leaks the dst_entry.
> #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
> +static u_int16_t tcpmss_reverse_mtu6(const struct ipv6hdr *iph)
> +{
> + struct rtable *rt = NULL;
> + struct flowi fl = {.nl_u = {.ip6_u = {
> + .daddr = iph->saddr,
> + .flowlabel = ((iph->flow_lbl[0] << 16) |
> + (iph->flow_lbl[1] << 8) | iph->flow_lbl[2]) &
> + 0x00FFFFFF,
> + }}};
> +
> + ip_route_output_key(&rt, &fl);
> + if (rt == NULL)
> + return ~(u_int16_t)0;
> + return dst_mtu(&rt->u.dst);
This also leaks and you probably want to do IPv6 routing :) But the
patch should use the ->route function from nf_af_info anyways
to avoid adding module dependencies.
prev parent reply other threads:[~2008-01-23 14:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-20 12:18 [PATCH 1/2] [NETFILTER]: xt_TCPMSS: Consider incoming device's MTU in clamp-to-pmtu Jan Engelhardt
2008-01-20 12:19 ` [PATCH 2/2] [NETFILTER]: xt_owner: allow matching UID/GID ranges Jan Engelhardt
2008-01-20 13:50 ` Patrick McHardy
2008-01-20 18:03 ` Jan Engelhardt
2008-01-24 7:57 ` Patrick McHardy
2008-01-20 13:48 ` [PATCH 1/2] [NETFILTER]: xt_TCPMSS: Consider incoming device's MTU in clamp-to-pmtu Patrick McHardy
2008-01-22 21:10 ` Jan Engelhardt
2008-01-23 14:20 ` Patrick McHardy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47974D3A.1020705@trash.net \
--to=kaber@trash.net \
--cc=jaco@uls.co.za \
--cc=jengelh@computergmbh.de \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.