]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: trivial warning fix
authorPaul Jakma <paul@quagga.net>
Mon, 11 Apr 2011 15:33:20 +0000 (16:33 +0100)
committerPaul Jakma <paul@quagga.net>
Wed, 13 Apr 2011 14:13:33 +0000 (15:13 +0100)
* zebra_routemap.c: (route_set_src) get rid of the dummy family variable.

zebra/zebra_routemap.c

index 808dcf745927202c5dd324ad8ae02a19bc4eca63..b3111b8e634be6c166b9b34b805c5c4ed8861cc1 100644 (file)
@@ -642,17 +642,14 @@ route_set_src (void *rule, struct prefix *prefix,
 static void *
 route_set_src_compile (const char *arg)
 {
-  sa_family_t family;
   union g_addr src, *psrc;
 
-  if (inet_pton(AF_INET, arg, &src.ipv4) > 0)
-    family = AF_INET;
+  if (inet_pton(AF_INET, arg, &src.ipv4) != 1
 #ifdef HAVE_IPV6
-  else if (inet_pton(AF_INET6, arg, &src.ipv6) > 0)
-    family = AF_INET6;
+      && inet_pton(AF_INET6, arg, &src.ipv6) != 1
 #endif /* HAVE_IPV6 */
-  else
-   return NULL;
+     )
+    return NULL;
 
   psrc = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (union g_addr));
   *psrc = src;