aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-07 05:36:26 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-07 06:07:35 +0100
commit9e0365179ea9f8c2e9db85b231682980a0acbbd2 (patch)
treed0544f03b9ec0b943a1412f676fb5514d156a0f1
parentcompat: don't undef BUILD_BUG_ON for Clang >=8 (diff)
downloadWireGuard-9e0365179ea9f8c2e9db85b231682980a0acbbd2.tar.xz
WireGuard-9e0365179ea9f8c2e9db85b231682980a0acbbd2.zip
embeddable-wg-library: do not warn on unrecognized netlink attributes
This is a follow up of bcf8684c9ec90fe0d283a67d1654d05fb3eae019.
-rw-r--r--contrib/examples/embeddable-wg-library/wireguard.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/contrib/examples/embeddable-wg-library/wireguard.c b/contrib/examples/embeddable-wg-library/wireguard.c
index f0bdb5f0..370b3dae 100644
--- a/contrib/examples/embeddable-wg-library/wireguard.c
+++ b/contrib/examples/embeddable-wg-library/wireguard.c
@@ -66,6 +66,7 @@ enum wgpeer_attribute {
WGPEER_A_RX_BYTES,
WGPEER_A_TX_BYTES,
WGPEER_A_ALLOWEDIPS,
+ WGPEER_A_PROTOCOL_VERSION,
__WGPEER_A_LAST
};
@@ -903,15 +904,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 int parse_linkinfo(const struct nlattr *attr, void *data)
{
struct inflatable_buffer *buffer = data;
@@ -1233,8 +1225,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;
@@ -1326,8 +1316,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;
@@ -1396,8 +1384,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;