Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_gre.c
Show First 20 Lines • Show All 357 Lines • ▼ Show 20 Lines | fail: | ||||
soclose(gs->so); | soclose(gs->so); | ||||
free(s, M_GRE); | free(s, M_GRE); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
in_gre_attach(struct gre_softc *sc) | in_gre_attach(struct gre_softc *sc) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct grehdr *gh; | struct grehdr *gh; | ||||
int error; | int error; | ||||
if (sc->gre_options & GRE_UDPENCAP) { | if (sc->gre_options & GRE_UDPENCAP) { | ||||
sc->gre_csumflags = CSUM_UDP; | sc->gre_csumflags = CSUM_UDP; | ||||
sc->gre_hlen = sizeof(struct greudp); | sc->gre_hlen = sizeof(struct greudp); | ||||
sc->gre_oip.ip_p = IPPROTO_UDP; | sc->gre_oip.ip_p = IPPROTO_UDP; | ||||
gh = &sc->gre_udphdr->gi_gre; | gh = &sc->gre_udphdr->gi_gre; | ||||
Show All 18 Lines | if (sc->gre_options & GRE_UDPENCAP) { | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
} else | } else | ||||
CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); | CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); | ||||
CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), | CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), | ||||
sc, srchash); | sc, srchash); | ||||
/* Set IFF_DRV_RUNNING if interface is ready */ | /* Set IFF_DRV_RUNNING if interface is ready */ | ||||
NET_EPOCH_ENTER(et); | |||||
in_gre_set_running(sc); | in_gre_set_running(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value) | in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value) | ||||
{ | { | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |