Robert Gordon wrote: > > I think this: > > 1460 } else { > 1461 if ((addr & 0x00ffffff) == 0) > 1462 mask = 0xff000000; > 1463 else if ((addr & 0x0000ffff) == 0) > 1464 mask = 0xffff0000; > 1465 else if ((addr & 0x000000ff) == 0) > 1466 mask = 0xffffff00; > 1467 else > 1468 mask = 0xffffffff; > 1469 } > > reads better as: > > if (IN_CLASSA(addr)) > mask = IN_CLASSA_NET; > else if (IN_CLASSB(addr)) > mask = IN_CLASSB_NET; > else if (IN_CLASSC(addr)) > mask = IN_CLASSC_NET; > else > mask = IP_HOST_MASK; > > it makes it quite obvious the code only supports class A, B or C for > non CIDR > defined networks.
Okay, I'll test that... And for the last, we want: mask = IN_CLASSE_NET; > > also just as an extra sanity check, should sin_family be > verified to be AF_INET ? > > Robert. More perturbation that I want in the code.