summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2004-09-13 19:20:14 +0000
committerandre <andre@FreeBSD.org>2004-09-13 19:20:14 +0000
commit2c213c186fe3b1ee172b037aee5ac833af20481c (patch)
tree9c405a91897264ad8135b2d475d21a0f7bbcd5af /sys/netinet
parente41803bc8097fdfed07a78a78e4efe649c8f5c61 (diff)
downloadFreeBSD-src-2c213c186fe3b1ee172b037aee5ac833af20481c.zip
FreeBSD-src-2c213c186fe3b1ee172b037aee5ac833af20481c.tar.gz
If we have to 'ipfw fwd'-tag a packet the second time in ipfw_pfil_out() don't
prepend an already existing tag again. Instead unlink it and prepend it again to have it as the first tag in the chain. PR: kern/71380
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_fw_pfil.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/ip_fw_pfil.c b/sys/netinet/ip_fw_pfil.c
index 7a326d9..69e0188 100644
--- a/sys/netinet/ip_fw_pfil.c
+++ b/sys/netinet/ip_fw_pfil.c
@@ -218,11 +218,13 @@ again:
if (ipfw == 0 && args.next_hop != NULL) {
/* Overwrite existing tag. */
fwd_tag = m_tag_find(*m0, PACKET_TAG_IPFORWARD, NULL);
- if (fwd_tag == NULL)
+ if (fwd_tag == NULL) {
fwd_tag = m_tag_get(PACKET_TAG_IPFORWARD,
sizeof(struct sockaddr_in), M_NOWAIT);
- if (fwd_tag == NULL)
- goto drop;
+ if (fwd_tag == NULL)
+ goto drop;
+ } else
+ m_tag_unlink(*m0, fwd_tag);
bcopy(args.next_hop, (fwd_tag+1), sizeof(struct sockaddr_in));
m_tag_prepend(*m0, fwd_tag);
OpenPOWER on IntegriCloud