[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1301389905.3161.3.camel@edumazet-laptop>
Date: Tue, 29 Mar 2011 11:11:45 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Timo Teräs <timo.teras@....fi>
Cc: netdev@...r.kernel.org, Doug Kehn <rdkehn@...oo.com>
Subject: Re: [PATCH] net: gre: provide multicast mappings for ipv4 and ipv6
Le mardi 29 mars 2011 à 11:40 +0300, Timo Teräs a écrit :
> My commit 6d55cb91a0020ac0 (gre: fix hard header destination
> address checking) broke multicast.
>
> The reason is that ip_gre used to get ipgre_header() calls with
> zero destination if we have NOARP or multicast destination. Instead
> the actual target was decided at ipgre_tunnel_xmit() time based on
> per-protocol dissection.
>
> Instead of allowing the "abuse" of ->header() calls with invalid
> destination, this creates multicast mappings for ip_gre. This also
> fixes "ip neigh show nud noarp" to display the proper multicast
> mappings used by the gre device.
>
> Reported-by: Doug Kehn <rdkehn@...oo.com>
> Signed-off-by: Timo Teräs <timo.teras@....fi>
> ---
> Compile tested only. Doug tested IPv4 side with the earlier patch.
> +static inline int ipv6_ipgre_mc_map(const struct in6_addr *addr,
> + const unsigned char *broadcast, char *buf)
> +{
> + if ((broadcast[0] | broadcast[1] | broadcast[2] | broadcast[3]) != 0) {
> + memcpy(buf, broadcast, 4);
> + } else {
> + /* v4mapped? */
> + if ((addr->s6_addr32[0] | addr->s6_addr32[1] |
> + (addr->s6_addr32[2] ^ htonl(0x0000ffff))) != 0)
> + return -EINVAL;
if (ipv6_addr_v4mapped(addr))
> + memcpy(buf, &addr->s6_addr32[3], 4);
> + }
> + return 0;
> +}
--
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