diff options
author | Linus Nordberg <linus@nordberg.se> | 2019-04-08 12:05:10 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2019-04-08 12:05:10 +0200 |
commit | 41949a5cc1f9878310f20b6bed3febb4eba14ffb (patch) | |
tree | 2d39b8643a8064596165990c1bff7342c3135d1e /wg-dynamic-server.c | |
parent | add instructions for intalling dependencies (diff) | |
download | wg-dynamic-41949a5cc1f9878310f20b6bed3febb4eba14ffb.tar.xz wg-dynamic-41949a5cc1f9878310f20b6bed3febb4eba14ffb.zip |
Address three issues from review by Tharre
1. print_to_buf() return int
2. print_to_buf() don't fatal() without errno
3. data_attr_cb() don't duplicate
Diffstat (limited to 'wg-dynamic-server.c')
-rw-r--r-- | wg-dynamic-server.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/wg-dynamic-server.c b/wg-dynamic-server.c index fc8098c..29c01d3 100644 --- a/wg-dynamic-server.c +++ b/wg-dynamic-server.c @@ -47,27 +47,6 @@ static void usage() die("usage: %s <wg-interface>\n", progname); } -static int data_attr_cb(const struct nlattr *attr, void *data) -{ - const struct nlattr **tb = data; - int type = mnl_attr_get_type(attr); - - /* skip unsupported attribute in user-space */ - if (mnl_attr_type_valid(attr, IFA_MAX) < 0) - return MNL_CB_OK; - - switch (type) { - case IFA_ADDRESS: - if (mnl_attr_validate(attr, MNL_TYPE_BINARY) < 0) { - perror("mnl_attr_validate"); - return MNL_CB_ERROR; - } - break; - } - tb[type] = attr; - return MNL_CB_OK; -} - static int data_cb(const struct nlmsghdr *nlh, void *data) { struct nlattr *tb[IFA_MAX + 1] = {}; |