diff mbox

[v2] ipv6: addrconf: fix mcast route for GRE devices

Message ID 1406734797-122248-1-git-send-email-equinox@diac24.net
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

David Lamparter July 30, 2014, 3:39 p.m. UTC
GRE devices, for some reason, were coming up with an autoconfigured
address, but no ff00::/8 route in the local table.  This breaks any kind
of multicast, in particular OSPFv3, mDNS, - and ND.  In fact, IPv6 only
works at all because there is little need for ND on PtP devices.

Adding any other IPv6 address on the device from userspace would rectify
this issue through inet6_addr_add()/addrconf_add_dev() - and would leave
the route around even if the address was later removed.  (This is
probably why this issue was not discovered earlier.  AFAICS it has been
there from the beginning, e.g. aee80b5 "generate link local address for
GRE tunnel")

(Note: multicast is supported on GRE devices of all kinds, including PtP
GRE, P-t-Mcast GRE and NBMA-GRE.)

Fixes: aee80b54b235 (ipv6: generate link local address for GRE tunnel)
Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>
---
 net/ipv6/addrconf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

David Miller July 31, 2014, 7:06 p.m. UTC | #1
From: David Lamparter <equinox@diac24.net>
Date: Wed, 30 Jul 2014 17:39:57 +0200

> GRE devices, for some reason, were coming up with an autoconfigured
> address, but no ff00::/8 route in the local table.  This breaks any kind
> of multicast, in particular OSPFv3, mDNS, - and ND.  In fact, IPv6 only
> works at all because there is little need for ND on PtP devices.
> 
> Adding any other IPv6 address on the device from userspace would rectify
> this issue through inet6_addr_add()/addrconf_add_dev() - and would leave
> the route around even if the address was later removed.  (This is
> probably why this issue was not discovered earlier.  AFAICS it has been
> there from the beginning, e.g. aee80b5 "generate link local address for
> GRE tunnel")
> 
> (Note: multicast is supported on GRE devices of all kinds, including PtP
> GRE, P-t-Mcast GRE and NBMA-GRE.)
> 
> Fixes: aee80b54b235 (ipv6: generate link local address for GRE tunnel)
> Signed-off-by: David Lamparter <equinox@diac24.net>
> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Cc: Stephen Hemminger <stephen@networkplumber.org>

Hannes, are you OK with this version?  Please ACK if so.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa July 31, 2014, 7:37 p.m. UTC | #2
On Do, 2014-07-31 at 12:06 -0700, David Miller wrote:
> From: David Lamparter <equinox@diac24.net>
> Date: Wed, 30 Jul 2014 17:39:57 +0200
> 
> > GRE devices, for some reason, were coming up with an autoconfigured
> > address, but no ff00::/8 route in the local table.  This breaks any kind
> > of multicast, in particular OSPFv3, mDNS, - and ND.  In fact, IPv6 only
> > works at all because there is little need for ND on PtP devices.
> > 
> > Adding any other IPv6 address on the device from userspace would rectify
> > this issue through inet6_addr_add()/addrconf_add_dev() - and would leave
> > the route around even if the address was later removed.  (This is
> > probably why this issue was not discovered earlier.  AFAICS it has been
> > there from the beginning, e.g. aee80b5 "generate link local address for
> > GRE tunnel")
> > 
> > (Note: multicast is supported on GRE devices of all kinds, including PtP
> > GRE, P-t-Mcast GRE and NBMA-GRE.)
> > 
> > Fixes: aee80b54b235 (ipv6: generate link local address for GRE tunnel)
> > Signed-off-by: David Lamparter <equinox@diac24.net>
> > Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > Cc: Stephen Hemminger <stephen@networkplumber.org>
> 
> Hannes, are you OK with this version?  Please ACK if so.

The alternate version does provide the same semantic change and makes
the code more readable. Both changes are technically correct, I acked
the alternate version already.

Thank you,
Hannes



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Lamparter July 31, 2014, 8:19 p.m. UTC | #3
On Thu, Jul 31, 2014 at 09:37:34PM +0200, Hannes Frederic Sowa wrote:
> On Do, 2014-07-31 at 12:06 -0700, David Miller wrote:
> > From: David Lamparter <equinox@diac24.net>
> > Date: Wed, 30 Jul 2014 17:39:57 +0200
> > 
> > > GRE devices, for some reason, were coming up with an autoconfigured
> > > address, but no ff00::/8 route in the local table.  This breaks any kind
> > > of multicast, in particular OSPFv3, mDNS, - and ND.  In fact, IPv6 only
> > > works at all because there is little need for ND on PtP devices.
> > > 
> > > Adding any other IPv6 address on the device from userspace would rectify
> > > this issue through inet6_addr_add()/addrconf_add_dev() - and would leave
> > > the route around even if the address was later removed.  (This is
> > > probably why this issue was not discovered earlier.  AFAICS it has been
> > > there from the beginning, e.g. aee80b5 "generate link local address for
> > > GRE tunnel")
> > > 
> > > (Note: multicast is supported on GRE devices of all kinds, including PtP
> > > GRE, P-t-Mcast GRE and NBMA-GRE.)
> > > 
> > > Fixes: aee80b54b235 (ipv6: generate link local address for GRE tunnel)
> > > Signed-off-by: David Lamparter <equinox@diac24.net>
> > > Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > > Cc: Stephen Hemminger <stephen@networkplumber.org>
> > 
> > Hannes, are you OK with this version?  Please ACK if so.
> 
> The alternate version does provide the same semantic change and makes
> the code more readable. Both changes are technically correct, I acked
> the alternate version already.

Give me a few min, I'll go base the other one on this one, that way
there's one 2-line patch changing semantics (this one) and another
50-line patch just mechanically moving stuff around.

-David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Lamparter July 31, 2014, 8:53 p.m. UTC | #4
This series replaces the previous patches in this thread, reposting them as
- patch 1/2: "ipv6: addrconf: fix mcast route for GRE devices"
which contains the semantic changes for the ff00::/8 route on GRE, and
- patch 2/2:  ipv6: addrconf: clean up device type handling"
which just moves things to make them prettier, and documents the "speshul"
fe80::/64 behaviour (which Nicolas Dichtel added in 08b4465 to make a specific
user case work.)

Tested by poking various devices with a bunch of link ups and downs.

Hannes, can you Ack?

-David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0b239fc..7540a25 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2818,10 +2818,9 @@  static void addrconf_gre_config(struct net_device *dev)
 
 	ASSERT_RTNL();
 
-	if ((idev = ipv6_find_idev(dev)) == NULL) {
-		pr_debug("%s: add_dev failed\n", __func__);
+	idev = addrconf_add_dev(dev);
+	if (IS_ERR(idev))
 		return;
-	}
 
 	addrconf_addr_gen(idev, true);
 }