summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2023-04-10 09:20:43 +0200
committeranlan_cs <vic.lan@pica8.com>2023-04-10 09:53:07 +0200
commitb769fdc88b2445cb6965ac70ffb87a87af26a79d (patch)
tree2108edfacafebba0783f0775515bd4d06a19c7f2 /ripd
parentripd: Correct one debug log (diff)
downloadfrr-b769fdc88b2445cb6965ac70ffb87a87af26a79d.tar.xz
frr-b769fdc88b2445cb6965ac70ffb87a87af26a79d.zip
ripd: Simplify code for distance
Simplify the code for `rip_distance_apply()`. Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ripd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 15e058a74..7dbe2bbcc 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2836,16 +2836,11 @@ uint8_t rip_distance_apply(struct rip *rip, struct rip_info *rinfo)
if (access_list_apply(alist, &rinfo->rp->p)
== FILTER_DENY)
return 0;
-
- return rdistance->distance;
- } else
- return rdistance->distance;
+ }
+ return rdistance->distance;
}
- if (rip->distance)
- return rip->distance;
-
- return 0;
+ return rip->distance;
}
static void rip_distance_show(struct vty *vty, struct rip *rip)