summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/netflow/netflow.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-02-01 14:07:05 +0000
committerglebius <glebius@FreeBSD.org>2005-02-01 14:07:05 +0000
commit7db04c586c990023fc8713e64595e52656b4077e (patch)
tree4a1e0da990ea04f2d68d3ee7f8512c919a96cbb4 /sys/netgraph/netflow/netflow.c
parent9c48e16769f7901316249afda0caa75cca335e07 (diff)
downloadFreeBSD-src-7db04c586c990023fc8713e64595e52656b4077e.zip
FreeBSD-src-7db04c586c990023fc8713e64595e52656b4077e.tar.gz
In case of various tunneling protocols, mbuf may pass several interfaces
before entering ng_netflow. In this case it will have not NULL m_pkthdr.rcvif. However, it will enter ng_iface soon with another index. So let in_ifIndex value configured by user override m_pkthdr.rcvif. Reported by: Damir Bikmuhametov MFC after: 1 week
Diffstat (limited to 'sys/netgraph/netflow/netflow.c')
-rw-r--r--sys/netgraph/netflow/netflow.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c
index 7dc34be..8a77203 100644
--- a/sys/netgraph/netflow/netflow.c
+++ b/sys/netgraph/netflow/netflow.c
@@ -321,9 +321,11 @@ make_flow_rec(struct mbuf **m, int *plen, struct flow_rec *r, uint8_t *tcp_flags
r->r_ip_p = ip->ip_p;
r->r_tos = ip->ip_tos;
- if ((*m)->m_pkthdr.rcvif)
- r->r_i_ifx = (*m)->m_pkthdr.rcvif->if_index;
- else
+ /* Configured in_ifx overrides mbuf's */
+ if (i_ifx == 0) {
+ if ((*m)->m_pkthdr.rcvif)
+ r->r_i_ifx = (*m)->m_pkthdr.rcvif->if_index;
+ } else
r->r_i_ifx = i_ifx;
/*
OpenPOWER on IntegriCloud