diff options
| author | Visakha Erina <visakha.erina@broadcom.com> | 2019-06-19 06:38:31 -0700 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-20 01:51:38 -0400 | 
| commit | 0277936a2cb2228eb5367b83297707d360721fb3 (patch) | |
| tree | f386cd42d2d289684c1d9de98b48b18c116555c2 /lib/plist.c | |
| parent | eb7fce2eea3cd0e0360ca7de2ad2bed61ab130b0 (diff) | |
lib: Keep proper count of prefix-list hit-count when used
When a prefix-list is applied to a BGP neighbor to deny the learning
of specific routes, the hit count is showing 0 for BGP even though
the routes are being filtered correctly due
to the configured prefix-list.
Before fix:
c1# show ip prefix-list nag seq 10
ZEBRA: seq 10 permit any (hit count: 0, refcount: 0)
BGP: seq 10 permit any (hit count: 0, refcount: 0)
c1# show ip prefix-list nag seq 5
ZEBRA: seq 5 deny 1.0.1.0/24 (hit count: 0, refcount: 0)
BGP: seq 5 deny 1.0.1.0/24 (hit count: 0, refcount: 0)
Fix: Increment the prefix-list's hit count whenever a rule match occurs.
After Fix:
c1# show ip prefix-list nag seq 10
ZEBRA: seq 10 permit any (hit count: 0, refcount: 0)
BGP: seq 10 permit any (hit count: 6, refcount: 0)
c1# show ip prefix-list nag seq 5
ZEBRA: seq 5 deny 1.0.1.0/24 (hit count: 0, refcount: 0)
BGP: seq 5 deny 1.0.1.0/24 (hit count: 1, refcount: 0)
Signed-off-by: Visakha Erina visakha.erina@broadcom.com
Diffstat (limited to 'lib/plist.c')
| -rw-r--r-- | lib/plist.c | 1 | 
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/plist.c b/lib/plist.c index 54ea742c66..1ba8982499 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -750,6 +750,7 @@ enum prefix_list_type prefix_list_apply_which_prefix(  	if (pbest == NULL)  		return PREFIX_DENY; +	pbest->hitcnt++;  	return pbest->type;  }  | 
