diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2018-05-09 10:50:51 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2018-05-09 10:50:51 +0000 |
commit | 2e4531a12bfbc2afef6a6c8a9a73f167b0365626 (patch) | |
tree | 91a2a13260034d5a9070b750a307524a81aef208 /sys/net | |
parent | 6c100026bfe0e1844f576d2108f1f36b0f11eeb3 (diff) | |
download | src-2e4531a12bfbc2afef6a6c8a9a73f167b0365626.tar.gz src-2e4531a12bfbc2afef6a6c8a9a73f167b0365626.zip |
Add IFCAP_LINKSTATE support to if_loop(4).
Reviewed by: wollman
Obtained from: Yandex LLC
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15278
Notes
Notes:
svn path=/head/; revision=333400
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_loop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index d5f338b4a731..c8a47cba6e6b 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -136,7 +136,7 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_t params) ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_capabilities = ifp->if_capenable = - IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; + IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_LINKSTATE; ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); @@ -413,6 +413,8 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFFLAGS: + if_link_state_change(ifp, (ifp->if_flags & IFF_UP) ? + LINK_STATE_UP: LINK_STATE_DOWN); break; case SIOCSIFCAP: |