Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_me.c
Show First 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | if (sc->me_src.s_addr != sin->sin_addr.s_addr) | ||||
continue; | continue; | ||||
me_set_running(sc); | me_set_running(sc); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) | me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct me_softc *tmp; | struct me_softc *tmp; | ||||
sx_assert(&me_ioctl_sx, SA_XLOCKED); | sx_assert(&me_ioctl_sx, SA_XLOCKED); | ||||
if (V_me_hashtbl == NULL) { | if (V_me_hashtbl == NULL) { | ||||
V_me_hashtbl = me_hashinit(); | V_me_hashtbl = me_hashinit(); | ||||
V_me_srchashtbl = me_hashinit(); | V_me_srchashtbl = me_hashinit(); | ||||
} | } | ||||
Show All 10 Lines | me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) | ||||
} | } | ||||
me_delete_tunnel(sc); | me_delete_tunnel(sc); | ||||
sc->me_dst.s_addr = dst; | sc->me_dst.s_addr = dst; | ||||
sc->me_src.s_addr = src; | sc->me_src.s_addr = src; | ||||
CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); | CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); | ||||
CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); | CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); | ||||
NET_EPOCH_ENTER(et); | |||||
me_set_running(sc); | me_set_running(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
if_link_state_change(ME2IFP(sc), LINK_STATE_UP); | if_link_state_change(ME2IFP(sc), LINK_STATE_UP); | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
me_delete_tunnel(struct me_softc *sc) | me_delete_tunnel(struct me_softc *sc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |