diff options
| author | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2019-10-29 11:02:15 -0700 |
|---|---|---|
| committer | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2019-10-29 11:02:15 -0700 |
| commit | 457ea8d4bcfce831f083dfc4499ec91a42bd8e40 (patch) | |
| tree | 8c27f31116e408b512075ef222525dd84fa32847 /lib/if.c | |
| parent | 37cdb6e91dd8410bb884c15a818a37775e9cd135 (diff) | |
vrrpd: only count ipv4 addresses on check start
Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -959,6 +959,20 @@ static int connected_same_prefix(struct prefix *p1, struct prefix *p2) return 0; } +/* count the number of connected addresses that are in the given family */ +unsigned int connected_count_by_family(struct interface *ifp, int family) +{ + struct listnode *cnode; + struct connected *connected; + unsigned int cnt = 0; + + for (ALL_LIST_ELEMENTS_RO(ifp->connected, cnode, connected)) + if (connected->address->family == family) + cnt++; + + return cnt; +} + struct connected *connected_lookup_prefix_exact(struct interface *ifp, struct prefix *p) { |
