Fix handling of packets which matched an "ipfw fwd" rule on the input side.

This commit is contained in:
Luigi Rizzo 2002-08-03 14:59:45 +00:00
parent e9fb70115f
commit ea779ff36c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101268

View File

@ -1738,8 +1738,21 @@ ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop)
}
}
{
struct m_hdr tag;
if (next_hop) {
/* Pass IPFORWARD info if available */
tag.mh_type = MT_TAG;
tag.mh_flags = PACKET_TAG_IPFORWARD;
tag.mh_data = (caddr_t)next_hop;
tag.mh_next = m;
m = (struct mbuf *)&tag;
}
error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
IP_FORWARDING, 0);
}
if (error)
ipstat.ips_cantforward++;
else {