svn commit: r190938 - in head/sys: . netinet/libalias

Paolo Pisati piso at FreeBSD.org
Sat Apr 11 15:19:10 UTC 2009


Author: piso
Date: Sat Apr 11 15:19:09 2009
New Revision: 190938
URL: http://svn.freebsd.org/changeset/base/190938

Log:
  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.

Modified:
  head/sys/   (props changed)
  head/sys/netinet/libalias/alias.c
  head/sys/netinet/libalias/alias_nbt.c

Modified: head/sys/netinet/libalias/alias.c
==============================================================================
--- head/sys/netinet/libalias/alias.c	Sat Apr 11 15:16:11 2009	(r190937)
+++ head/sys/netinet/libalias/alias.c	Sat Apr 11 15:19:09 2009	(r190938)
@@ -742,7 +742,7 @@ UdpAliasIn(struct libalias *la, struct i
 		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 i
 		/*
 		 * If we cannot figure out the packet, ignore it.
 		 */
-		if (r < 0)
+		if (error < 0)
 			return (PKT_ALIAS_IGNORED);
 		else
 			return (PKT_ALIAS_OK);

Modified: head/sys/netinet/libalias/alias_nbt.c
==============================================================================
--- head/sys/netinet/libalias/alias_nbt.c	Sat Apr 11 15:16:11 2009	(r190937)
+++ head/sys/netinet/libalias/alias_nbt.c	Sat Apr 11 15:19:09 2009	(r190938)
@@ -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. */


More information about the svn-src-all mailing list