Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/send.c
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | send_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, | ||||
struct sockaddr_send *sendsrc; | struct sockaddr_send *sendsrc; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
int error; | int error; | ||||
KASSERT(V_send_so == so, ("%s: socket %p not send socket %p", | KASSERT(V_send_so == so, ("%s: socket %p not send socket %p", | ||||
__func__, so, V_send_so)); | __func__, so, V_send_so)); | ||||
sendsrc = (struct sockaddr_send *)nam; | sendsrc = (struct sockaddr_send *)nam; | ||||
if (sendsrc->send_family != AF_INET6) { | |||||
error = EAFNOSUPPORT; | |||||
goto err; | |||||
} | |||||
if (sendsrc->send_len != sizeof(*sendsrc)) { | |||||
error = EINVAL; | |||||
goto err; | |||||
} | |||||
ifp = ifnet_byindex_ref(sendsrc->send_ifidx); | ifp = ifnet_byindex_ref(sendsrc->send_ifidx); | ||||
if (ifp == NULL) { | if (ifp == NULL) { | ||||
error = ENETUNREACH; | error = ENETUNREACH; | ||||
goto err; | goto err; | ||||
} | } | ||||
error = send_output(m, ifp, sendsrc->send_direction); | error = send_output(m, ifp, sendsrc->send_direction); | ||||
if_rele(ifp); | if_rele(ifp); | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |