X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fipv6.c;h=561297db76ac57a97b753890eb8ba5bcd1b3a0a2;hb=94ecc5441605ad5151e625457531e7f90470db31;hp=aac33dea7ad22cf9ddca5024ac76e09577c43788;hpb=2904567b1901a524d44a136f06f2e6d7b5ce7db5;p=tpg%2Facess2.git diff --git a/Modules/IPStack/ipv6.c b/Modules/IPStack/ipv6.c index aac33dea..561297db 100644 --- a/Modules/IPStack/ipv6.c +++ b/Modules/IPStack/ipv6.c @@ -75,32 +75,34 @@ tInterface *IPv6_GetInterface(tAdapter *Adapter, tIPv6 Address, int Broadcast) for( iface = gIP_Interfaces; iface; iface = iface->Next) { + tIPv6 *thisAddr; // Check for this adapter if( iface->Adapter != Adapter ) continue; // Skip non-IPv6 Interfaces if( iface->Type != 6 ) continue; + thisAddr = (tIPv6*)iface->Address; // If the address is a perfect match, return this interface - if( IP6_EQU(Address, iface->IP6.Address) ) return iface; + if( IP6_EQU(Address, *thisAddr) ) return iface; // Check if we want to match broadcast addresses if( !Broadcast ) continue; // Check for broadcast - if( iface->IP6.SubnetBits > 32 && Address.L[0] != iface->IP6.Address.L[0] ) + if( iface->SubnetBits > 32 && Address.L[0] != thisAddr->L[0] ) continue; - if( iface->IP6.SubnetBits > 64 && Address.L[1] != iface->IP6.Address.L[1] ) + if( iface->SubnetBits > 64 && Address.L[1] != thisAddr->L[1] ) continue; - if( iface->IP6.SubnetBits > 96 && Address.L[2] != iface->IP6.Address.L[2] ) + if( iface->SubnetBits > 96 && Address.L[2] != thisAddr->L[2] ) continue; - j = iface->IP6.SubnetBits / 32; - i = iface->IP6.SubnetBits % 32; - netmask = IPv4_Netmask( iface->IP6.SubnetBits % 32 ); + j = iface->SubnetBits / 32; + i = iface->SubnetBits % 32; + netmask = IPv4_Netmask( iface->SubnetBits % 32 ); // Check the last bit of the netmask - if( (Address.L[j] >> i) != (iface->IP6.Address.L[j] >> i) ) continue; + if( (Address.L[j] >> i) != (thisAddr->L[j] >> i) ) continue; // Check that the host portion is one if( (Address.L[j] & ~netmask) != (0xFFFFFFFF & ~netmask) ) continue;