Clang is finding a new set of problems. Fix them. Signed-off-by: Donald Sharp <sha...@cumulusnetworks.com> --- bgpd/bgp_attr.c | 4 ++-- bgpd/bgpd.h | 1 + lib/vty.c | 2 +- zebra/rt_netlink.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index f34e649..a9ecae6 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -1870,8 +1870,8 @@ bgp_attr_encap( } while (length >= 4) { - uint16_t subtype; - uint16_t sublength; + uint16_t subtype = BGP_ATTR_UNKNOWN; + uint16_t sublength = 0; struct bgp_attr_encap_subtlv *tlv; if (BGP_ATTR_ENCAP == type) { diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 7665d9d..531d047 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -627,6 +627,7 @@ struct bgp_nlri #define BGP_OPEN_OPT_CAP 2 /* BGP4 attribute type codes. */ +#define BGP_ATTR_UNKNOWN 0 #define BGP_ATTR_ORIGIN 1 #define BGP_ATTR_AS_PATH 2 #define BGP_ATTR_NEXT_HOP 3 diff --git a/lib/vty.c b/lib/vty.c index e4510f8..aafa271 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -423,7 +423,7 @@ vty_command (struct vty *vty, char *buf) snprintf(vty_str, sizeof(vty_str), "vty[??]@%s", vty->address); if (vty) for (i = 0; i < vector_active (vtyvec); i++) - if ((vty == vector_slot (vtyvec, i))) + if (vty == vector_slot (vtyvec, i)) { snprintf(vty_str, sizeof(vty_str), "vty[%d]@%s", i, vty->address); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index e4505de..b38c75d 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1355,7 +1355,7 @@ rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen) len = RTA_LENGTH (alen); - if (RTA_ALIGN (rta->rta_len) + len > maxlen) + if ((int)RTA_ALIGN (rta->rta_len) + len > maxlen) return -1; subrta = (struct rtattr *) (((char *) rta) + RTA_ALIGN (rta->rta_len)); -- 2.7.4 _______________________________________________ Quagga-dev mailing list Quagga-dev@lists.quagga.net https://lists.quagga.net/mailman/listinfo/quagga-dev