mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 23:52:51 +00:00
remove bogus LWIP_MAKE_U16() define and use PP_NTOHS() in ip4.c instead
This commit is contained in:
parent
c87855423c
commit
b31b0c8148
@ -863,7 +863,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
|
|||||||
IPH_TTL_SET(iphdr, ttl);
|
IPH_TTL_SET(iphdr, ttl);
|
||||||
IPH_PROTO_SET(iphdr, proto);
|
IPH_PROTO_SET(iphdr, proto);
|
||||||
#if CHECKSUM_GEN_IP_INLINE
|
#if CHECKSUM_GEN_IP_INLINE
|
||||||
chk_sum += LWIP_MAKE_U16(proto, ttl);
|
chk_sum += PP_NTOHS(proto | (ttl << 8));
|
||||||
#endif /* CHECKSUM_GEN_IP_INLINE */
|
#endif /* CHECKSUM_GEN_IP_INLINE */
|
||||||
|
|
||||||
/* dest cannot be NULL here */
|
/* dest cannot be NULL here */
|
||||||
@ -876,7 +876,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
|
|||||||
IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
|
IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
|
||||||
IPH_TOS_SET(iphdr, tos);
|
IPH_TOS_SET(iphdr, tos);
|
||||||
#if CHECKSUM_GEN_IP_INLINE
|
#if CHECKSUM_GEN_IP_INLINE
|
||||||
chk_sum += LWIP_MAKE_U16(tos, iphdr->_v_hl);
|
chk_sum += PP_NTOHS(tos | (iphdr->_v_hl << 8));
|
||||||
#endif /* CHECKSUM_GEN_IP_INLINE */
|
#endif /* CHECKSUM_GEN_IP_INLINE */
|
||||||
IPH_LEN_SET(iphdr, lwip_htons(p->tot_len));
|
IPH_LEN_SET(iphdr, lwip_htons(p->tot_len));
|
||||||
#if CHECKSUM_GEN_IP_INLINE
|
#if CHECKSUM_GEN_IP_INLINE
|
||||||
|
@ -65,13 +65,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Endianess-optimized shifting of two u8_t to create one u16_t */
|
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
|
||||||
#define LWIP_MAKE_U16(a, b) ((a << 8) | b)
|
|
||||||
#else
|
|
||||||
#define LWIP_MAKE_U16(a, b) ((b << 8) | a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
#define lwip_htons(x) (x)
|
#define lwip_htons(x) (x)
|
||||||
#define lwip_ntohs(x) (x)
|
#define lwip_ntohs(x) (x)
|
||||||
|
Loading…
Reference in New Issue
Block a user