Browse Source

[3231] Removed the source address adjustment of the packet in LPF.

The DHCPv4 server is now responsible for setting up a correct unicast
source address for the outgoing packet. The IfaceMgr doesn't replace
the broadcast address with the unicast address anymore.
Marcin Siodelski 11 years ago
parent
commit
e6d538fd1e
1 changed files with 0 additions and 20 deletions
  1. 0 20
      src/lib/dhcp/pkt_filter_lpf.cc

+ 0 - 20
src/lib/dhcp/pkt_filter_lpf.cc

@@ -258,26 +258,6 @@ PktFilterLPF::send(const Iface& iface, uint16_t sockfd, const Pkt4Ptr& pkt) {
     // are valid because they are checked by the function called.
     writeEthernetHeader(pkt, buf);
 
-    // This object represents broadcast address. We will compare the
-    // local packet address with it a few lines below. Having static
-    // variable guarantees that this object is created only once, not
-    // every time this function is called.
-    static const isc::asiolink::IOAddress bcast_addr("255.255.255.255");
-
-    // It is likely that the local address in pkt object is set to
-    // broadcast address. This is the case if server received the
-    // client's packet on broadcast address. Therefore, we need to
-    // correct it here and assign the actual source address.
-    if (pkt->getLocalAddr() == bcast_addr) {
-        const Iface::SocketCollection& sockets = iface.getSockets();
-        for (Iface::SocketCollection::const_iterator it = sockets.begin();
-             it != sockets.end(); ++it) {
-            if (sockfd == it->sockfd_) {
-                pkt->setLocalAddr(it->addr_);
-            }
-        }
-    }
-
     // IP and UDP header
     writeIpUdpHeader(pkt, buf);