[PATCH] bad p0f src-port byteorder
2011-03-17 by Enrico Scholz
Hi, current milter-greylist (both CVS and 4.2.6) transmit the src port in the p0f query in the wrong byteorder; dst port is transmitted correctly due to a programming bug (duplicate htons() calls) ;) p0f expects ports in host byteorder, the ips in network byteorder. E.g. p0f-2.0.8's p0f.c file[1] contains: | find_match( | ... | /* src */ iph->saddr, | /* dst */ iph->daddr, | /* sp */ ntohs(tcph->sport), | /* dp */ ntohs(tcph->dport), | ... Patch can be found at http://pkgs.fedoraproject.org/gitweb/?p=milter-greylist.git;a=blob;f=p0f-srcport.patch;hb=HEAD Footnotes: [1] http://www.stearns.org/p0f/p0f.c Enrico