Browse Source

[4626] setFixedFields called for Discover, Request and InfRequest

Tomek Mrugalski 8 years ago
parent
commit
64ecfcb9a2
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/bin/dhcp4/dhcp4_srv.cc

+ 12 - 0
src/bin/dhcp4/dhcp4_srv.cc

@@ -2012,6 +2012,10 @@ Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
         // them we append them for him.
         // them we append them for him.
         appendBasicOptions(ex);
         appendBasicOptions(ex);
 
 
+        // See if the class mandates setting any fixed fields (siaddr, sname,
+        // filename).
+        setFixedFields(ex);
+
     } else {
     } else {
         // If the server can't offer an address, it drops the packet.
         // If the server can't offer an address, it drops the packet.
         return (Pkt4Ptr());
         return (Pkt4Ptr());
@@ -2067,6 +2071,10 @@ Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
         // include in the response. If client did not request
         // include in the response. If client did not request
         // them we append them for him.
         // them we append them for him.
         appendBasicOptions(ex);
         appendBasicOptions(ex);
+
+        // See if the class mandates setting any fixed fields (siaddr, sname,
+        // filename).
+        setFixedFields(ex);
     }
     }
 
 
     // Set the src/dest IP address, port and interface for the outgoing
     // Set the src/dest IP address, port and interface for the outgoing
@@ -2352,6 +2360,10 @@ Dhcpv4Srv::processInform(Pkt4Ptr& inform) {
     appendBasicOptions(ex);
     appendBasicOptions(ex);
     adjustIfaceData(ex);
     adjustIfaceData(ex);
 
 
+    // See if the class mandates setting any fixed fields (siaddr, sname,
+    // filename).
+    setFixedFields(ex);
+
     // There are cases for the DHCPINFORM that the server receives it via
     // There are cases for the DHCPINFORM that the server receives it via
     // relay but will send the response to the client's unicast address
     // relay but will send the response to the client's unicast address
     // carried in the ciaddr. In this case, the giaddr and hops field should
     // carried in the ciaddr. In this case, the giaddr and hops field should