Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Trouble with IPF



Brett,

I've found the problem.  Darrenr added an unnecessary htonl to the macro
IN_CLASSD (line 1688-ish in src/sys/external/bsd/ipf/netinet/fil.c).  This cases
the macro to interrogate the least significant byte rather than the most
significant.  In my case, I was trying to reach 174.142.250.228, a totally valid
class B address.  However, if you swap the bytes, it looks like 228.250.152.174,
a multicast address.

The following patch fixes the problem:

Index: sys/external/bsd/ipf/netinet/fil.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/ipf/netinet/fil.c,v
retrieving revision 1.5
diff -u -r1.5 fil.c
--- sys/external/bsd/ipf/netinet/fil.c  22 Jul 2012 16:26:56 -0000      1.5
+++ sys/external/bsd/ipf/netinet/fil.c  9 Oct 2012 19:25:28 -0000
@@ -1685,7 +1685,7 @@
        fin->fin_crc += fi->fi_saddr;
        fi->fi_daddr = ip->ip_dst.s_addr;
        fin->fin_crc += fi->fi_daddr;
-       if (IN_CLASSD(ntohl(fi->fi_daddr)))
+       if (IN_CLASSD(fi->fi_daddr))
                fin->fin_flx |= FI_MULTICAST|FI_MBCAST;
 
        /*


Now, how do I add this to the problem report?

Aran


Home | Main Index | Thread Index | Old Index