-/* $OpenBSD: ip_icmp.c,v 1.186 2021/03/30 08:37:10 sashan Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.187 2021/07/26 20:44:44 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
struct rtentry *rt = NULL;
int optlen = (ip->ip_hl << 2) - sizeof(struct ip);
u_int rtableid;
+ u_int8_t pfflags;
if (!in_canforward(ip->ip_src) &&
((ip->ip_src.s_addr & IN_CLASSA_NET) !=
return (ELOOP);
}
rtableid = m->m_pkthdr.ph_rtableid;
+ pfflags = m->m_pkthdr.pf.flags;
m_resethdr(m);
m->m_pkthdr.ph_rtableid = rtableid;
+ m->m_pkthdr.pf.flags = pfflags & PF_TAG_GENERATED;
/*
* If the incoming packet was addressed directly to us,
-/* $OpenBSD: icmp6.c,v 1.235 2021/03/10 10:21:49 jsg Exp $ */
+/* $OpenBSD: icmp6.c,v 1.236 2021/07/26 20:44:44 bluhm Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
struct in6_addr t, *src = NULL;
struct sockaddr_in6 sa6_src, sa6_dst;
u_int rtableid;
+ u_int8_t pfflags;
CTASSERT(sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr) <= MHLEN);
return (ELOOP);
}
rtableid = m->m_pkthdr.ph_rtableid;
+ pfflags = m->m_pkthdr.pf.flags;
m_resethdr(m);
m->m_pkthdr.ph_rtableid = rtableid;
+ m->m_pkthdr.pf.flags = pfflags & PF_TAG_GENERATED;
/*
* If there are extra headers between IPv6 and ICMPv6, strip