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
This commit is contained in:
glebius 2005-02-01 14:07:05 +00:00
parent 9c48e16769
commit 7db04c586c

View File

@ -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;
/*