summaryrefslogtreecommitdiffstats
path: root/lib/libalias
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-04-05 13:04:35 +0000
committerphk <phk@FreeBSD.org>2005-04-05 13:04:35 +0000
commit063486ce8443453a38d35be7978065a959c62b12 (patch)
treeb3099e2182171ef14552ac1f96644e8ecacd4723 /lib/libalias
parente8348c9f03779f458f7b53dc523d8030d75687e0 (diff)
downloadFreeBSD-src-063486ce8443453a38d35be7978065a959c62b12.zip
FreeBSD-src-063486ce8443453a38d35be7978065a959c62b12.tar.gz
natd core dumps when -reverse switch is used because of a bug in
libalias. In /usr/src/lib/libalias/alias.c, the functions LibAliasIn and LibAliasOutTry call the legacy PacketAliasIn/PacketAliasOut instead of LibAliasIn/LibAliasOut when the PKT_ALIAS_REVERSE option is set. In this case, the context variable "la" gets lost because the legacy compatibility routines expect "la" to be global. This was obviously an oversight when rewriting the PacketAlias* functions to the LibAlias* functions. The fix (as shown in the patch below) is to remove the legacy subroutine calls and replace with the new ones using the "la" struct as the first arg. Submitted by: Gil Kloepfer <fgil@kloepfer.org> Confirmed by: <nicolai@catpipe.net> PR: 76839 MFC after: 3 days
Diffstat (limited to 'lib/libalias')
-rw-r--r--lib/libalias/alias.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalias/alias.c b/lib/libalias/alias.c
index 3f52e57..053c18d 100644
--- a/lib/libalias/alias.c
+++ b/lib/libalias/alias.c
@@ -1170,7 +1170,7 @@ LibAliasIn(struct libalias *la, char *ptr, int maxpacketsize)
if (la->packetAliasMode & PKT_ALIAS_REVERSE) {
la->packetAliasMode &= ~PKT_ALIAS_REVERSE;
- iresult = PacketAliasOut(ptr, maxpacketsize);
+ iresult = LibAliasOut(la, ptr, maxpacketsize);
la->packetAliasMode |= PKT_ALIAS_REVERSE;
return (iresult);
}
@@ -1264,7 +1264,7 @@ LibAliasOutTry(struct libalias *la, char *ptr, /* valid IP packet */
if (la->packetAliasMode & PKT_ALIAS_REVERSE) {
la->packetAliasMode &= ~PKT_ALIAS_REVERSE;
- iresult = PacketAliasIn(ptr, maxpacketsize);
+ iresult = LibAliasIn(la, ptr, maxpacketsize);
la->packetAliasMode |= PKT_ALIAS_REVERSE;
return (iresult);
}
OpenPOWER on IntegriCloud