You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
this keep
family_transport
withNGX_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:
this definition allow to work with
ver/cmd/af/type
without bit hacks in code.The text was updated successfully, but these errors were encountered: