svn commit: r190941 - in head/sys: . netinet/libalias
Paolo Pisati
piso at FreeBSD.org
Sat Apr 11 15:26:32 UTC 2009
Author: piso
Date: Sat Apr 11 15:26:31 2009
New Revision: 190941
URL: http://svn.freebsd.org/changeset/base/190941
Log:
What's the point of adjusting a checksum if we are going to toss the
packet? Anticipate the check/return code.
Modified:
head/sys/ (props changed)
head/sys/netinet/libalias/alias.c
Modified: head/sys/netinet/libalias/alias.c
==============================================================================
--- head/sys/netinet/libalias/alias.c Sat Apr 11 15:21:11 2009 (r190940)
+++ head/sys/netinet/libalias/alias.c Sat Apr 11 15:26:31 2009 (r190941)
@@ -762,6 +762,9 @@ UdpAliasIn(struct libalias *la, struct i
/* 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 i
&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);
}
More information about the svn-src-head
mailing list