Bug in SVDRP-hosts-parser
Commit Message
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
============= snip ==========
@@ -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)