]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Some code cleanup based upon Review. 68/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 16 Jan 2017 13:57:20 +0000 (08:57 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 16 Jan 2017 13:57:20 +0000 (08:57 -0500)
Cleanup 2 spots in the code:
1) In if_netlink.c -> combine multi-line if statement into 1 line
2) In zebra_ptm.c -> only handle code that needs to be inside the if statement
in the if statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/if_netlink.c
zebra/zebra_ptm.c

index 678c2173216bc4606b8f486bf168741ab47c6d94..3665ad061d68fafaa98dd2a219eb0a212767111c 100644 (file)
@@ -465,8 +465,7 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h,
   zns = zebra_ns_lookup (ns_id);
   ifa = NLMSG_DATA (h);
 
-  if (ifa->ifa_family != AF_INET
-      && ifa->ifa_family != AF_INET6)
+  if (ifa->ifa_family != AF_INET && ifa->ifa_family != AF_INET6)
     return 0;
 
   if (h->nlmsg_type != RTM_NEWADDR && h->nlmsg_type != RTM_DELADDR)
index 194833f1e9e2c750dbebef12b2c4306146f87c6c..f3f849a6f49fc2b1440732ab312c9cce34b98c06 100644 (file)
@@ -891,17 +891,12 @@ zebra_ptm_bfd_dst_deregister (struct zserv *client, int sock, u_short length,
 
       stream_get(&src_p.u.prefix, s, src_p.prefixlen);
       if (src_p.family == AF_INET)
-        {
-          inet_ntop(AF_INET, &src_p.u.prefix4, buf, sizeof(buf));
-          ptm_lib_append_msg(ptm_hdl, out_ctxt,
-                              ZEBRA_PTM_BFD_SRC_IP_FIELD, buf);
-        }
+       inet_ntop(AF_INET, &src_p.u.prefix4, buf, sizeof(buf));
       else
-        {
-          inet_ntop(AF_INET6, &src_p.u.prefix6, buf, sizeof(buf));
-          ptm_lib_append_msg(ptm_hdl, out_ctxt,
-                              ZEBRA_PTM_BFD_SRC_IP_FIELD, buf);
-        }
+       inet_ntop(AF_INET6, &src_p.u.prefix6, buf, sizeof(buf));
+      ptm_lib_append_msg(ptm_hdl, out_ctxt,
+                        ZEBRA_PTM_BFD_SRC_IP_FIELD, buf);
+
       if (zvrf_id (zvrf) != VRF_DEFAULT)
        ptm_lib_append_msg(ptm_hdl, out_ctxt, ZEBRA_PTM_BFD_VRF_NAME_FIELD,
                           zvrf_name (zvrf));