int seen = (inject_ipfref == 0);
int changed_header = 0;
struct ip *ip;
+ void (*pr_input)(struct mbuf *, int len);
if (!TAILQ_EMPTY(&ipv4_filters)) {
ipf_ref();
* otherwise let the protocol deal with its own locking
*/
ip = mtod(m, struct ip *);
-
+
if (changed_header) {
ip->ip_len = ntohs(ip->ip_len) - hlen;
ip->ip_off = ntohs(ip->ip_off);
}
-
- if (!(ip_protox[ip->ip_p]->pr_flags & PR_PROTOLOCK)) {
+
+ if ((pr_input = ip_protox[ip->ip_p]->pr_input) == NULL) {
+ m_freem(m);
+ } else if (!(ip_protox[ip->ip_p]->pr_flags & PR_PROTOLOCK)) {
lck_mtx_lock(inet_domain_mutex);
- (*ip_protox[ip->ip_p]->pr_input)(m, hlen);
+ pr_input(m, hlen);
lck_mtx_unlock(inet_domain_mutex);
- }
- else
- (*ip_protox[ip->ip_p]->pr_input)(m, hlen);
-
+ } else {
+ pr_input(m, hlen);
+ }
}
/*
struct ip *ip;
struct ipq *fp;
struct in_ifaddr *ia = NULL;
- int i, hlen, checkif;
+ int hlen, checkif;
u_short sum;
struct in_addr pkt_dst;
- u_int32_t div_info = 0; /* packet divert/tee info */
#if IPFIREWALL
+ int i;
+ u_int32_t div_info = 0; /* packet divert/tee info */
struct ip_fw_args args;
+ struct m_tag *tag;
#endif
ipfilter_t inject_filter_ref = 0;
- struct m_tag *tag;
#if IPFIREWALL
args.eh = NULL;