diff options
Diffstat (limited to 'src/libsystemd-network/lldp-neighbor.c')
-rw-r--r-- | src/libsystemd-network/lldp-neighbor.c | 7 |
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) { |