From: catab@embedromix.ro
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org,
yoshfuji@linux-ipv6.org, davem@davemloft.net
Subject: Re: [PATCH] Do not drop DNATed 6to4/6rd packets
Date: Mon, 23 Sep 2013 21:36:33 +0300 (EEST) [thread overview]
Message-ID: <alpine.LFD.2.03.1309232135570.6779@mail.embedromix.ro> (raw)
In-Reply-To: <1379869266.2086.13.camel@joe-AO722>
On Sun, 22 Sep 2013, Joe Perches wrote:
> On Sun, 2013-09-22 at 13:58 +0300, Catalin(ux) M. BOIE wrote:
>> From: "Catalin(ux) M. BOIE" <catab@embedromix.ro>
>>
>> When a router is doing DNAT for 6to4/6rd packets the latest anti-spoofing
>> patch (218774dc) will drop them because the IPv6 address embedded
>> does not match the IPv4 destination. This patch will allow them to
>> pass by testing if we have an address that matches on 6to4/6rd interface.
>> I have been hit by this problem using Fedora and IPV6TO4_IPV4ADDR.
>> Also, log the dropped packets (with rate limit).
>
> Thanks. trivial nits which maybe fixed later:
>
>> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> []
>> +/* Returns true if a packet is spoofed
>> + */
>
> probably nicer as single line /* Returns true ... */
>
>> +static bool packet_is_spoofed(struct sk_buff *skb,
>> + const struct iphdr *iph,
>> + struct ip_tunnel *tunnel)
>> +{
>> + const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
>> +
>> + if (tunnel->dev->priv_flags & IFF_ISATAP) {
>> + if (!isatap_chksrc(skb, iph, tunnel))
>> + return true;
>> +
>> + return false;
>> + }
>> +
>> + if ((tunnel->dev->flags&IFF_POINTOPOINT))
>
> It'd be nicer with spaces around the &
>
>> + return false;
>
> It'd be slightly faster code moving the ipv6_hdr(skb)
> assignment below these tests.
Sorry, v3 was missing the changes suggested.
v4 fill fix it.
Sorry.
--
Catalin(ux) M. BOIE
http://kernel.embedromix.ro/
next prev parent reply other threads:[~2013-09-23 18:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-14 10:30 [PATCH] Do not drop DNATed 6to4/6rd packets Catalin(ux) M. BOIE
2013-09-15 13:14 ` Hannes Frederic Sowa
2013-09-22 10:58 ` Catalin(ux) M. BOIE
2013-09-22 17:01 ` Joe Perches
2013-09-23 18:31 ` catab
2013-09-23 18:33 ` [PATCH] Do not drop DNATed 6to4/6rd packets (v3) Catalin(ux) M. BOIE
2013-09-23 18:36 ` catab [this message]
2013-09-23 18:36 ` [PATCH] Do not drop DNATed 6to4/6rd packets (v4) Catalin(ux) M. BOIE
2013-09-23 19:11 ` Joe Perches
2013-09-23 20:04 ` [PATCH v5] IPv6 NAT: Do not drop DNATed 6to4/6rd packets Catalin(ux) M. BOIE
2013-09-24 21:36 ` Hannes Frederic Sowa
2013-09-28 19:57 ` David Miller
2013-09-29 0:24 ` Joe Perches
2013-09-30 3:05 ` catab
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=alpine.LFD.2.03.1309232135570.6779@mail.embedromix.ro \
--to=catab@embedromix.ro \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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 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).