Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_tuntap.c
Show First 20 Lines • Show All 1,395 Lines • ▼ Show 20 Lines | #endif | ||||
if ((ifp->if_flags & IFF_UP) != IFF_UP) { | if ((ifp->if_flags & IFF_UP) != IFF_UP) { | ||||
m_freem (m0); | m_freem (m0); | ||||
return (EHOSTDOWN); | return (EHOSTDOWN); | ||||
} | } | ||||
/* BPF writes need to be handled specially. */ | /* BPF writes need to be handled specially. */ | ||||
if (dst->sa_family == AF_UNSPEC) | if (dst->sa_family == AF_UNSPEC) | ||||
bcopy(dst->sa_data, &af, sizeof(af)); | bcopy(dst->sa_data, &af, sizeof(af)); | ||||
/* FIXME TUN is p-t-p device */ | |||||
else | else | ||||
af = dst->sa_family; | af = RO_GET_FAMILY(ro, dst); | ||||
melifaro: Do we need it? | |||||
Done Inline ActionsI'll test P-t-P devices and report later. zlei: I'll test P-t-P devices and report later. | |||||
Done Inline ActionsIn case we intend to support route like route add x.x.x.x -inet6 yy:: where the yy:: is IPv6 address of the peer of P-t-P interface, we still need it. Otherwise bpf will consume wrong address family. zlei: In case we intend to support route like `route add x.x.x.x -inet6 yy::` where the `yy::` is… | |||||
if (bpf_peers_present(ifp->if_bpf)) | if (bpf_peers_present(ifp->if_bpf)) | ||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); | bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); | ||||
/* prepend sockaddr? this may abort if the mbuf allocation fails */ | /* prepend sockaddr? this may abort if the mbuf allocation fails */ | ||||
if (cached_tun_flags & TUN_LMODE) { | if (cached_tun_flags & TUN_LMODE) { | ||||
/* allocate space for sockaddr */ | /* allocate space for sockaddr */ | ||||
M_PREPEND(m0, dst->sa_len, M_NOWAIT); | M_PREPEND(m0, dst->sa_len, M_NOWAIT); | ||||
▲ Show 20 Lines • Show All 599 Lines • Show Last 20 Lines |
Do we need it?