RTOS/PROCESSOR-SDK-AM57X: VLAN support for RAW ethernet sockets on SDK 05.01.00.11
Part Number: PROCESSOR-SDK-AM437X
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;
@@ -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);
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Brandon Green61:
In reply to Alexander Aganichev:
In reply to ToddMullanix:
I removed unused variable ptr_eth_header from the patch above.
I made one more VLAN related patch: according to IEEE 802.1Q, VLAN with tag 0 should not be considered as VLAN tagged packet but rather the regular packet which have priority, so second patch allows to receive VLAN 0 frames without creating VLAN device for the VLAN 0. I.e. the socket on raw device will receive both regular frames and VLAN 0 tagged frames, VLAN packets with tag different from 0 will still be send to the corresponding VLAN devices.
Hi Alexander, Thank you again both for pointing this out and providing a patch! We will review it and decide what to do from there.
The following JIRA has been filed to track this issue: NDK-403 Best, Brandon
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.