Skip to content

Commit

Permalink
Merge pull request FRRouting#13825 from sri-mohan1/srib-ripng
Browse files Browse the repository at this point in the history
ripngd: changes for code maintainability
  • Loading branch information
mjstapp authored Jun 21, 2023
2 parents d94c373 + 3a40f78 commit 6e1204c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
10 changes: 5 additions & 5 deletions ripngd/ripng_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down Expand Up @@ -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,
Expand Down
20 changes: 8 additions & 12 deletions ripngd/ripng_offset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 6e1204c

Please sign in to comment.