Skip to content

Commit 938a994

Browse files
committed
PA: Add address collapsing using nacaddr.CollapseAddrList()
1 parent 72cfb69 commit 938a994

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: capirca/lib/paloaltofw.py

+6
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ def _TranslatePolicy(self, pol, exp_info):
475475
term.destination_address = nacaddr.RemoveAddressFromList(
476476
term.destination_address, i)
477477

478+
# note: CollapseAddrList must be called after above exclusions.
479+
if len(term.source_address) > 1:
480+
term.source_address = nacaddr.CollapseAddrList(term.source_address)
481+
if len(term.destination_address) > 1:
482+
term.destination_address = nacaddr.CollapseAddrList(term.destination_address)
483+
478484
# Count the number of occurencies of a particular version of the
479485
# address family, i.e. v4/v6 in source and destination IP addresses.
480486
afc = {

0 commit comments

Comments
 (0)