mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
ipfw: correctly restore shared forwarding info
Many thanks to everyone testing, prodding and pushing for this! :) PR: https://github.com/opnsense/core/issues/1900
This commit is contained in:
parent
f97867c8c9
commit
d1cb3383d6
1 changed files with 13 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
|
|||
#include <sys/sysctl.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/route.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/pfil.h>
|
||||
|
|
@ -124,6 +125,7 @@ ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir,
|
|||
{
|
||||
struct ip_fw_args args;
|
||||
struct m_tag *tag;
|
||||
u_short ifidx;
|
||||
int ipfw;
|
||||
int ret;
|
||||
|
||||
|
|
@ -131,6 +133,17 @@ ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir,
|
|||
dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT;
|
||||
bzero(&args, sizeof(args));
|
||||
|
||||
/* restore the correct forwarding interface */
|
||||
if (dir == DIR_OUT && IP_HAS_NEXTHOP(*m0) &&
|
||||
!ip_get_fwdtag(*m0, NULL, &ifidx)) {
|
||||
if (ifidx != 0) {
|
||||
struct ifnet *nifp = ifnet_byindex(ifidx);
|
||||
if (nifp != NULL) {
|
||||
ifp = nifp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
again:
|
||||
/*
|
||||
* extract and remove the tag if present. If we are left
|
||||
|
|
|
|||
Loading…
Reference in a new issue