From: Lennart Poettering Date: Thu, 2 Jun 2016 15:48:31 +0000 (+0200) Subject: lldp: make sd_lldp_neighbor_tlv_rewind() return whether there's a first entry X-Git-Tag: v231~207^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a85b46c33f09d62a066231abdf9727e84a3c07cc;p=thirdparty%2Fsystemd.git lldp: make sd_lldp_neighbor_tlv_rewind() return whether there's a first entry This way it's nicer to use as it matches how sd_lldp_neighbor_tlv_next() indicates an EOF too via its return value. --- diff --git a/src/libsystemd-network/lldp-neighbor.c b/src/libsystemd-network/lldp-neighbor.c index 5811e0f2e8b..0ed680eecfb 100644 --- a/src/libsystemd-network/lldp-neighbor.c +++ b/src/libsystemd-network/lldp-neighbor.c @@ -686,7 +686,7 @@ _public_ int sd_lldp_neighbor_tlv_rewind(sd_lldp_neighbor *n) { assert(n->raw_size >= sizeof(struct ether_header)); n->rindex = sizeof(struct ether_header); - return 0; + return n->rindex < n->raw_size; } _public_ int sd_lldp_neighbor_tlv_next(sd_lldp_neighbor *n) {