diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-07-01 23:04:46 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-07-01 23:04:46 +0000 |
commit | 63d3dec5dda49230245975ec2593a5c0a4acc553 (patch) | |
tree | eed9696dc820f0c0913c3239b2663be56daca072 /sys/netinet | |
parent | 7a32b7a5e6f98c65a2918997eafb4487cb72b6ef (diff) |
tag packets generated by pf (return-rst, return-icmp) so they are not filtered, use existing icmp_error() and ip_output(). ok dugsong@, frantzen@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_icmp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index cc4eb966601..2e38599bfd1 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.39 2001/06/29 18:08:39 provos Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.40 2001/07/01 23:04:44 dhartmei Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -127,6 +127,7 @@ icmp_error(n, type, code, dest, destifp) register unsigned oiplen = oip->ip_hl << 2; register struct icmp *icp; struct mbuf *m; + struct m_tag *mtag; unsigned icmplen, mblen; #ifdef ICMPPRINTFS @@ -247,6 +248,12 @@ icmp_error(n, type, code, dest, destifp) nip->ip_p = IPPROTO_ICMP; nip->ip_src = oip->ip_src; nip->ip_dst = oip->ip_dst; + /* move PF_GENERATED m_tag to new packet, if it exists */ + mtag = m_tag_find(n, PACKET_TAG_PF_GENERATED, NULL); + if (mtag != NULL) { + m_tag_unlink(n, mtag); + m_tag_prepend(m, mtag); + } icmp_reflect(m); freeit: |