All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: arp_notify address list bug
Date: Tue, 6 Oct 2009 08:29:13 -0700	[thread overview]
Message-ID: <20091006082913.54883824@nehalam> (raw)
In-Reply-To: <4ACAD393.5080909@gmail.com>

On Tue, 06 Oct 2009 07:20:19 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> 
> This fixes a bug with arp_notify.
> 
> If arp_notify is enabled, kernel will crash if address is changed
> and no IP address is assigned.
>   http://bugzilla.kernel.org/show_bug.cgi?id=14330
> 
> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
>  net/ipv4/devinet.c |   16 ++++++++++------
>  1 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index e92f1fd..5df2f6a 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1077,12 +1077,16 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
>  		ip_mc_up(in_dev);
>  		/* fall through */
>  	case NETDEV_CHANGEADDR:
> -		if (IN_DEV_ARP_NOTIFY(in_dev))
> -			arp_send(ARPOP_REQUEST, ETH_P_ARP,
> -				 in_dev->ifa_list->ifa_address,
> -				 dev,
> -				 in_dev->ifa_list->ifa_address,
> -				 NULL, dev->dev_addr, NULL);
> +		/* Send gratuitous ARP to notify of link change */
> +		if (IN_DEV_ARP_NOTIFY(in_dev)) {
> +			struct in_ifaddr *ifa = in_dev->ifa_list;
> +
> +			if (ifa)
> +				arp_send(ARPOP_REQUEST, ETH_P_ARP,
> +					 ifa->ifa_address, dev,
> +					 ifa->ifa_address, NULL,
> +					 dev->dev_addr, NULL);
> +		}
>  		break;
>  	case NETDEV_DOWN:
>  		ip_mc_down(in_dev);

Okay, but I can't see that sending out one per address is going to be a big
storm. Can't imagine user with 100's of addresses on same interface, but I guess
it is possible.

-- 

  reply	other threads:[~2009-10-06 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06  2:15 [PATCH] ipv4: arp_notify address list bug Stephen Hemminger
2009-10-06  3:13 ` Eric Dumazet
2009-10-06  4:31   ` David Miller
2009-10-06  5:20     ` Eric Dumazet
2009-10-06 15:29       ` Stephen Hemminger [this message]
2009-10-06 15:43         ` Eric Dumazet
2009-10-06 21:19           ` Mark Smith
2009-10-07 10:18       ` 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=20091006082913.54883824@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.