summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-02 02:51:57 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-02 02:51:57 +0200
commita2cc976a3b572cf308cc2d97c080eacac60416fe (patch)
treee75ee54e62baa84bbc84ea9773de19f140d36fec
parentratelimiter: wait for destruction, not for read_unlock (diff)
downloadwireguard-monolithic-historical-a2cc976a3b572cf308cc2d97c080eacac60416fe.tar.xz
wireguard-monolithic-historical-a2cc976a3b572cf308cc2d97c080eacac60416fe.zip
tools: do not warn on unrecognized items
Upstream advice is to simply be silent.
-rw-r--r--src/tools/containers.h1
-rw-r--r--src/tools/ipc.c25
2 files changed, 0 insertions, 26 deletions
diff --git a/src/tools/containers.h b/src/tools/containers.h
index b9c85e0..7ce09a9 100644
--- a/src/tools/containers.h
+++ b/src/tools/containers.h
@@ -63,7 +63,6 @@ enum {
struct wgdevice {
char name[IFNAMSIZ];
- uint32_t ifindex;
uint32_t flags;
diff --git a/src/tools/ipc.c b/src/tools/ipc.c
index 8f86eb0..ceeb847 100644
--- a/src/tools/ipc.c
+++ b/src/tools/ipc.c
@@ -85,19 +85,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: this program received from your %s one or more\n"
- "attributes that it did not recognize. It is possible that\n"
- "this version of wg(8) is older than your %s. You may\n"
- "want to update this program.\n", which, which);
-}
-
static FILE *userspace_interface_file(const char *interface)
{
struct stat sbuf;
@@ -428,8 +415,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:
@@ -701,8 +686,6 @@ static int parse_allowedip(const struct nlattr *attr, void *data)
if (!mnl_attr_validate(attr, MNL_TYPE_U8))
ctx->allowedip->cidr = mnl_attr_get_u8(attr);
break;
- default:
- warn_unrecognized("kernel");
}
return MNL_CB_OK;
@@ -772,8 +755,6 @@ static int parse_peer(const struct nlattr *attr, void *data)
break;
case WGPEER_A_ALLOWEDIPS:
return mnl_attr_parse_nested(attr, parse_allowedips, ctx);
- default:
- warn_unrecognized("kernel");
}
return MNL_CB_OK;
@@ -807,10 +788,6 @@ static int parse_device(const struct nlattr *attr, void *data)
struct get_device_ctx *ctx = data;
switch (mnl_attr_get_type(attr)) {
- case WGDEVICE_A_IFINDEX:
- if (!mnl_attr_validate(attr, MNL_TYPE_U32))
- ctx->device->ifindex = mnl_attr_get_u32(attr);
- break;
case WGDEVICE_A_IFNAME:
if (!mnl_attr_validate(attr, MNL_TYPE_STRING))
strncpy(ctx->device->name, mnl_attr_get_str(attr), sizeof(ctx->device->name) - 1);
@@ -833,8 +810,6 @@ static int parse_device(const struct nlattr *attr, void *data)
break;
case WGDEVICE_A_PEERS:
return mnl_attr_parse_nested(attr, parse_peers, ctx);
- default:
- warn_unrecognized("kernel");
}
return MNL_CB_OK;