Commit e6d538fd authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[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.
parent 2be3eca2
......@@ -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("");
// 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_) {
// IP and UDP header
writeIpUdpHeader(pkt, buf);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment