Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Show First 20 Lines • Show All 726 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#ifdef USE_INET6 | #ifdef USE_INET6 | ||||
if (fin->fin_v == 6) { | if (fin->fin_v == 6) { | ||||
/* | /* | ||||
* currently "to <if>" and "to <if>:ip#" are not supported | * currently "to <if>" and "to <if>:ip#" are not supported | ||||
* for IPv6 | * for IPv6 | ||||
*/ | */ | ||||
return ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); | return ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); | ||||
cy: Should we call ip6_output() within an epoch before we return? i.e.,
struct epoch_tracker et… | |||||
Done Inline ActionsNever mind. I'll need to look at implementing basic functionality first. cy: Never mind. I'll need to look at implementing basic functionality first. | |||||
} | } | ||||
#endif | #endif | ||||
hlen = fin->fin_hlen; | hlen = fin->fin_hlen; | ||||
ip = mtod(m0, struct ip *); | ip = mtod(m0, struct ip *); | ||||
ifp = NULL; | ifp = NULL; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
int | int | ||||
ipf_inject(fin, m) | ipf_inject(fin, m) | ||||
fr_info_t *fin; | fr_info_t *fin; | ||||
mb_t *m; | mb_t *m; | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
int error = 0; | int error = 0; | ||||
NET_EPOCH_ENTER(et); | |||||
if (fin->fin_out == 0) { | if (fin->fin_out == 0) { | ||||
netisr_dispatch(NETISR_IP, m); | netisr_dispatch(NETISR_IP, m); | ||||
} else { | } else { | ||||
fin->fin_ip->ip_len = ntohs(fin->fin_ip->ip_len); | fin->fin_ip->ip_len = ntohs(fin->fin_ip->ip_len); | ||||
fin->fin_ip->ip_off = ntohs(fin->fin_ip->ip_off); | fin->fin_ip->ip_off = ntohs(fin->fin_ip->ip_off); | ||||
error = ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); | error = ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); | ||||
} | } | ||||
NET_EPOCH_EXIT(et); | |||||
return error; | return error; | ||||
} | } | ||||
VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet_hook); | VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet_hook); | ||||
VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet6_hook); | VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet6_hook); | ||||
#define V_ipf_inet_hook VNET(ipf_inet_hook) | #define V_ipf_inet_hook VNET(ipf_inet_hook) | ||||
#define V_ipf_inet6_hook VNET(ipf_inet6_hook) | #define V_ipf_inet6_hook VNET(ipf_inet6_hook) | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |
Should we call ip6_output() within an epoch before we return? i.e.,
struct epoch_tracker et;
int error = 0;
...
NET_EPOCH_ENTER(et);
error = ip6_output(...);
NET_EPOCH_EXIT(et);
return(error);