diff options
author | piso <piso@FreeBSD.org> | 2009-04-11 15:26:31 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2009-04-11 15:26:31 +0000 |
commit | dc27114478917eb2e8a2b544e8b2fc8342573f0e (patch) | |
tree | f43f07bd83809c93a48735b6229ab6bc28d70329 /sys/netinet | |
parent | a36990c3db3e905cc2b15da99d38ca83b6c69823 (diff) | |
download | FreeBSD-src-dc27114478917eb2e8a2b544e8b2fc8342573f0e.zip FreeBSD-src-dc27114478917eb2e8a2b544e8b2fc8342573f0e.tar.gz |
What's the point of adjusting a checksum if we are going to toss the
packet? Anticipate the check/return code.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/libalias/alias.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 4a73928..2e469d7 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -762,6 +762,9 @@ UdpAliasIn(struct libalias *la, struct ip *pip) /* Walk out chain. */ error = find_handler(IN, UDP, la, pip, &ad); + /* If we cannot figure out the packet, ignore it. */ + if (error < 0) + return (PKT_ALIAS_IGNORED); /* If UDP checksum is not zero, then adjust since destination port */ /* is being unaliased and destination address is being altered. */ @@ -801,13 +804,7 @@ UdpAliasIn(struct libalias *la, struct ip *pip) &original_address, &pip->ip_dst, 2); pip->ip_dst = original_address; - /* - * If we cannot figure out the packet, ignore it. - */ - if (error < 0) - return (PKT_ALIAS_IGNORED); - else - return (PKT_ALIAS_OK); + return (PKT_ALIAS_OK); } return (PKT_ALIAS_IGNORED); } |