mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
res_pjproject: Fix DTLS client check failing on some platforms
Certain platforms (mainly BSD derivatives) have an additional length field in `sockaddr_in6` and `sockaddr_in`. `ast_sockaddr_from_pj_sockaddr()` does not take this field into account when copying over values from the `pj_sockaddr` into the `ast_sockaddr`. The resulting `ast_sockaddr` will have an uninitialized value for `sin6_len`/`sin_len` while the other `ast_sockaddr` (not converted from a `pj_sockaddr`) to check against in `ast_sockaddr_pj_sockaddr_cmp()` has the correct length value set. This has the effect that `ast_sockaddr_cmp()` will always indicate an address mismatch, because it does a bitwise comparison, and all DTLS packets are dropped even if addresses and ports match. `ast_sockaddr_from_pj_sockaddr()` now checks whether the length fields are available on the current platform and sets the values accordingly. Resolves: #505
This commit is contained in:
committed by
github-actions[bot]
parent
f302c116b4
commit
a9cd7f9b8d
@@ -1055,6 +1055,12 @@
|
||||
/* Define to 1 if 'ifr_ifru.ifru_hwaddr' is a member of 'struct ifreq'. */
|
||||
#undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
|
||||
|
||||
/* Define to 1 if 'sin6_len' is a member of 'struct sockaddr_in6'. */
|
||||
#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
|
||||
|
||||
/* Define to 1 if 'sin_len' is a member of 'struct sockaddr_in'. */
|
||||
#undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
||||
|
||||
/* Define to 1 if 'uid' is a member of 'struct sockpeercred'. */
|
||||
#undef HAVE_STRUCT_SOCKPEERCRED_UID
|
||||
|
||||
|
Reference in New Issue
Block a user