A debug message issued during startup, this indicates that the IPv4 DHCP
server is about to open sockets on the specified port.
+% DHCP4_PACKET_NOT_FOR_US received DHCPv4 message dropped because it contains foreign server identifier, interface: %1
+This debug message is issued when received DHCPv4 message is dropped because
+it is addressed to a different server, i.e. a server identifier held by
+this message doesn't match the identifier used by our server. The argument
+of this message holds the name of the interface on which the message has
+been received.
+
% DHCP4_OPEN_SOCKET_FAIL failed to create socket: %1
A warning message issued when IfaceMgr fails to open and bind a socket. The reason
for the failure is appended as an argument of the log message.
}
}
+ // Check if the DHCPv4 packet has been sent to us, to to someone else.
+ // If it hasn't been sent to us, drop it!
+ if (!acceptServerId(query)) {
+ LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_NOT_FOR_US)
+ .arg(query->getIface());
+ continue;
+ }
+
// When receiving a packet without message type option, getType() will
// throw. Let's set type to -1 as default error indicator.
int type = -1;
// and try to match with server identifiers used by the server.
Option4AddrLstPtr option_addrs =
boost::dynamic_pointer_cast<Option4AddrLst>(option);
+ // Unable to convert the option to the option type which encapsulates it.
+ // We treat this as non-matching server id.
+ if (!option_addrs) {
+ return (false);
+ }
Option4AddrLst::AddressContainer addrs = option_addrs->getAddresses();
if (addrs.size() != 1) {