aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2018-06-09 09:57:14 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2018-06-09 09:57:14 +0000
commit44bcc068168815cfc0bb9f1c8b692bef67c0e471 (patch)
tree9bdc448444634e819ac1862e3e9c1511c3642c51 /sys
parent32b68c46fa0d700f02e3ac69f9a89f27d48d7395 (diff)
downloadsrc-44bcc068168815cfc0bb9f1c8b692bef67c0e471.tar.gz
src-44bcc068168815cfc0bb9f1c8b692bef67c0e471.zip
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
Notes
Notes: svn path=/head/; revision=334875
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_loop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index c8a47cba6e6b..3be2a3721409 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -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.
*/