diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-08-06 22:18:41 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-08-21 05:57:17 +0200 |
commit | 1e4d64aa6ff02a86a50e1211e3649ad44497b01f (patch) | |
tree | 238da1850a3aec9ea0eb3d39028e9e3b60b69286 /isisd | |
parent | isisd: remove unused struct fields (diff) | |
download | frr-1e4d64aa6ff02a86a50e1211e3649ad44497b01f.tar.xz frr-1e4d64aa6ff02a86a50e1211e3649ad44497b01f.zip |
isisd: remove unnecessary null checks
These null checks don't make sense because a) these two functions
are never called with a NULL IP address and b) the same pointers are
dereferenced later without any protection. Remove these NULL checks
to make the code less confusing.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_route.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/isisd/isis_route.c b/isisd/isis_route.c index 238555d15..7059fdb63 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -57,7 +57,7 @@ static struct isis_nexthop *isis_nexthop_create(struct in_addr *ip, for (ALL_LIST_ELEMENTS_RO(isis->nexthops, node, nexthop)) { if (nexthop->ifindex != ifindex) continue; - if (ip && memcmp(&nexthop->ip, ip, sizeof(struct in_addr)) != 0) + if (memcmp(&nexthop->ip, ip, sizeof(struct in_addr)) != 0) continue; nexthop->lock++; @@ -123,9 +123,7 @@ static struct isis_nexthop6 *isis_nexthop6_create(struct in6_addr *ip6, for (ALL_LIST_ELEMENTS_RO(isis->nexthops6, node, nexthop6)) { if (nexthop6->ifindex != ifindex) continue; - if (ip6 - && memcmp(&nexthop6->ip6, ip6, sizeof(struct in6_addr)) - != 0) + if (memcmp(&nexthop6->ip6, ip6, sizeof(struct in6_addr)) != 0) continue; nexthop6->lock++; |