Attention is currently required from: neels, pespin. laforge has uploaded a new patch set (#2) to the change originally created by neels. ( https://gerrit.osmocom.org/c/libgtpnl/+/26990 )
Change subject: fix some cases of rc == 0 on error ......................................................................
fix some cases of rc == 0 on error
When genl_socket_talk() fails, return rc != 0.
While testing the new osmo-upf program, I noticed that I failed to get a "Operation not permitted" error when forgetting to set cap_net_admin on the osmo-upf binary. It looked like everything should work, but doesn't.
It is possible to catch these error cases without this patch, by monitoring errno. That may well be the intention of the API? I'm still submitting this patch because it seems better to return rc != 0.
Here is a code example that also catches all error cases without this patch:
errno = 0; rc = gtp_add_tunnel(genl_id, nl, t); if (errno) { rc = -errno; } else if (rc) { rc = -EINVAL; } else { tun->active = true; } return rc;
Related: SYS#5599 Change-Id: I22fd69709e023572c6c616a4184340a554456faf --- M src/gtp-genl.c 1 file changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libgtpnl refs/changes/90/26990/2