osmo_io: Rewrite iofd_handle_send_completion() to fix multiple issues
Previous implementation had multiple issues, which this patch addresses: * Didn't call user cb updating completed bytes for a given msg which had a partial write. * rc checks against "Incomplete write" were wrong, because rc was not being decremented with previous msgs idxs being processed. * Didn't take into account the write(0, fd, buf) = 0 valid user case for regular files.
The rewrite also simplifies the logic by splitting the "rc < 0" (error) paths from the "rc >= 0" (successful) paths.
osmo_io: Fix msgb memleak if iofd is unregistered during write_cb with >1 io buffers
The msgbs are not allocated under the msghdr, hence if user unregistered the iofd we need to manually free all remaining msgbs when freeing the msghdr.
gsup: encode_pdp_info(): fix wrong pdp_address index
The `PDP_TYPE_N_IETF_IPv4v6` case encodes two addresses: IPv4 from `pdp_address[0]` and IPv6 from `pdp_address[1]`. The IPv4 part is encoded correctly, but the IPv6 part checks the wrong index.
The decoder decode_pdp_address() correctly puts the IPv4 address in `pdp_address[0]` and the IPv6 address in `pdp_address[1]`. Because `pdp_address[0].sa_family` is `AF_INET` (not `AF_INET6`), the second condition is always false in a proper dual-stack context, so the IPv6 part is silently dropped from every outgoing dual-stack GSUP message.
`addrinfo_helper()` internally calls `getaddrinfo()`, whose result must be freed with `freeaddrinfo()`. On the size-check error path the function returns early without freeing. Fix this.
While exploring why logging is disabled but still shows up in the binaries I kind of wondered how all the config.h HAVE_XX checks we have everwhere work. Apparently they do not work at all, due to missing or misplaced include of config.h.
This affects tons of other checks as well.
The jenkins hook ensures the include order is checked to ensure config.h does not get misplaced or lost in the future.
Before 9197c1ac, the AC_ARG_ENABLE(log_macros, ...) action was hardcoded to [log_macros="yes"], so *any* use of the flag --enable-log-macros or --disable-log-macros would set log_macros="yes" -> AC_DEFINE([LIBOSMOCORE_NO_LOGGING]).
The commit changed this to the standard [log_macros=$enableval], but broke the conditional test, so - AC_ARG_ENABLE sets $enableval to "no" for --disable-* flags -> log_macros is now "no" -> test fails -> LIBOSMOCORE_NO_LOGGING is never defined...
gsm0808: fix wrong codec defaults for OFR_AMR_WB 3GPP TS 48.008 chapter 3.2.2.103 states that the configuration bits of OFR_AMR_WB are coded as follows: "S0, S2, S4 indicates the supported Codec Configurations. S1, S3, S5, S6, S7 are reserved and coded with zeroes." The current default setting of 0x3F violates this requirement. Lets set the "forbidden" settings zu zero and keep only the allowed ones. Change-Id: I4a481def59e9c98cfdcafc2b80c0ac7df0c14130
gsm0808: add function to convert amr gsm0408 setings to gsm0808 Add a function to convert struct gsm48_multi_rate_conf, which holds the codec settings for AMR, to S0-S15 bit representation as defined in 3GPP TS 48.008 3.2.2.49 Change-Id: I4e656731b16621736c7a2f4e64d9ce63b1064e98 Related: OS#3548