Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 07:17:10 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r335033 - stable/11/sys/net
Message-ID:  <201806130717.w5D7HAac043476@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Jun 13 07:17:10 2018
New Revision: 335033
URL: https://svnweb.freebsd.org/changeset/base/335033

Log:
  MFC r334875:
    Explicitly change the link state when we assingn an address.
  
    Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that
    after this link state information still not initialized properly.
    This leads to problems with routing, since now interface has
    IFCAP_LINKSTATE capability and a route is considered as working only
    when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP()
    macro).

Modified:
  stable/11/sys/net/if_loop.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/if_loop.c
==============================================================================
--- stable/11/sys/net/if_loop.c	Wed Jun 13 07:16:01 2018	(r335032)
+++ stable/11/sys/net/if_loop.c	Wed Jun 13 07:17:10 2018	(r335033)
@@ -373,6 +373,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 	case SIOCSIFADDR:
 		ifp->if_flags |= IFF_UP;
 		ifp->if_drv_flags |= IFF_DRV_RUNNING;
+		if_link_state_change(ifp, LINK_STATE_UP);
 		/*
 		 * Everything else is done at a higher level.
 		 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806130717.w5D7HAac043476>