laforge submitted this change.
cups_client: Log error decoding EUA
Change-Id: I98c7841da0f2662291aab5180f6113cb5fca4867
---
M daemon/cups_client.c
1 file changed, 9 insertions(+), 3 deletions(-)
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;
}
To view, visit change 42454. To unsubscribe, or for help writing mail filters, visit settings.