Open Dorian1982 opened 4 years ago
PfcpFTeid struct:
typedef struct _PfcpFTeid { ENDIAN5(uint8_t spare:4;, uint8_t chid:1;, uint8_t ch:1;, uint8_t v6:1;, uint8_t v4:1;) uint32_t teid; union { union { / GTP_F_TEID_IPV4 / struct in_addr addr4; / GTP_F_TEID_IPV6 / struct in6_addr addr6; / GTP_F_TEID_BOTH / struct { struct in_addr addr4; struct in6_addr addr6; } dualStack; }; uint8_t chooseId; }; } attribute ((packed)) PfcpFTeid;
It should be like this:
typedef struct _PfcpFTeid { ENDIAN5(uint8_t spare:4;, uint8_t chid:1;, uint8_t ch:1;, uint8_t v6:1;, uint8_t v4:1;) union { struct { uint32_t teid; union { / GTP_F_TEID_IPV4 / struct in_addr addr4; / GTP_F_TEID_IPV6 / struct in6_addr addr6; / GTP_F_TEID_BOTH / struct { struct in_addr addr4; struct in6_addr addr6; } dualStack; }; } channel; uint8_t chooseId; }; } attribute ((packed)) PfcpFTeid;
Because from the standard, teid may be not present in case of chooseId is present.
PfcpFTeid struct:
typedef struct _PfcpFTeid { ENDIAN5(uint8_t spare:4;, uint8_t chid:1;, uint8_t ch:1;, uint8_t v6:1;, uint8_t v4:1;) uint32_t teid; union { union { / GTP_F_TEID_IPV4 / struct in_addr addr4; / GTP_F_TEID_IPV6 / struct in6_addr addr6; / GTP_F_TEID_BOTH / struct { struct in_addr addr4; struct in6_addr addr6; } dualStack; }; uint8_t chooseId; }; } attribute ((packed)) PfcpFTeid;
It should be like this:
typedef struct _PfcpFTeid { ENDIAN5(uint8_t spare:4;, uint8_t chid:1;, uint8_t ch:1;, uint8_t v6:1;, uint8_t v4:1;) union { struct { uint32_t teid; union { / GTP_F_TEID_IPV4 / struct in_addr addr4; / GTP_F_TEID_IPV6 / struct in6_addr addr6; / GTP_F_TEID_BOTH / struct { struct in_addr addr4; struct in6_addr addr6; } dualStack; }; } channel; uint8_t chooseId; }; } attribute ((packed)) PfcpFTeid;
Because from the standard, teid may be not present in case of chooseId is present.