]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
frame: mark with `(void)` when we don't check for result of PEEK/POKE
authorVincent Bernat <bernat@luffy.cx>
Sun, 23 Dec 2012 14:51:48 +0000 (15:51 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 23 Dec 2012 14:51:48 +0000 (15:51 +0100)
src/daemon/cdp.c
src/daemon/edp.c
src/daemon/lldp.c
src/daemon/sonmp.c

index ebf09c714bf2f14f814635e0d45c76b0e4973dfd..29f0a5876beaec9209fcdc75f1bf28bcc87f65ff 100644 (file)
@@ -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:
index 7c54e8e756d0a0ce01848cd8b8a18bbe1d791485..e28eef28a4033a4d19fcf5823c3928a9fd4dc1f8 100644 (file)
@@ -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",
index 592741ae7772b84773d73679f61c0f607091d9f2..7b7eddec44ba06a1aeb4e976b8f7b9da5fed2441 100644 (file)
@@ -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);
index 79fedf0c2f65c56b7f8e0f0c509d2a088b5c3fd4..9eb5e0609faf9c2d69eeb4f1f3e2c0e5adf23cc6 100644 (file)
@@ -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) {