Commit f451ad94 authored by Simon Redman's avatar Simon Redman

Change dport_range and sport_range to be actual ranges, even for only one value

parent 500e7b62
......@@ -43,6 +43,17 @@ class Match:
nlsdn_dst = None
nlsdn_dst_len = None
sport_range = None
sport = match.match_fields['sport']
if sport is not None:
# Have to convert to range, even for only one value, because that is how nlsdn works
sport_range = [sport, sport]
dport_range = None
dport = match.match_fields['dport']
if dport is not None:
# Have to convert to range, even for only one value, because that is how nlsdn works
dport_range = [sport, sport]
return RuleMatch(
priority=match.match_fields['priority'],
......@@ -50,8 +61,8 @@ class Match:
src_len=nlsdn_src_len,
dst=nlsdn_dst,
dst_len=nlsdn_dst_len,
sport_range=[match.match_fields['sport']],
dport_range=[match.match_fields['dport']],
sport_range=sport_range,
dport_range=dport_range,
ipproto=match.match_fields['ipproto'],
family=match.match_fields['family'],
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment