pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-uecups/+/42454?usp=email )
Change subject: cups_client: Log error decoding EUA ......................................................................
cups_client: Log error decoding EUA
Change-Id: I98c7841da0f2662291aab5180f6113cb5fca4867 --- M daemon/cups_client.c 1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-uecups refs/changes/54/42454/1
diff --git a/daemon/cups_client.c b/daemon/cups_client.c index 578719b..acadcd5 100644 --- a/daemon/cups_client.c +++ b/daemon/cups_client.c @@ -188,18 +188,24 @@
if (!strcmp(addr_type, "IPV4")) { struct sockaddr_in *sin = &out->u.sin; - if (osmo_hexparse(ip, buf, sizeof(buf)) != 4) + if (osmo_hexparse(ip, buf, sizeof(buf)) != 4) { + LOGP(DUECUPS, LOGL_NOTICE, "Failed parsing EUA %s type %s\n", ip, addr_type); return -EINVAL; + } memcpy(&sin->sin_addr, buf, 4); sin->sin_family = AF_INET; } else if (!strcmp(addr_type, "IPV6")) { struct sockaddr_in6 *sin6 = &out->u.sin6; - if (osmo_hexparse(ip, buf, sizeof(buf)) != 16) + if (osmo_hexparse(ip, buf, sizeof(buf)) != 16) { + LOGP(DUECUPS, LOGL_NOTICE, "Failed parsing EUA %s type %s\n", ip, addr_type); return -EINVAL; + } memcpy(&sin6->sin6_addr, buf, 16); sin6->sin6_family = AF_INET6; - } else + } else { + LOGP(DUECUPS, LOGL_NOTICE, "Unknown EUA type %s\n", addr_type); return -EINVAL; + }
return 0; }