Browse Source

dhcp4_srv: Use the "client prefix length" of the subnet when handing out IPv4 addresses

Baptiste Jonglez 7 years ago
parent
commit
b7da342d2a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bin/dhcp4/dhcp4_srv.cc

+ 1 - 1
src/bin/dhcp4/dhcp4_srv.cc

@@ -2297,7 +2297,7 @@ Dhcpv4Srv::setFixedFields(Dhcpv4Exchange& ex) {
 
 OptionPtr
 Dhcpv4Srv::getNetmaskOption(const Subnet4Ptr& subnet) {
-    uint32_t netmask = getNetmask4(subnet->get().second).toUint32();
+    uint32_t netmask = getNetmask4(subnet->getClientPrefixLength()).toUint32();
 
     OptionPtr opt(new OptionInt<uint32_t>(Option::V4,
                   DHO_SUBNET_MASK, netmask));