]> git.puffer.fish Git - mirror/frr.git/commit
lib: Keep proper count of prefix-list hit-count when used
authorVisakha Erina <visakha.erina@broadcom.com>
Wed, 19 Jun 2019 13:38:31 +0000 (06:38 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 20 Jun 2019 05:51:38 +0000 (01:51 -0400)
commit0277936a2cb2228eb5367b83297707d360721fb3
treef386cd42d2d289684c1d9de98b48b18c116555c2
parenteb7fce2eea3cd0e0360ca7de2ad2bed61ab130b0
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
lib/plist.c