mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
Some macro's were not surrounded by brackets. Was dangerous when nesting macro's.
This commit is contained in:
parent
304dc9fd07
commit
bb0194cc0c
@ -98,7 +98,7 @@ PACK_STRUCT_END
|
||||
|
||||
#define IPH_V(hdr) (NTOHS((hdr)->_v_hl_tos) >> 12)
|
||||
#define IPH_HL(hdr) ((NTOHS((hdr)->_v_hl_tos) >> 8) & 0x0f)
|
||||
#define IPH_TOS(hdr) HTONS((NTOHS((hdr)->_v_hl_tos) & 0xff))
|
||||
#define IPH_TOS(hdr) (HTONS((NTOHS((hdr)->_v_hl_tos) & 0xff)))
|
||||
#define IPH_LEN(hdr) ((hdr)->_len)
|
||||
#define IPH_ID(hdr) ((hdr)->_id)
|
||||
#define IPH_OFFSET(hdr) ((hdr)->_offset)
|
||||
@ -106,12 +106,12 @@ PACK_STRUCT_END
|
||||
#define IPH_PROTO(hdr) (NTOHS((hdr)->_ttl_proto) & 0xff)
|
||||
#define IPH_CHKSUM(hdr) ((hdr)->_chksum)
|
||||
|
||||
#define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = HTONS(((v) << 12) | ((hl) << 8) | (tos))
|
||||
#define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (HTONS(((v) << 12) | ((hl) << 8) | (tos)))
|
||||
#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
|
||||
#define IPH_ID_SET(hdr, id) (hdr)->_id = (id)
|
||||
#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off)
|
||||
#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = HTONS(IPH_PROTO(hdr) | ((ttl) << 8))
|
||||
#define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = HTONS((proto) | (IPH_TTL(hdr) << 8))
|
||||
#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (HTONS(IPH_PROTO(hdr) | ((ttl) << 8)))
|
||||
#define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = (HTONS((proto) | (IPH_TTL(hdr) << 8)))
|
||||
#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user