From bcf8684c9ec90fe0d283a67d1654d05fb3eae019 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 2 Sep 2018 19:25:32 -0600 Subject: tools: ipc: do not warn on unrecognized netlink attributes It makes extending things more difficult. --- src/tools/ipc.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src') diff --git a/src/tools/ipc.c b/src/tools/ipc.c index e29a939..06590e2 100644 --- a/src/tools/ipc.c +++ b/src/tools/ipc.c @@ -95,15 +95,6 @@ static int add_next_to_inflatable_buffer(struct inflatable_buffer *buffer) return 0; } -static void warn_unrecognized(const char *which) -{ - static bool once = false; - if (once) - return; - once = true; - fprintf(stderr, "Warning: one or more unrecognized %s attributes\n", which); -} - static FILE *userspace_interface_file(const char *interface) { struct stat sbuf; @@ -438,8 +429,6 @@ static int userspace_get_device(struct wgdevice **out, const char *interface) peer->tx_bytes = NUM(0xffffffffffffffffULL); else if (!strcmp(key, "errno")) ret = -NUM(0x7fffffffU); - else - warn_unrecognized("daemon"); } ret = -EPROTO; err: @@ -711,8 +700,6 @@ static int parse_allowedip(const struct nlattr *attr, void *data) if (!mnl_attr_validate(attr, MNL_TYPE_U8)) allowedip->cidr = mnl_attr_get_u8(attr); break; - default: - warn_unrecognized("netlink"); } return MNL_CB_OK; @@ -792,8 +779,6 @@ static int parse_peer(const struct nlattr *attr, void *data) break; case WGPEER_A_ALLOWEDIPS: return mnl_attr_parse_nested(attr, parse_allowedips, peer); - default: - warn_unrecognized("netlink"); } return MNL_CB_OK; @@ -862,8 +847,6 @@ static int parse_device(const struct nlattr *attr, void *data) break; case WGDEVICE_A_PEERS: return mnl_attr_parse_nested(attr, parse_peers, device); - default: - warn_unrecognized("netlink"); } return MNL_CB_OK; -- cgit v1.2.3-59-g8ed1b