summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-02 17:48:31 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-06 19:59:08 +0200
commita85b46c33f09d62a066231abdf9727e84a3c07cc (patch)
tree515f161324b4472af1a41562115904f5b25aff9b /src/libsystemd-network
parenta2966471d815a965e2f4b86cdad30c8086c1ec6d (diff)
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.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/lldp-neighbor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/lldp-neighbor.c b/src/libsystemd-network/lldp-neighbor.c
index 5811e0f2e8..0ed680eecf 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) {