Hello all,

This is my first email to the Quagga developers list, so please bear with me if 
anything is amiss.

I've run into an assert that triggers in Quagga (w.r.t. BGP) that triggers when 
an old-style Cisco extended filter tries to match on V6 traffic. This occurs on 
filters such as:
   access-list  100  permit  ip  1.2.3.0  0.0.0.255  any

The problem is that masklen2ip, when translating the extended mask, will assert 
that:
   masklen>0 && masklen<=IPV4_MAX_BITLEN

...which obviously blows up for v6.

This occurs in filter_match_cisco(). Checking filter_match_zebra() for 
comparison, I see that p->family is checked against filter->prefix.family, so 
V6 filters are only matched against V6 traffic (and the same for V4). Thus, my 
patch (attached) fixes the problem by only matching cisco filters (which are 
inherently v4-only) against the AF_INET family.

I've confirmed that this fixes the bug as observed on a production system I'm 
working on. Since this is my first patch to Quagga, it's possible I messed 
something up in terms of patch format, etc., so please let me know if you have 
any comments or questions!

Seth

Attachment: fix_cisco_extended.diff
Description: fix_cisco_extended.diff

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to