haykeh / capirca

Automatically exported from code.google.com/p/capirca
Apache License 2.0
0 stars 0 forks source link

Cisco generator uses ip as default protocol #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create policy file:

# cat policies/test.pol 
header {
  target:: cisco testACL inet6
}

term permit-all {
  action:: accept
}

2. Compile filters:
./aclgen.py -d def/ -o filters/ --poldir=policies/

3. See filter in filters/test.acl

What is the expected output? What do you see instead?

Generated ACL looks like:

ipv6 access-list testACL
remark permit-all
 permit ip any any

but it should be like:
ipv6 access-list testACL
remark permit-all
 permit ipv6 any any

What version of the product are you using? On what operating system?

Latest SVN revision (r141).

Please provide any additional information below.

The problem lies in Term class of cisco.py. If there is no protocol specified 
in term, it is assumed to be ip:
    # protocol
    if not self.term.protocol:
      protocol = ['ip']

When af is 6 the fallback protocol should be ipv6.

Original issue reported on code.google.com by ma...@vadnjal.net on 7 Aug 2011 at 5:25

GoogleCodeExporter commented 9 years ago
Thanks for reporting this.  Fixed in r143.

Original comment by watson@google.com on 9 Aug 2011 at 8:15