]> git.puffer.fish Git - mirror/pve-network.git/commit
subnet: dhcp: only accept single ips and normalize them
authorStefan Hanreich <s.hanreich@proxmox.com>
Fri, 7 Mar 2025 12:50:55 +0000 (13:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Apr 2025 16:35:40 +0000 (18:35 +0200)
commitf5ad8efc4e5fadd24311c06afb2c93a0eb65a575
treebfbb997a3eb74c736f1174b4f571684eae153901
parente62b892fdc5d6b94d61af5424a6957983fbeeb29
subnet: dhcp: only accept single ips and normalize them

Net::IP accepts a myriad of different IP objects from ranges to
prefixes to singular IPs. We check if the object consists only of a
singular IP and normalize the IP if it has size 1 (since then it
could still be a /32 prefix or a range consisting of one IP).
Otherwise we would theoretically accept any valid Net::IP object here.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Link: https://lore.proxmox.com/20250307125056.169575-3-s.hanreich@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Network/SDN/SubnetPlugin.pm