lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Problems with receiving UDP-checksum fails


From: ake . forslund
Subject: Re: [lwip-users] Problems with receiving UDP-checksum fails
Date: Tue, 14 Jun 2011 13:15:39 +0200

Small update:

When disabling checksum with

#define CHECKSUM_CHECK_UDP 0

it still won't work, now the transaction ID is mismatched:

transaction id mismatch reply_msg->xid(abcd0600)!=dhcp->xid(abcd0001)

In the recieved message the ab cd part is preceded by 0600, it could be that my  endianess is wrong? or the buffer pointer is off by one 2 bytes...this doesn't seem true since the byte order would be wrong too.



For reference my endianess related parts from cc.h:

/* Define platform endianness */
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* BYTE_ORDER */

#define LWIP_PLATFORM_BYTESWAP 1
#define LWIP_PLATFORM_HTONS(x) ( (((u16_t)(x))>>8)  | (((x)&0xFF)<<8) )
#define LWIP_PLATFORM_HTONL(x) ( (((u32_t)(x))>>24) | (((x)&0xFF0000)>>8) | (((x)&0xFF00)<<8)  | (((x)&0xFF)<<24) )


When I checked cc.h I rememberd that I disabled packing since the keil-compiler threw a massive number of errors at me when I tried to use these, this might be an error source as well.

Regards
/Åke

-----------------------------
Åke Forslund
0433-273296
NIBE AB
Box 14
S-285 21  Markaryd
Tel +46-(0)433-273296



From: address@hidden
To: address@hidden
Date: 2011-06-14 10:03
Subject: [lwip-users] Problems with receiving UDP-checksum fails
Sent by: address@hidden





Hello again,

I've started working with the driver for my ethernet-controller (Microchip ENC424J600) and gotten it to transmit and receive data using the interface in lwip. I've started to test this out on DHCP and have thus run into some problems. The DHCP discover-message is sent and in return an DHCP-offer is sent (and recieved in my platform). When checking the trace (excerpt below) I'm informed that the UDP-datagram is discarded due to failing checksum. I've verified the recieved package with the transmitted data using wireshark and diff and the recieved package is identical to the sent package.


So my questions are: Where should I look for the problem? Could it be some endianess- problem? How do I verify the UDP-checksum calculated by lwip?

Another question: should FCS be stripped by the low_level_input()-function or should it be saved for the handling functions?


I'm on an ARM-platform using lwip 1.4.0


Thanks for any help


Best Regards

/Åke




currPkg Len: 0x15a

nextpkg @ 0x59a8

00 04 a3 1e 0b 08 00 16 a6 10 83 c2 08 00 45 00
01 48 30 db 00 00 40 11 c7 5d c0 a8 00 01 c0 a8
00 1b 00 43 00 44 01 34 18 ad 02 01 06 00 ab cd
00 01 00 00 00 00 00 00 00 00 c0 a8 00 1b c0 a8
00 01 00 00 00 00 00 04 a3 1e 0b 08 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 63 82 53 63 35 01 02 36 04 c0
a8 00 01 33 04 00 00 a8 c0 3a 04 00 00 54 60 3b
04 00 00 93 a8 01 04 ff ff ff 00 1c 04 c0 a8 00
ff 03 04 c0 a8 00 01 06 04 c0 a8 00 01 ff 00 00
00 00 00 00 00 00
tcpip_thread: PACKET 203b7670

udp_input: received datagram of length 308

UDP header:

+-------------------------------+

|        67     |        68     | (src port, dest port)

+-------------------------------+

|       308     |     0x18ad    | (len, chksum)

+-------------------------------+

udp (192.168.0.27, 68) <-- (192.168.0.1, 67)

udp_input: calculating checksum

udp_input: UDP datagram discarded due to failing checksum


-----------------------------
Åke Forslund
0433-273296
NIBE AB
Box 14
S-285 21  Markaryd
Tel +46-(0)433-273296
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]