1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Removed redundant values from ipx_nic structure and fixed bug in NIC list code.

This commit is contained in:
Daniel Collins 2011-04-23 20:13:21 +00:00
parent e4534b91eb
commit 983265ffc0
2 changed files with 2 additions and 10 deletions

View File

@ -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;
}

View File

@ -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];