-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
+unspec:
+ header->family_transport |= NGX_PROXY_PROTOCOL_V2_FAM_UNSPEC;
+ header->len = 0;
this keep family_transport
with NGX_PROXY_PROTOCOL_V2_TRANS_STREAM
set.
Also NGX_PROXY_PROTOCOL_V2_FAM_UNSPEC = 0
so this code does nothing.
header->family_transport &= ~NGX_PROXY_PROTOCOL_V2_FAM_MASK;
- usually this way used to unset some bits.
I do expect that family_transport = 0
, to set both: family and transport to unspec at same time to not confuse parser code.
PS:
typedef struct proxy_protocol_v2_hdr_s {
uint8_t sig[12];/* signature hex: 0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a */
uint8_t cmd:4; /* Command. */
uint8_t ver:4; /* Protocol version. */
uint8_t type:4; /* Transport protocol type. */
uint8_t af:4; /* Protocol Address family. */
uint16_t len; /* Number of following bytes part of the header in network endian order. */
} __attribute__((__packed__)) pp2_hdr_t, *pp2_hdr_p;
this definition allow to work with ver/cmd/af/type
without bit hacks in code.
Metadata
Metadata
Assignees
Labels
No labels