Bug in SVDRP-hosts-parser

Message ID 00f201c69d1e$c1bc2330$93893cd4@panzerknacker
State New
Headers

Commit Message

Patrick Maier July 1, 2006, 2:58 p.m. UTC
  Hi Klaus,

i found a bug in the computing of the Netmask for the SVDRP-Hosts-file.
The byte order in your case was not correctly computed.
Here is a patch.

============= snip ==========

Greets
Patrick
  

Patch

============= snip ==========
--- config.c.orig       2006-07-01 16:53:25.000000000 +0200
+++ config.c    2006-07-01 16:53:33.000000000 +0200
@@ -106,8 +106,10 @@ 
      *(char *)p = 0; // yes, we know it's 'const' - will be restored!
      if (m == 0)
         mask = 0;
-     else
-        mask >>= (32 - m);
+     else {
+        mask <<= (32 - m);
+       mask = htonl(mask);
+       }
      }
   int result = inet_aton(s, &addr);
   if (p)