[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1379869266.2086.13.camel@joe-AO722>
Date: Sun, 22 Sep 2013 10:01:06 -0700
From: Joe Perches <joe@...ches.com>
To: "Catalin(ux) M. BOIE" <catab@...edromix.ro>
Cc: netdev@...r.kernel.org, hannes@...essinduktion.org,
yoshfuji@...ux-ipv6.org, davem@...emloft.net
Subject: Re: [PATCH] Do not drop DNATed 6to4/6rd packets
On Sun, 2013-09-22 at 13:58 +0300, Catalin(ux) M. BOIE wrote:
> From: "Catalin(ux) M. BOIE" <catab@...edromix.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists