]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Fix some more compiler warnings
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sun, 15 May 2016 17:33:15 +0000 (13:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 20 May 2016 13:34:20 +0000 (09:34 -0400)
Three different changes:
a) in nexthop.c we have an actual bug, we've rearranged
the enumerated types and the list of enums has changed, we
were displaying the wrong nexthop information.

b) Remove some dead code from sockunion.h

c) '\0' evaluates to 0 which is NULL.  vector_set takes
a pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
lib/nexthop.c
lib/sockunion.h
lib/vty.c

index 2a8d343a8c725550ad3a7e860ce352ccc69d1508..5853884218fe1d180f658611af1e130352ffa238 100644 (file)
@@ -82,16 +82,11 @@ nexthop_type_to_str (enum nexthop_types_t nh_type)
     "Interface route",
     "IPv4 nexthop",
     "IPv4 nexthop with ifindex",
-    "IPv4 nexthop with ifname",
     "IPv6 nexthop",
     "IPv6 nexthop with ifindex",
-    "IPv6 nexthop with ifname",
     "Null0 nexthop",
   };
 
-  if (nh_type >= ZEBRA_NUM_OF (desc))
-    return "<Invalid nh type>";
-
   return desc[nh_type];
 }
 
index 195c2fff923c5804ad7e35acf38b744c551f5fd9..f041f95a1023b7c2a93c32a852f55d58aa879c4d 100644 (file)
 
 #include "privs.h"
 
-#if 0
-union sockunion {
-  struct sockinet {
-    u_char si_len;
-    u_char si_family;
-    u_short si_port;
-  } su_si;
-  struct sockaddr_in  su_sin;
-  struct sockaddr_in6 su_sin6;
-};
-#define su_len                su_si.si_len
-#define su_family     su_si.si_family
-#define su_port               su_si.si_port
-#endif /* 0 */
-
 union sockunion 
 {
   struct sockaddr sa;
   struct sockaddr_in sin;
-#ifdef HAVE_IPV6
   struct sockaddr_in6 sin6;
-#endif /* HAVE_IPV6 */
 };
 
 enum connect_result
index 13b8b3019f02156026fa46163de0c63ff0a8ec98..105d55927934364d2ad86713554ff5864740f463 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -870,7 +870,7 @@ vty_complete_command (struct vty *vty)
 
   /* In case of 'help \t'. */
   if (isspace ((int) vty->buf[vty->length - 1]))
-    vector_set (vline, '\0');
+    vector_set (vline, NULL);
 
   matched = cmd_complete_command (vline, vty, &ret);
   
@@ -985,11 +985,11 @@ vty_describe_command (struct vty *vty)
   if (vline == NULL)
     {
       vline = vector_init (1);
-      vector_set (vline, '\0');
+      vector_set (vline, NULL);
     }
   else 
     if (isspace ((int) vty->buf[vty->length - 1]))
-      vector_set (vline, '\0');
+      vector_set (vline, NULL);
 
   describe = cmd_describe_command (vline, vty, &ret);