mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-22 16:44:32 +01:00
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
This commit is contained in:
parent
1ffcdfc986
commit
f91248c1ad
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135167
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user