[bug #55030] Ethernet SAP stored backwards on Big endian system ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #55030] Ethernet SAP stored backwards on Big endian system ?

Jasper Verschueren
URL:
  <https://savannah.nongnu.org/bugs/?55030>

                 Summary: Ethernet SAP stored backwards on Big endian system ?
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: ivanw
            Submitted on: Thu 15 Nov 2018 03:31:58 PM UTC
                Category: Platform ports
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

On my big endian system, I'm getting the following (for frames sent by LWIP -
in this case the DHCP client) :

LCS : 0000 : 01620100 FFFFFFFF FFFFFA40 4BB43CE8 00084500 50010000 0000FF11
9DBA0000
LCS : 0020 : 0000FFFF FFFF4400 43003C01 DCAC0101 06008127 00000000 00000000
00000000
LCS : 0040 : 00000000 00000000 0000FA40 4BB43CE8 00000000 00000000 00000000
00000000
LCS : 0060 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
LCS : 0080 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
LCS : 00A0 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
LCS : 00C0 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
LCS : 00E0 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
LCS : 0100 : 00000000 00000000 00000000 00000000 00000000 00000000 00006353
82633501
LCS : 0120 : 01390205 DC370401 031C06FF 00000000 00000000 00000000 00000000
00000000
LCS : 0140 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000

(This a is debug dump from my network interface driver... Ignore the 1st 4
bytes, they are for the output hardware).

The problem is : The SAP field (ETH Frame + 12 is inverted ! It should be 0800
(IP), not 0008 - making it a 802.3 Frame of length 8).

I somehow suspect that this field was inverted somewhere, but I cannot make
out where it could happen. (htons and PP_HTONS should be good)




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55030>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55030] Ethernet SAP stored backwards on Big endian system ?

Jasper Verschueren
Follow-up Comment #1, bug #55030 (project lwip):

Issue is not in ethernet_output... By inserting debugging code, it's already
swapped (the last parameter - the ether type is already 0x0008 instead of
0x0800).. Odd enough all the calls seem to indicate a fixed ETHTYPE_IP value
(of 0x0800U).. I'm baffled ;) But I'm looking

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55030>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55030] Ethernet SAP stored backwards on Big endian system ?

Jasper Verschueren
Follow-up Comment #2, bug #55030 (project lwip):

Please close as invalid.. I had forgotten to define BYTE_ORDER in my cc.h !
Sorry for the inconvenience.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55030>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55030] Ethernet SAP stored backwards on Big endian system ?

Jasper Verschueren
Update of bug #55030 (project lwip):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55030>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel