Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/raw_ip.c
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
VNET_DEFINE(struct socket *, ip_mrouter); | VNET_DEFINE(struct socket *, ip_mrouter); | ||||
/* | /* | ||||
* The various mrouter and rsvp functions. | * The various mrouter and rsvp functions. | ||||
*/ | */ | ||||
int (*ip_mrouter_set)(struct socket *, struct sockopt *); | int (*ip_mrouter_set)(struct socket *, struct sockopt *); | ||||
int (*ip_mrouter_get)(struct socket *, struct sockopt *); | int (*ip_mrouter_get)(struct socket *, struct sockopt *); | ||||
int (*ip_mrouter_done)(void *locked); | int (*ip_mrouter_done)(void); | ||||
int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *, | int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *, | ||||
struct ip_moptions *); | struct ip_moptions *); | ||||
int (*mrt_ioctl)(u_long, caddr_t, int); | int (*mrt_ioctl)(u_long, caddr_t, int); | ||||
int (*legal_vif_num)(int); | int (*legal_vif_num)(int); | ||||
u_long (*ip_mcast_src)(int); | u_long (*ip_mcast_src)(int); | ||||
int (*rsvp_input_p)(struct mbuf **, int *, int); | int (*rsvp_input_p)(struct mbuf **, int *, int); | ||||
int (*ip_rsvp_vif)(struct socket *, struct sockopt *); | int (*ip_rsvp_vif)(struct socket *, struct sockopt *); | ||||
▲ Show 20 Lines • Show All 743 Lines • ▼ Show 20 Lines | rip_attach(struct socket *so, int proto, struct thread *td) | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
rip_detach(struct socket *so) | rip_detach(struct socket *so) | ||||
{ | { | ||||
struct inpcb *inp; | struct inpcb *inp; | ||||
MROUTER_RLOCK_TRACKER; | |||||
inp = sotoinpcb(so); | inp = sotoinpcb(so); | ||||
KASSERT(inp != NULL, ("rip_detach: inp == NULL")); | KASSERT(inp != NULL, ("rip_detach: inp == NULL")); | ||||
KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, | KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, | ||||
("rip_detach: not closed")); | ("rip_detach: not closed")); | ||||
/* Disable mrouter first, lock released inside ip_mrouter_done */ | /* Disable mrouter first */ | ||||
MROUTER_RLOCK(); | |||||
if (so == V_ip_mrouter && ip_mrouter_done) | if (so == V_ip_mrouter && ip_mrouter_done) | ||||
ip_mrouter_done(MROUTER_RLOCK_PARAM_PTR); | ip_mrouter_done(); | ||||
else | |||||
MROUTER_RUNLOCK(); | |||||
INP_WLOCK(inp); | INP_WLOCK(inp); | ||||
INP_HASH_WLOCK(&V_ripcbinfo); | INP_HASH_WLOCK(&V_ripcbinfo); | ||||
rip_delhash(inp); | rip_delhash(inp); | ||||
INP_HASH_WUNLOCK(&V_ripcbinfo); | INP_HASH_WUNLOCK(&V_ripcbinfo); | ||||
if (ip_rsvp_force_done) | if (ip_rsvp_force_done) | ||||
ip_rsvp_force_done(so); | ip_rsvp_force_done(so); | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |