summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
commitbd7e03af007c4e857ed0370eba9e903d6b561937 (patch)
tree23b7f66162ff1a45d29c5a03fe74c381ffec0ef3 /src/network
parent280d397ab313b647fbd824d1cb58eb8323c74501 (diff)
parent58015d7815bce405c7c0ac082d8c2f407ec07eeb (diff)
Merge pull request #2755 from keszybz/more-tests
Enable more tests by default, and even more with `--enable-tests=unsafe`
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 0679114f74..6ec7a911ca 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -45,6 +45,7 @@
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
+#include "strxcpyx.h"
#include "terminal-util.h"
#include "util.h"
#include "verbs.h"
@@ -147,7 +148,6 @@ static int link_info_compare(const void *a, const void *b) {
}
static int decode_link(sd_netlink_message *m, LinkInfo *info) {
- static const struct ether_addr null_address = {};
const char *name;
uint16_t type;
int r;
@@ -174,11 +174,11 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info) {
if (r < 0)
return r;
- strncpy(info->name, name, sizeof(info->name));
+ strscpy(info->name, sizeof info->name, name);
info->has_mac_address =
sd_netlink_message_read_ether_addr(m, IFLA_ADDRESS, &info->mac_address) >= 0 &&
- memcmp(&info->mac_address, &null_address, sizeof(struct ether_addr)) != 0;
+ memcmp(&info->mac_address, &ETHER_ADDR_NULL, sizeof(struct ether_addr)) != 0;
info->has_mtu =
sd_netlink_message_read_u32(m, IFLA_MTU, &info->mtu) &&