Parcourir la source

[3184] DHCPv4 RAI option is now echoed back if present.

Tomek Mrugalski il y a 11 ans
Parent
commit
4c0ef14158
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      src/bin/dhcp4/dhcp4_srv.cc

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

@@ -576,6 +576,12 @@ Dhcpv4Srv::copyDefaultFields(const Pkt4Ptr& question, Pkt4Ptr& answer) {
     if (dst_hw_addr) {
         answer->setRemoteHWAddr(dst_hw_addr);
     }
+
+    // If this packet is relayed, we want to copy Relay Agent Info option
+    OptionPtr rai = question->getOption(DHO_DHCP_AGENT_OPTIONS);
+    if (rai) {
+        answer->addOption(rai);
+    }
 }
 
 void