• Resolved

RTOS/PROCESSOR-SDK-AM437X: Raw Ethernet support for VLAN device patch

Intellectual 380 points

Replies: 6

Views: 172

Part Number: PROCESSOR-SDK-AM437X

Tool/software: TI-RTOS

While working on our app we found a small bug in NDK 3.40.01.01 which prevents use Raw sockets with VLAN (original SDK always looks for the VLAN frame ID instead of L2 frame ID). Can someone apply it to official source tree?

diff -ru ndk_3_40_01_01/packages/ti/ndk/stack/raweth/raweth.c ndk_3_40_01_01.vlan/packages/ti/ndk/stack/raweth/raweth.c
--- ndk_3_40_01_01/packages/ti/ndk/stack/raweth/raweth.c	2018-08-31 19:18:35.000000000 +0300
+++ ndk_3_40_01_01.vlan/packages/ti/ndk/stack/raweth/raweth.c	2019-05-06 17:32:02.752635600 +0300
@@ -197,7 +197,6 @@
 {
 
     PBM_Pkt*        ptr_pkt = (PBM_Pkt *)hPkt;
-    uint32_t        Type;
     int32_t         len;
     ETHHDR*         ptr_eth_header;
     SOCKRAWETH      *hRawEthSock;
@@ -215,15 +214,10 @@
     ptr_pkt->ValidLen   += ptr_pkt->L2HdrLen;
     ptr_pkt->DataOffset -= ptr_pkt->L2HdrLen;
 
-    /* Get the pointer to the Ethernet Header. */
-    ptr_eth_header = (ETHHDR *) (ptr_pkt->pDataBuffer + ptr_pkt->DataOffset);
-
     /* Use the type field to determine if we have a matching
      * raw ethernet channel open
      */
-    Type = NDK_ntohs (ptr_eth_header->Type);
-
-    hRawEthSock = RawEthSockPcbFind (Type, ptr_pkt->hIFRx);
+    hRawEthSock = RawEthSockPcbFind (ptr_pkt->EtherType, ptr_pkt->hIFRx);
 
     if (!hRawEthSock)
     {