ng_netflow: Move various variables under INET || INET6.
This commit is contained in:
parent
d98981585c
commit
2fdf3ed1e3
@ -594,11 +594,15 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
struct ip *ip = NULL;
|
||||
struct ip6_hdr *ip6 = NULL;
|
||||
struct m_tag *mtag;
|
||||
int pullup_len = 0, off;
|
||||
uint8_t acct = 0, bypass = 0, flags = 0, upper_proto = 0;
|
||||
int pullup_len = 0;
|
||||
uint8_t acct = 0, bypass = 0;
|
||||
int error = 0, l3_off = 0;
|
||||
#if defined(INET) || defined(INET6)
|
||||
int off;
|
||||
uint8_t flags = 0, upper_proto = 0;
|
||||
unsigned int src_if_index;
|
||||
caddr_t upper_ptr = NULL;
|
||||
#endif
|
||||
fib_export_p fe;
|
||||
uint32_t fib;
|
||||
|
||||
@ -655,8 +659,10 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
/* Import configuration flags related to flow creation */
|
||||
flags = iface->info.conf & NG_NETFLOW_FLOW_FLAGS;
|
||||
#endif
|
||||
|
||||
NGI_GET_M(item, m);
|
||||
m_old = m;
|
||||
@ -775,7 +781,9 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
off = pullup_len;
|
||||
#endif
|
||||
|
||||
if ((ip != NULL) && ((ip->ip_off & htons(IP_OFFMASK)) == 0)) {
|
||||
if ((ip->ip_v != IPVERSION) ||
|
||||
@ -787,9 +795,11 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
*/
|
||||
M_CHECK((ip->ip_hl << 2) - sizeof(struct ip));
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
/* Save upper layer offset and proto */
|
||||
off = pullup_len;
|
||||
upper_proto = ip->ip_p;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX: in case of wrong upper layer header we will
|
||||
@ -811,8 +821,10 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
* Nothing to save except upper layer proto,
|
||||
* since this is a packet fragment.
|
||||
*/
|
||||
#if defined(INET) || defined(INET6)
|
||||
flags |= NG_NETFLOW_IS_FRAG;
|
||||
upper_proto = ip->ip_p;
|
||||
#endif
|
||||
if ((ip->ip_v != IPVERSION) ||
|
||||
((ip->ip_hl << 2) < sizeof(struct ip)))
|
||||
goto bypass;
|
||||
@ -914,6 +926,7 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
ip6 = (struct ip6_hdr *)(mtod(m, caddr_t) + l3_off);
|
||||
}
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
upper_ptr = (caddr_t)(mtod(m, caddr_t) + off);
|
||||
|
||||
/* Determine packet input interface. Prefer configured. */
|
||||
@ -923,6 +936,7 @@ ng_netflow_rcvdata (hook_p hook, item_p item)
|
||||
src_if_index = m->m_pkthdr.rcvif->if_index;
|
||||
} else
|
||||
src_if_index = iface->info.ifinfo_index;
|
||||
#endif
|
||||
|
||||
/* Check packet FIB */
|
||||
fib = M_GETFIB(m);
|
||||
|
Loading…
Reference in New Issue
Block a user