[OpenAFS-devel] RX_MAX_FRAGS (yet again)

Nickolai Zeldovich kolya@MIT.EDU
Thu, 11 Oct 2001 14:48:28 -0400


> my fix for the time being is to return 1 if match_value != 0

I suspect returning a non-zero value from a function called by
hash_enum will cause hash_enum to stop iterating, so it'll end
up getting the MTU of the first matching interface.  Something
like this might be slightly better if the host has multiple
matching interfaces (though unfortunately I don't have an SGI
to test it on).

-- kolya

--- src/rx/IRIX/rx_knet.c	2001/08/08 06:29:03	1.6
+++ src/rx/IRIX/rx_knet.c	2001/10/11 18:45:19
@@ -324,7 +324,6 @@
 {
   afs_uint32 ppaddr;
   int match_value = 0;
-  struct hashbucket *slop;
 
   if (numMyNetAddrs == 0)
     (void) rxi_GetIFInfo();
@@ -332,11 +331,11 @@
   ppaddr = ntohl(addr);
   *pifad = (struct in_ifaddr*)&hashinfo_inaddr;
 
-  slop = hash_enum(&hashinfo_inaddr, rxi_MatchIfnet, HTF_INET,
+  (void) hash_enum(&hashinfo_inaddr, rxi_MatchIfnet, HTF_INET,
 		   (caddr_t)&ppaddr, (caddr_t)&match_value, (caddr_t)pifad);
 
-  if (slop)
-      return ((struct in_ifaddr*)slop)->ia_ifp;
+  if (match_value)
+      return (*pifad)->ia_ifp;
   else
       return NULL;