This just fixes the netmask calculation to not confuse netadmins who know that 10.0.0.0/8 is private, not 10.0.0.0/24.

I also fixed a comment that said 69.254/16 was added, when in reality 169.254 was added (I confirmed online that 169 is the correct value).

Damian Menscher
--
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-
--- clamav-milter.c
+++ clamav-milter.c
@@ -175,22 +175,22 @@
 /*
  * Local addresses are those not scanned if --local is not set
  * 127.0.0.0 is not in this table since that's goverend by --outgoing
- * Andy Fiddaman <[EMAIL PROTECTED]> added 69.254.0.0/16
+ * Andy Fiddaman <[EMAIL PROTECTED]> added 169.254.0.0/16
  *     (Microsoft default DHCP)
  *
  * TODO: read this table in from a file (clamd.conf?)
  */
 #define PACKADDR(a, b, c, d) (((uint32_t)(a) << 24) | ((b) << 16) | ((c) << 8) 
| (d))
-#define MAKEMASK(bits) ((uint32_t)(0xffffffff << (bits)))
+#define MAKEMASK(bits) ((uint32_t)(0xffffffff << (32-bits)))
 
 static const struct cidr_net {
        uint32_t        base;
        uint32_t        mask;
 } localNets[] = {
-       /*{ PACKADDR(127,   0,   0,   0), MAKEMASK(24) },       /*   
127.0.0.0/24 */
+       /*{ PACKADDR(127,   0,   0,   0), MAKEMASK(8) },        /*   
127.0.0.0/8 */
        { PACKADDR(192, 168,   0,   0), MAKEMASK(16) }, /* 192.168.0.0/16 */
-       { PACKADDR( 10,   0,   0,   0), MAKEMASK(24) }, /*    10.0.0.0/24 */
-       { PACKADDR(172,  16,   0,   0), MAKEMASK(20) }, /*  172.16.0.0/20 */
+       { PACKADDR( 10,   0,   0,   0), MAKEMASK(8) },  /*    10.0.0.0/8 */
+       { PACKADDR(172,  16,   0,   0), MAKEMASK(12) }, /*  172.16.0.0/12 */
        { PACKADDR(169,  254,  0,   0), MAKEMASK(16) }, /* 169.254.0.0/16 */
        { 0, 0 }
 };
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to