diff options
author | anlan_cs <vic.lan@pica8.com> | 2023-04-10 09:20:43 +0200 |
---|---|---|
committer | anlan_cs <vic.lan@pica8.com> | 2023-04-10 09:53:07 +0200 |
commit | b769fdc88b2445cb6965ac70ffb87a87af26a79d (patch) | |
tree | 2108edfacafebba0783f0775515bd4d06a19c7f2 /ripd | |
parent | ripd: Correct one debug log (diff) | |
download | frr-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.c | 11 |
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) |