Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/mpl/dhcp/dist/common Reset options on every loop.



details:   https://anonhg.NetBSD.org/src/rev/c51ee75c1f26
branches:  trunk
changeset: 979831:c51ee75c1f26
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 13 17:01:31 2021 +0000

description:
Reset options on every loop.

diffstat:

 external/mpl/dhcp/dist/common/options.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 28d2ac2d2389 -r c51ee75c1f26 external/mpl/dhcp/dist/common/options.c
--- a/external/mpl/dhcp/dist/common/options.c   Wed Jan 13 16:42:17 2021 +0000
+++ b/external/mpl/dhcp/dist/common/options.c   Wed Jan 13 17:01:31 2021 +0000
@@ -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 @@
        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 @@
        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. */



Home | Main Index | Thread Index | Old Index