From: Alan T. DeKok Date: Mon, 28 May 2018 20:59:56 +0000 (-0400) Subject: set opcode properly, and also hops X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b196686fa8563c72ed2e714bec22cb267284d838;p=thirdparty%2Ffreeradius-server.git set opcode properly, and also hops --- diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c index ce00be8eecd..8b528e60c4b 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c @@ -252,7 +252,10 @@ static ssize_t mod_write(void *instance, void *packet_ctx, */ if ((code[2] == FR_DHCP_DISCOVER) || (code[2] == FR_DHCP_REQUEST)) { - packet->hops++; + packet->opcode = 1; /* client message */ + packet->hops = request->hops + 1; + } else { + packet->opcode = 2; /* server message */ } goto send_reply; @@ -267,6 +270,8 @@ static ssize_t mod_write(void *instance, void *packet_ctx, return 0; } + packet->opcode = 2; /* server message */ + /* * The original packet requested a broadcast * reply, and CIADDR is empty, go broadcast the