Skip to content

Commit

Permalink
parse prefix in inetnum
Browse files Browse the repository at this point in the history
  • Loading branch information
q committed Oct 28, 2024
1 parent 7b9b049 commit 6034934
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion irrd/rpsl/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def parse(
value = value.replace(",", "") # #311, process multiline PK correctly
if "-" in value:
ip1_input, ip2_input = value.split("-", 1)
elif "/" in value:
ip = IP(value, ipversion=4)
ip1_input = ip.net()
ip2_input = ip.broadcast()
else:
ip1_input = ip2_input = value

Expand All @@ -236,7 +240,7 @@ def parse(
messages.error(f"Invalid address range: {value}: first IP is higher than second IP")
return None

if "-" in value:
if "-" in value or "/" in value:
parsed_value = f"{ip1} - {ip2}"
else:
parsed_value = str(ip1)
Expand Down

0 comments on commit 6034934

Please sign in to comment.