Plug two bugs introduced with modules conversion:

-UdpAliasIn(): correctly check return code after modules ran.
-alias_nbt: in case of malformed packets (or some other unrecoverable
 error), toss the packet.
This commit is contained in:
piso 2009-04-11 15:19:09 +00:00
parent abe2fea9ee
commit a36990c3db
2 changed files with 5 additions and 7 deletions

View File

@ -742,7 +742,7 @@ UdpAliasIn(struct libalias *la, struct ip *pip)
u_short alias_port;
u_short proxy_port;
int accumulate;
int r = 0, error;
int error;
struct alias_data ad = {
.lnk = lnk,
.oaddr = &original_address,
@ -804,7 +804,7 @@ UdpAliasIn(struct libalias *la, struct ip *pip)
/*
* If we cannot figure out the packet, ignore it.
*/
if (r < 0)
if (error < 0)
return (PKT_ALIAS_IGNORED);
else
return (PKT_ALIAS_OK);

View File

@ -93,8 +93,7 @@ static int
protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah)
{
AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport);
return (0);
return (AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport));
}
static int
@ -123,9 +122,8 @@ static int
protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah)
{
AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport,
ah->aaddr, ah->aport);
return (0);
return (AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport,
ah->aaddr, ah->aport));
}
/* Kernel module definition. */