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).

Reported by:	Marek Zarychta
MFC after:	3 days
This commit is contained in:
Andrey V. Elsukov 2018-06-09 09:57:14 +00:00
parent 32b68c46fa
commit 44bcc06816
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334875

View File

@ -380,6 +380,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.
*/