]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripngd: changes for code maintainability 13825/head
authorsri-mohan1 <sri.mohan@samsung.com>
Wed, 21 Jun 2023 16:56:43 +0000 (22:26 +0530)
committersri-mohan1 <sri.mohan@samsung.com>
Wed, 21 Jun 2023 17:09:13 +0000 (22:39 +0530)
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
ripngd/ripng_interface.c
ripngd/ripng_offset.c

index 1d9d53e47a03b3227af04be2b67f5884c0b5d129..a37cb7d092a5a8be8b2d3b8e7d4175ad38047d77 100644 (file)
@@ -136,8 +136,8 @@ static int ripng_if_ipv6_lladdress_check(struct interface *ifp)
                struct prefix *p;
                p = connected->address;
 
-               if ((p->family == AF_INET6)
-                   && IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6))
+               if ((p->family == AF_INET6) &&
+                   IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6))
                        count++;
        }
 
@@ -634,9 +634,9 @@ static void ripng_connect_set(struct interface *ifp, int set)
                if (set) {
                        /* Check once more whether this prefix is within a
                         * "network IF_OR_PREF" one */
-                       if ((ripng_enable_if_lookup(ripng, connected->ifp->name)
-                            >= 0)
-                           || (ripng_enable_network_lookup2(connected) >= 0))
+                       if ((ripng_enable_if_lookup(
+                                    ripng, connected->ifp->name) >= 0) ||
+                           (ripng_enable_network_lookup2(connected) >= 0))
                                ripng_redistribute_add(
                                        ripng, ZEBRA_ROUTE_CONNECT,
                                        RIPNG_ROUTE_INTERFACE, &address,
index ba3ba558afda91a986556b63b4005c574b1c3bd6..d842f15a194a5e4573ca03d37dbd332e95eb2ab7 100644 (file)
@@ -83,9 +83,8 @@ int ripng_offset_list_apply_in(struct ripng *ripng, struct prefix_ipv6 *p,
                alist = access_list_lookup(AFI_IP6,
                                           OFFSET_LIST_IN_NAME(offset));
 
-               if (alist
-                   && access_list_apply(alist, (struct prefix *)p)
-                              == FILTER_PERMIT) {
+               if (alist && access_list_apply(alist, (struct prefix *)p) ==
+                                    FILTER_PERMIT) {
                        *metric += OFFSET_LIST_IN_METRIC(offset);
                        return 1;
                }
@@ -97,9 +96,8 @@ int ripng_offset_list_apply_in(struct ripng *ripng, struct prefix_ipv6 *p,
                alist = access_list_lookup(AFI_IP6,
                                           OFFSET_LIST_IN_NAME(offset));
 
-               if (alist
-                   && access_list_apply(alist, (struct prefix *)p)
-                              == FILTER_PERMIT) {
+               if (alist && access_list_apply(alist, (struct prefix *)p) ==
+                                    FILTER_PERMIT) {
                        *metric += OFFSET_LIST_IN_METRIC(offset);
                        return 1;
                }
@@ -121,9 +119,8 @@ int ripng_offset_list_apply_out(struct ripng *ripng, struct prefix_ipv6 *p,
                alist = access_list_lookup(AFI_IP6,
                                           OFFSET_LIST_OUT_NAME(offset));
 
-               if (alist
-                   && access_list_apply(alist, (struct prefix *)p)
-                              == FILTER_PERMIT) {
+               if (alist && access_list_apply(alist, (struct prefix *)p) ==
+                                    FILTER_PERMIT) {
                        *metric += OFFSET_LIST_OUT_METRIC(offset);
                        return 1;
                }
@@ -136,9 +133,8 @@ int ripng_offset_list_apply_out(struct ripng *ripng, struct prefix_ipv6 *p,
                alist = access_list_lookup(AFI_IP6,
                                           OFFSET_LIST_OUT_NAME(offset));
 
-               if (alist
-                   && access_list_apply(alist, (struct prefix *)p)
-                              == FILTER_PERMIT) {
+               if (alist && access_list_apply(alist, (struct prefix *)p) ==
+                                    FILTER_PERMIT) {
                        *metric += OFFSET_LIST_OUT_METRIC(offset);
                        return 1;
                }