netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: David Lamparter <equinox@diac24.net>
Cc: netdev@vger.kernel.org,
	Stephen Hemminger <stephen@networkplumber.org>,
	Jiri Pirko <jiri@resnulli.us>
Subject: Re: [RFC alternate] ipv6: addrconf: clean up device type handling
Date: Thu, 31 Jul 2014 11:27:08 +0200	[thread overview]
Message-ID: <1406798828.15894.31.camel@localhost> (raw)
In-Reply-To: <1406735921-122830-1-git-send-email-equinox@diac24.net>

On Mi, 2014-07-30 at 17:58 +0200, David Lamparter wrote:
> This realigns addrconf support for the various lower-layer device types,
> and removes a little bit of duplicate code.
> 
> For GRE devices, this includes a semantic change in that there is now a
> ff00::/8 route installed on address autogeneration.  This was previously
> missing and broke any kind of IPv6 multicast - unless another address
> was configured from userspace (which then added the missing ff00::/8).
> 
> 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>
> Cc: Jiri Pirko <jiri@resnulli.us>
> ---
> 
> This is an alternate version, yanking the switch() down and removing
> dev_config/gre_config duplication.  I have no idea what rationale is behind
> prefix_route - the result is a fe80::/64 route, but no address, which is not a
> functioning configuration.  Jiri, you touched this just a few weeks ago, can
> you comment?  (The "XXX: why is GRE special?")

IIRC some time ago it was decided that randomizing the perm_addr and
generate LL addresses based on that is not the way to go and fragile. We
have this behaviour for ipv6 tunnels, but (IIRC) should not be expanded
and leave user space with this burden.

> -#if IS_ENABLED(CONFIG_NET_IPGRE)
> -static void addrconf_gre_config(struct net_device *dev)
> +static void addrconf_dev_config(struct net_device *dev)
>  {
>  	struct inet6_dev *idev;
> +	bool prefix_route;
>  
>  	ASSERT_RTNL();
>  
> -	if ((idev = ipv6_find_idev(dev)) == NULL) {
> -		pr_debug("%s: add_dev failed\n", __func__);
> +	switch (dev->type) {
> +	case ARPHRD_LOOPBACK:
> +		init_loopback(dev);
> +		return;
> +
> +	case ARPHRD_ETHER:
> +	case ARPHRD_FDDI:
> +	case ARPHRD_ARCNET:
> +	case ARPHRD_INFINIBAND:
> +	case ARPHRD_IEEE802154:
> +	case ARPHRD_IEEE1394:
> +	case ARPHRD_TUNNEL6:
> +	case ARPHRD_6LOWPAN:
> +		prefix_route = false;
> +		break;
> +
> +#if IS_ENABLED(CONFIG_NET_IPGRE)
> +	case ARPHRD_IPGRE:

We can now also add ARPHRD_IP6GRE, maybe in a separate patch.

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Thanks,
Hannes

  parent reply	other threads:[~2014-07-31  9:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  0:55 [PATCH net-next] ipv6: addrconf: fix mcast route for GRE devices David Lamparter
2014-07-30 15:14 ` Hannes Frederic Sowa
2014-07-30 15:35   ` David Lamparter
2014-07-30 15:39     ` [PATCH v2] " David Lamparter
2014-07-31 19:06       ` David Miller
2014-07-31 19:37         ` Hannes Frederic Sowa
2014-07-31 20:19           ` David Lamparter
2014-07-31 20:53             ` [PATCH v3] " David Lamparter
2014-07-31 20:53               ` [PATCH 1/2] " David Lamparter
2014-07-31 22:05                 ` Hannes Frederic Sowa
2014-07-31 20:53               ` [PATCH 2/2] ipv6: addrconf: clean up device type handling David Lamparter
2014-07-31 22:13                 ` Hannes Frederic Sowa
2014-08-01  5:31                   ` David Miller
2014-07-30 15:58     ` [RFC alternate] " David Lamparter
2014-07-30 16:12       ` Hannes Frederic Sowa
2014-07-30 16:23         ` David Lamparter
2014-07-30 16:44           ` Hannes Frederic Sowa
2014-07-31  9:27       ` Hannes Frederic Sowa [this message]
2014-07-30 16:09     ` [PATCH net-next] ipv6: addrconf: fix mcast route for GRE devices Hannes Frederic Sowa
2014-07-30 16:31       ` David Lamparter
2014-07-30 16:52         ` Hannes Frederic Sowa
2014-07-30 17:35           ` David Lamparter
2014-07-30 18:03             ` Hannes Frederic Sowa
2014-07-30 18:20               ` Dan Williams
2014-07-31 19:06             ` David Miller

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=1406798828.15894.31.camel@localhost \
    --to=hannes@stressinduktion.org \
    --cc=equinox@diac24.net \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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).