The hostent parameter is supposed to be const. This is being enforced in c-ares 1.34.7, which is why osmo-sgsn currently fails to build in debian unstable. The c-ares developers are preparing a new release that reverts this change to avoid breakage with other users of libc-ares, and only document that this should basically be const. But let's use the API as intended so the compiler knows that osmo-sgsn is not supposed to modify the hostent parameter.
Fix for:
sgsn_ares.c:141:63: error: passing argument 4 of 'ares_gethostbyname' from incompatible pointer type [-Wincompatible-pointer-types] 141 | ares_gethostbyname(sgsn->ares_channel, name, AF_INET, ares_cb, cb_data); | ^~~~~~~ | | | void (*)(void *, int, int, struct hostent *) /usr/include/ares.h:881:22: note: expected 'ares_host_callback' {aka 'void (*)(void *, int, int, const struct hostent *)'} but argument is of type 'void (*)(void *, int, int, struct hostent *)'