netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: jamal <hadi@cyberus.ca>
Cc: jt@hpl.hp.com, netdev@oss.sgi.com
Subject: Re: [PATCH 2.6 NET] Device name changing via rtnetlink
Date: Sat, 11 Sep 2004 01:17:26 +0200	[thread overview]
Message-ID: <20040910231726.GP20088@postel.suug.ch> (raw)
In-Reply-To: <1094857082.1041.19.camel@jzny.localdomain>

* jamal <1094857082.1041.19.camel@jzny.localdomain> 2004-09-10 18:58
> On Fri, 2004-09-10 at 16:43, Thomas Graf wrote:
> > Currently call_netdevice_notifiers is called and sends out a
> > RTM_NEWLINK message with the new interface name to everyone
> > wanting to be notified. However, ifi_change is kept to 0
> > so far, which means you have to look what has changed yourself. I'm
> > not sure if this can be changed without too much troubles but
> > I will look into it.
> 
> I missed the RTM_NEWLINK part. It is easier to just keep it that way and
> make sure it is well documented as so. It may not be trivial (as an
> example all the inetdev name attributes change - look at inetdev_event).
> So suggestion is to leave it to user space to find more details about
> the event.

I agree, most applications will hold a cache of all links, like iproute2
is doing, and just update the cache.

There is one remaining problem, currently, changes via rtnetlink will
result in multiple notifies being sent out because NETDEV_CHANGEMTU
and NETDEV_CHANGENAME are invoked as well and result in a netlink
message. Changing them to not do anything in rtnetlink context
would solve it but we would lose the notify if the change was made
via ioctl.

The patch below would fixes the multiple notifies issue but prevents
notification upon ioctl via rtnetlink.. Any ideas how to work around
this other than not using dev_change_name and dev_set_mtu?

--- linux-2.6.9-rc1-bk15.orig/net/core/rtnetlink.c	2004-09-08 18:33:42.000000000 +0200
+++ linux-2.6.9-rc1-bk15/net/core/rtnetlink.c	2004-09-11 01:06:29.000000000 +0200
@@ -607,6 +626,8 @@
 		break;
 	case NETDEV_CHANGE:
 	case NETDEV_GOING_DOWN:
+	case NETDEV_CHANGEMTU:
+	case NETDEV_CHANGENAME:
 		break;
 	default:
 		rtmsg_ifinfo(RTM_NEWLINK, dev, 0);

  reply	other threads:[~2004-09-10 23:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10 19:50 [PATCH 2.6 NET] Device name changing via rtnetlink Jean Tourrilhes
2004-09-10 20:06 ` Thomas Graf
2004-09-10 20:13   ` Jean Tourrilhes
2004-09-10 20:22     ` Thomas Graf
2004-09-10 20:31       ` jamal
2004-09-10 20:32       ` Jean Tourrilhes
2004-09-10 20:43         ` Thomas Graf
2004-09-10 22:58           ` jamal
2004-09-10 23:17             ` Thomas Graf [this message]
2004-09-11  2:01               ` jamal
2004-09-11 13:44                 ` Thomas Graf
2004-09-11 19:59                   ` jamal
2004-09-11 22:06                     ` Thomas Graf
2004-09-12 17:27                       ` jamal
2004-09-13  0:20                         ` David S. Miller
2004-09-10 23:04           ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2004-09-10 13:36 Thomas Graf
2004-09-10 14:00 ` YOSHIFUJI Hideaki / 吉藤英明
2004-09-10 14:28   ` Thomas Graf
2004-09-10 14:31     ` YOSHIFUJI Hideaki / 吉藤英明

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=20040910231726.GP20088@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=hadi@cyberus.ca \
    --cc=jt@hpl.hp.com \
    --cc=netdev@oss.sgi.com \
    /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).