From: David Lamparter Date: Wed, 4 Mar 2015 05:44:57 +0000 (+0100) Subject: snmp: fix warnings X-Git-Tag: frr-2.0-rc1~745 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7e6350359a16036e225373f10721dfdb903ed202;p=mirror%2Ffrr.git snmp: fix warnings batch-fix all warnings that come up when enabling AgentX SNMP support. Signed-off-by: David Lamparter (cherry picked from commit dfee58f1d41a2e36c7f5f38a3ef5712224131824) --- diff --git a/lib/smux.h b/lib/smux.h index 72b4eaf099..45e84eead2 100644 --- a/lib/smux.h +++ b/lib/smux.h @@ -53,8 +53,8 @@ struct trap_object /* Declare SMUX return value. */ #define SNMP_LOCAL_VARIABLES \ - static long snmp_int_val; \ - static struct in_addr snmp_in_addr_val; + static long snmp_int_val __attribute__ ((unused)); \ + static struct in_addr snmp_in_addr_val __attribute__ ((unused)); #define SNMP_INTEGER(V) \ ( \ @@ -106,7 +106,7 @@ extern int smux_trap (struct variable *, size_t, const struct trap_object *, size_t, u_char); -extern int oid_compare (oid *, int, oid *, int); +extern int oid_compare (const oid *, int, const oid *, int); extern void oid2in_addr (oid [], int, struct in_addr *); extern void *oid_copy (void *, const void *, size_t); extern void oid_copy_addr (oid [], struct in_addr *, int); diff --git a/lib/snmp.c b/lib/snmp.c index 79595a1ea2..f6f9845e2d 100644 --- a/lib/snmp.c +++ b/lib/snmp.c @@ -30,7 +30,7 @@ #define min(A,B) ((A) < (B) ? (A) : (B)) int -oid_compare (oid *o1, int o1_len, oid *o2, int o2_len) +oid_compare (const oid *o1, int o1_len, const oid *o2, int o2_len) { int i; diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 4be8be04b1..42432d7133 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -626,7 +626,6 @@ ospfv3WwLsdbEntry (struct variable *v, oid *name, size_t *length, int len; oid *offset; int offsetlen; - char a[16], b[16], c[16]; struct ospf6_area *oa; struct listnode *node; struct interface *iif; diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 7f7b157860..9f91776944 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -986,7 +986,7 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, offsetlen = *length - v->namelen; len = offsetlen; - if (len > IN_ADDR_SIZE) + if (len > (int)IN_ADDR_SIZE) len = IN_ADDR_SIZE; oid2in_addr (offset, len, area_id); @@ -1026,7 +1026,7 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, else { ls_id_next = 0; - if (len > IN_ADDR_SIZE) + if (len > (int)IN_ADDR_SIZE) len = IN_ADDR_SIZE; oid2in_addr (offset, len, ls_id); @@ -1042,7 +1042,7 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, else { router_id_next = 0; - if (len > IN_ADDR_SIZE) + if (len > (int)IN_ADDR_SIZE) len = IN_ADDR_SIZE; oid2in_addr (offset, len, router_id); @@ -1152,7 +1152,7 @@ ospfAreaRangeLookup (struct variable *v, oid *name, size_t *length, { oid *offset; int offsetlen; - unsigned int len; + int len; struct ospf *ospf; struct ospf_area *area; struct ospf_area_range *range; @@ -1193,7 +1193,7 @@ ospfAreaRangeLookup (struct variable *v, oid *name, size_t *length, offsetlen = *length - v->namelen; len = offsetlen; - if (len > IN_ADDR_SIZE) + if (len > (int)IN_ADDR_SIZE) len = IN_ADDR_SIZE; oid2in_addr (offset, len, area_id); @@ -1215,7 +1215,7 @@ ospfAreaRangeLookup (struct variable *v, oid *name, size_t *length, if (len < 0) len = 0; - if (len > IN_ADDR_SIZE) + if (len > (int)IN_ADDR_SIZE) len = IN_ADDR_SIZE; oid2in_addr (offset, len, range_net); diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c index 9d4e60dbb1..4b7d1b4c50 100644 --- a/ripd/rip_snmp.c +++ b/ripd/rip_snmp.c @@ -295,7 +295,7 @@ rip2PeerLookup (struct variable *v, oid name[], size_t *length, peer = rip_peer_lookup (addr); - if (peer->domain == name[v->namelen + sizeof (struct in_addr)]) + if (peer->domain == (int)name[v->namelen + sizeof (struct in_addr)]) return peer; return NULL; @@ -311,8 +311,8 @@ rip2PeerLookup (struct variable *v, oid name[], size_t *length, peer = rip_peer_lookup (addr); if (peer) { - if ((len < sizeof (struct in_addr) + 1) || - (peer->domain > name[v->namelen + sizeof (struct in_addr)])) + if ((len < (int)sizeof (struct in_addr) + 1) || + (peer->domain > (int)name[v->namelen + sizeof (struct in_addr)])) { oid_copy_addr (name + v->namelen, &peer->addr, sizeof (struct in_addr));