Module Name: src
Committed By: christos
Date: Wed Jan 13 17:01:31 UTC 2021
Modified Files:
src/external/mpl/dhcp/dist/common: options.c
Log Message:
Reset options on every loop.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/dist/common/options.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.4 src/external/mpl/dhcp/dist/common/options.c:1.5
--- src/external/mpl/dhcp/dist/common/options.c:1.4 Wed Jan 13 10:51:49 2021
+++ src/external/mpl/dhcp/dist/common/options.c Wed Jan 13 12:01:31 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $ */
+/* $NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $ */
/* options.c
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $");
#define DHCP_OPTION_DATA
#include "dhcpd.h"
@@ -130,8 +130,8 @@ int parse_option_buffer (options, buffer
unsigned len, offset;
unsigned code;
struct option_cache *op = NULL, *nop = NULL;
- struct buffer *bp = (struct buffer *)0;
- struct option *option = NULL;
+ struct buffer *bp = NULL;
+ struct option *option;
char *reason = "general failure";
if (!buffer_allocate (&bp, length, MDL)) {
@@ -143,6 +143,7 @@ int parse_option_buffer (options, buffer
for (offset = 0;
(offset + universe->tag_size) <= length &&
(code = universe->get_tag(buffer + offset)) != universe->end; ) {
+ option = NULL;
offset += universe->tag_size;
/* Pad options don't have a length - just skip them. */