summaryrefslogtreecommitdiff
path: root/src/libsystemd-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/libsystemd-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/libsystemd-network')
-rw-r--r--src/libsystemd-network/lldp-neighbor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsystemd-network/lldp-neighbor.c b/src/libsystemd-network/lldp-neighbor.c
index c61941cd70..190c9baece 100644
--- a/src/libsystemd-network/lldp-neighbor.c
+++ b/src/libsystemd-network/lldp-neighbor.c
@@ -446,7 +446,7 @@ static int format_mac_address(const void *data, size_t sz, char **ret) {
static int format_network_address(const void *data, size_t sz, char **ret) {
union in_addr_union a;
- int family;
+ int family, r;
if (sz == 6 && ((uint8_t*) data)[1] == 1) {
memcpy(&a.in, (uint8_t*) data + 2, sizeof(a.in));
@@ -457,7 +457,10 @@ static int format_network_address(const void *data, size_t sz, char **ret) {
} else
return 0;
- return in_addr_to_string(family, &a, ret);
+ r = in_addr_to_string(family, &a, ret);
+ if (r < 0)
+ return r;
+ return 1;
}
_public_ int sd_lldp_neighbor_get_chassis_id_as_string(sd_lldp_neighbor *n, const char **ret) {