diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-07-13 14:42:50 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-07-13 14:51:11 +0300 |
| commit | 67d5b193ad7ca4c496d3e701e7db88fb8b200d00 (patch) | |
| tree | ca63687c38b9d3e842c77b2abc20d70da059e39c /filter_plugins | |
| parent | 6de7c4afd1aed4d692af3a9157f24545ddc7b8ab (diff) | |
Prod deployment fixes
Diffstat (limited to 'filter_plugins')
| -rw-r--r-- | filter_plugins/ipv4.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/filter_plugins/ipv4.py b/filter_plugins/ipv4.py index 1c42e82..0bf8c67 100644 --- a/filter_plugins/ipv4.py +++ b/filter_plugins/ipv4.py @@ -19,9 +19,9 @@ def ipv4_network(cidr): def ipv4_nth(cidr, n): - """Return the nth host address in a network. '10.0.20.0/24' | ipv4_nth(101) -> '10.0.20.101'""" - network = ipv4_network(cidr) - return _int_to_ip(_ip_to_int(network) + int(n)) + """Return the nth host address relative to the given IP. '192.168.2.0/16' | ipv4_nth(101) -> '192.168.2.101'""" + ip, _ = cidr.split("/") + return _int_to_ip(_ip_to_int(ip) + int(n)) def ipv4_nth_cidr(cidr, n): |
