mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-21 18:40:12 +00:00
Fix netbuf_destport() when LWIP_CHECKSUM_ON_COPY is not enabled
This commit fixes a bug in netbuf_destport() where LWIP_NETBUF_RECVINFO is enabled, but not LWIP_CHECKSUM_ON_COPY is enabled The flags field is only available when LWIP_CHECKSUM_ON_COPY is enabled. In this mode, the toport_chksum is dual functioning as storage for port and checksum
This commit is contained in:
parent
d3217718a9
commit
f77e581468
@ -97,7 +97,11 @@ LWIP_NETCONN_SCOPE void netbuf_first (struct netbuf *buf);
|
||||
#if LWIP_NETBUF_RECVINFO
|
||||
#define netbuf_destaddr(buf) (&((buf)->toaddr))
|
||||
#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr)
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0)
|
||||
#else
|
||||
#define netbuf_destport(buf) ((buf)->toport_chksum)
|
||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
||||
#endif /* LWIP_NETBUF_RECVINFO */
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user