From 983265ffc0f9d7de3887558b59db57281396a71c Mon Sep 17 00:00:00 2001 From: Daniel Collins Date: Sat, 23 Apr 2011 20:13:21 +0000 Subject: [PATCH] Removed redundant values from ipx_nic structure and fixed bug in NIC list code. --- src/ipxwrapper.c | 6 ++---- src/ipxwrapper.h | 6 ------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ipxwrapper.c b/src/ipxwrapper.c index e180b13..dfe15c0 100644 --- a/src/ipxwrapper.c +++ b/src/ipxwrapper.c @@ -128,10 +128,7 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) { INIT_NIC(nnic); nnic->ipaddr = ntohl(inet_addr(ifptr->IpAddressList.IpAddress.String)); - nnic->netmask = ntohl(inet_addr(ifptr->IpAddressList.IpMask.String)); - nnic->bcast = nnic->ipaddr | ~nnic->netmask; - nnic->start = (nnic->ipaddr & nnic->netmask) | 1; - nnic->end = (nnic->ipaddr & nnic->netmask) | (~nnic->netmask & ~1); + nnic->bcast = nnic->ipaddr | ~ntohl(inet_addr(ifptr->IpAddressList.IpMask.String)); memcpy(nnic->hwaddr, ifptr->Address, 6); if(got_rv && rv.primary) { @@ -140,6 +137,7 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) { nics = nnic; }else if(enic) { enic->next = nnic; + enic = nnic; }else{ enic = nics = nnic; } diff --git a/src/ipxwrapper.h b/src/ipxwrapper.h index 835f6bd..ea24f5c 100644 --- a/src/ipxwrapper.h +++ b/src/ipxwrapper.h @@ -59,10 +59,7 @@ #define INIT_NIC(ptr) \ (ptr)->ipaddr = 0;\ - (ptr)->netmask = 0;\ (ptr)->bcast = 0;\ - (ptr)->start = 0;\ - (ptr)->end = 0;\ memset((ptr)->hwaddr, 0, 6);\ (ptr)->next = NULL; @@ -121,10 +118,7 @@ struct ipx_packet { struct ipx_nic { uint32_t ipaddr; - uint32_t netmask; uint32_t bcast; - uint32_t start; - uint32_t end; unsigned char hwaddr[6];