From 2d1fe392f355d7c3b1fd5b5bbaa1f164e755242d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 23 Dec 2012 15:51:48 +0100 Subject: [PATCH] frame: mark with `(void)` when we don't check for result of PEEK/POKE --- src/daemon/cdp.c | 12 ++++++------ src/daemon/edp.c | 4 ++-- src/daemon/lldp.c | 2 +- src/daemon/sonmp.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/daemon/cdp.c b/src/daemon/cdp.c index ebf09c71..29f0a587 100644 --- a/src/daemon/cdp.c +++ b/src/daemon/cdp.c @@ -197,7 +197,7 @@ cdp_send(struct lldpd *global, POKE_BYTES(platform, strlen(platform)) && POKE_END_CDP_TLV)) goto toobig; - POKE_SAVE(end); + (void)POKE_SAVE(end); /* Compute len and checksum */ POKE_RESTORE(pos_len_eh); @@ -353,7 +353,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, } tlv_type = PEEK_UINT16; tlv_len = PEEK_UINT16 - 4; - PEEK_SAVE(tlv); + (void)PEEK_SAVE(tlv); if ((tlv_len < 0) || (length < tlv_len)) { log_warnx("cdp", "incorrect size in CDP/FDP TLV header for frame " "received on %s", @@ -379,7 +379,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, CHECK_TLV_SIZE(4, "Address"); addresses_len = tlv_len - 4; for (nb = PEEK_UINT32; nb > 0; nb--) { - PEEK_SAVE(pos_address); + (void)PEEK_SAVE(pos_address); /* We first try to get the real length of the packet */ if (addresses_len < 2) { log_warn("cdp", "too short address subframe " @@ -405,7 +405,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, goto malformed; } PEEK_DISCARD(address_len); - PEEK_SAVE(pos_next_address); + (void)PEEK_SAVE(pos_next_address); /* Next, we go back and try to extract IPv4 address */ PEEK_RESTORE(pos_address); @@ -468,11 +468,11 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, break; case CDP_TLV_SOFTWARE: software_len = tlv_len; - PEEK_SAVE(software); + (void)PEEK_SAVE(software); break; case CDP_TLV_PLATFORM: platform_len = tlv_len; - PEEK_SAVE(platform); + (void)PEEK_SAVE(platform); break; #ifdef ENABLE_DOT1 case CDP_TLV_NATIVEVLAN: diff --git a/src/daemon/edp.c b/src/daemon/edp.c index 7c54e8e7..e28eef28 100644 --- a/src/daemon/edp.c +++ b/src/daemon/edp.c @@ -286,7 +286,7 @@ edp_decode(struct lldpd *cfg, char *frame, int s, goto malformed; } - PEEK_SAVE(pos_edp); /* Save the start of EDP packet */ + (void)PEEK_SAVE(pos_edp); /* Save the start of EDP packet */ if (PEEK_UINT8 != 1) { log_warnx("edp", "incorrect EDP version for frame received on %s", hardware->h_ifname); @@ -337,7 +337,7 @@ edp_decode(struct lldpd *cfg, char *frame, int s, } tlv_type = PEEK_UINT8; tlv_len = PEEK_UINT16 - 4; - PEEK_SAVE(tlv); + (void)PEEK_SAVE(tlv); if ((tlv_len < 0) || (tlv_len > length)) { log_debug("edp", "incorrect size in EDP TLV header for frame " "received on %s", diff --git a/src/daemon/lldp.c b/src/daemon/lldp.c index 592741ae..7b7eddec 100644 --- a/src/daemon/lldp.c +++ b/src/daemon/lldp.c @@ -542,7 +542,7 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, tlv_size = PEEK_UINT16; tlv_type = tlv_size >> 9; tlv_size = tlv_size & 0x1ff; - PEEK_SAVE(tlv); + (void)PEEK_SAVE(tlv); if (length < tlv_size) { log_warnx("lldp", "frame too short for tlv received on %s", hardware->h_ifname); diff --git a/src/daemon/sonmp.c b/src/daemon/sonmp.c index 79fedf0c..9eb5e060 100644 --- a/src/daemon/sonmp.c +++ b/src/daemon/sonmp.c @@ -259,10 +259,10 @@ sonmp_send(struct lldpd *global, } POKE_RESTORE(pos_pid); /* Modify LLC PID */ - POKE_UINT16(LLC_PID_SONMP_FLATNET); + (void)POKE_UINT16(LLC_PID_SONMP_FLATNET); POKE_RESTORE(packet); /* Go to the beginning */ PEEK_DISCARD(ETH_ALEN - 1); /* Modify the last byte of the MAC address */ - POKE_UINT8(1); + (void)POKE_UINT8(1); if (hardware->h_ops->send(global, hardware, (char *)packet, end - packet) == -1) { -- 2.39.5