Fixed broadcast calculation bug.

This commit is contained in:
gardners 2011-12-02 15:19:27 +10:30
parent 70b287a1c9
commit 45dcebc048

View File

@ -80,8 +80,8 @@ int readRoutingTable(struct in_addr peers[],int *peer_count,int peer_max){
if (m!=0xFFFFFFFF){ if (m!=0xFFFFFFFF){
/* Netmask indicates a network, so calculate broadcast address */ /* Netmask indicates a network, so calculate broadcast address */
unsigned int d=(d&m)|(0xffffffff^m); d=(d&m)|(0xffffffff^m);
if (debug>1) fprintf(stderr,"Adding broadcast address %08x\n",d); if (debug) fprintf(stderr,"Adding broadcast address %08lx\n",d);
} }
if (*peer_count<peer_max) peers[(*peer_count)++].s_addr=d; if (*peer_count<peer_max) peers[(*peer_count)++].s_addr=d;