the udp socket.
Found by David Carlier.
ok yasuoka@
-/* $OpenBSD: dhcp.c,v 1.45 2016/02/06 23:50:10 krw Exp $ */
+/* $OpenBSD: dhcp.c,v 1.46 2016/08/05 14:02:23 krw Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
static char dhcp_message[256];
void
-dhcp(struct packet *packet)
+dhcp(struct packet *packet, int is_udpsock)
{
if (!locate_network(packet) && packet->packet_type != DHCPREQUEST)
return;
+ if (is_udpsock && packet->packet_type != DHCPINFORM) {
+ note("Unable to handle a DHCP message type=%d on UDP "
+ "socket", packet->packet_type);
+ return;
+ }
+
switch (packet->packet_type) {
case DHCPDISCOVER:
dhcpdiscover(packet);
-/* $OpenBSD: dhcpd.h,v 1.53 2016/02/06 23:50:10 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.54 2016/08/05 14:02:23 krw Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
/* dhcp.c */
extern int outstanding_pings;
-void dhcp(struct packet *);
+void dhcp(struct packet *, int);
void dhcpdiscover(struct packet *);
void dhcprequest(struct packet *);
void dhcprelease(struct packet *);
-/* $OpenBSD: options.c,v 1.30 2016/02/06 23:50:10 krw Exp $ */
+/* $OpenBSD: options.c,v 1.31 2016/08/05 14:02:23 krw Exp $ */
/* DHCP options parsing and reassembly. */
tp.options[DHO_DHCP_MESSAGE_TYPE].data)
tp.packet_type = tp.options[DHO_DHCP_MESSAGE_TYPE].data[0];
- if (interface->is_udpsock) {
- if (tp.packet_type != DHCPINFORM) {
- note("Unable to handle a DHCP message type=%d on UDP "
- "socket", tp.packet_type);
- return;
- }
- }
if (tp.packet_type)
- dhcp(&tp);
+ dhcp(&tp, interface->is_udpsock);
else
bootp(&tp);