Added -mno-red-zone
[tpg/acess2.git] / Modules / IPStack / ipv6.c
index 31aedcb..7ae927a 100644 (file)
@@ -7,6 +7,7 @@
 #include "ipv6.h"
 
 // === IMPORTS ===
+extern tInterface      *gIP_Interfaces;
 extern Uint32  IPv4_Netmask(int FixedBits);
 
 // === PROTOTYPES ===
@@ -33,7 +34,20 @@ void IPv6_int_GetPacket(tAdapter *Interface, tMacAddr From, int Length, void *Bu
        tIPv6Header     *hdr = Buffer;
        if(Length < sizeof(tIPv6Header))        return;
        
-       if(hdr->Version != 6)   return;
+       if( ((hdr->Head >> (20+8)) & 0xF) != 6 )
+               return;
+       
+       Log("[IPv6 ] hdr = {");
+       Log("[IPv6 ]  .Version       = %i", (hdr->Head >> (20+8)) & 0xF );
+       Log("[IPv6 ]  .TrafficClass  = %i", (hdr->Head >> (20)) & 0xFF );
+       Log("[IPv6 ]  .FlowLabel     = %i", hdr->Head & 0xFFFFF );
+       Log("[IPv6 ]  .PayloadLength = 0x%04x", ntohs(hdr->PayloadLength) );
+       Log("[IPv6 ]  .NextHeader    = 0x%02x", hdr->NextHeader );
+       Log("[IPv6 ]  .HopLimit      = 0x%02x", hdr->HopLimit );
+       Log("[IPv6 ]  .Source        = %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", hdr->Source );
+       Log("[IPv6 ]  .Destination   = %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", hdr->Destination );
+       Log("[IPv6 ] }");
+       
 }
 
 /**
@@ -46,8 +60,11 @@ tInterface *IPv6_GetInterface(tAdapter *Adapter, tIPv6 Address, int Broadcast)
        tInterface      *iface = NULL;
        Uint32  netmask;
        
-       for( iface = Adapter->Interfaces; iface; iface = iface->Next)
+       for( iface = gIP_Interfaces; iface; iface = iface->Next)
        {
+               // Check for this adapter
+               if( iface->Adapter != Adapter ) continue;
+               
                // Skip non-IPv6 Interfaces
                if( iface->Type != 6 )  continue;
                

UCC git Repository :: git.ucc.asn.au