On Mon, Jul 04, 2011 at 09:38:24AM +0100, Stuart Henderson wrote:
> ospfd doesn't pick up an lo(4) added while it's running unless you
> manually ifconfig down+up.
>
> this does the same dance as if_gif.c to ensure RTM_IFINFO gets sent.
>
> ok?
OK claudio@
I'm wondering if we have other drivers that have the same issue with the
auto up on SIOCSIFADDR and if it should be handled in a driver independent
way.
>
> Index: if_loop.c
> ===================================================================
> RCS file: /cvs/src/sys/net/if_loop.c,v
> retrieving revision 1.44
> diff -u -p -r1.44 if_loop.c
> --- if_loop.c 7 May 2008 12:58:54 -0000 1.44
> +++ if_loop.c 4 Jul 2011 08:36:50 -0000
> @@ -423,12 +423,16 @@ loioctl(ifp, cmd, data)
> {
> struct ifaddr *ifa;
> struct ifreq *ifr;
> - int error = 0;
> + int s, error = 0;
>
> switch (cmd) {
>
> case SIOCSIFADDR:
> - ifp->if_flags |= IFF_UP | IFF_RUNNING;
> + s = splnet();
> + ifp->if_flags |= IFF_RUNNING;
> + if_up(ifp); /* send up RTM_IFINFO */
> + splx(s);
> +
> ifa = (struct ifaddr *)data;
> if (ifa != 0)
> ifa->ifa_rtrequest = lortrequest;
>
--
:wq Claudio