diff options
author | hrs <hrs@FreeBSD.org> | 2015-11-04 00:21:02 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2015-11-04 00:21:02 +0000 |
commit | 6e153191224677d8b773d7d47d9a0a076e58856b (patch) | |
tree | e0204e27d5c873a3ae0de35dbf25dba18cd711c1 /sys/net/if_gif.c | |
parent | fe49fc6e1c94b6c41d1d3844ca219a76da3c70dc (diff) | |
download | FreeBSD-src-6e153191224677d8b773d7d47d9a0a076e58856b.zip FreeBSD-src-6e153191224677d8b773d7d47d9a0a076e58856b.tar.gz |
MFC r288575:
Add IFCAP_LINKSTATE support.
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r-- | sys/net/if_gif.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index f2a38c1..589fa3f 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -196,6 +196,8 @@ gif_clone_create(struct if_clone *ifc, int unit, caddr_t params) GIF2IFP(sc)->if_transmit = gif_transmit; GIF2IFP(sc)->if_qflush = gif_qflush; GIF2IFP(sc)->if_output = gif_output; + GIF2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; + GIF2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(GIF2IFP(sc)); bpfattach(GIF2IFP(sc), DLT_NULL, sizeof(u_int32_t)); if (ng_gif_attach_p != NULL) @@ -1038,10 +1040,13 @@ gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) #if defined(INET) || defined(INET6) bad: #endif - if (error == 0 && sc->gif_family != 0) + if (error == 0 && sc->gif_family != 0) { ifp->if_drv_flags |= IFF_DRV_RUNNING; - else + if_link_state_change(ifp, LINK_STATE_UP); + } else { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(ifp, LINK_STATE_DOWN); + } return (error); } @@ -1063,4 +1068,5 @@ gif_delete_tunnel(struct ifnet *ifp) free(sc->gif_hdr, M_GIF); } ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(ifp, LINK_STATE_DOWN); } |