Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rtadvd Ensure that the soliciter list ...



details:   https://anonhg.NetBSD.org/src/rev/35117b047f39
branches:  trunk
changeset: 318389:35117b047f39
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Apr 20 15:29:19 2018 +0000
description:
Ensure that the soliciter list is initialised and freed correctly, even if it's not used yet.

diffstat:

 usr.sbin/rtadvd/config.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 2b281ad1f180 -r 35117b047f39 usr.sbin/rtadvd/config.c
--- a/usr.sbin/rtadvd/config.c  Fri Apr 20 13:27:45 2018 +0000
+++ b/usr.sbin/rtadvd/config.c  Fri Apr 20 15:29:19 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.c,v 1.38 2018/04/20 10:39:37 roy Exp $  */
+/*     $NetBSD: config.c,v 1.39 2018/04/20 15:29:19 roy Exp $  */
 /*     $KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $    */
 
 /*
@@ -104,6 +104,7 @@
 void
 free_rainfo(struct rainfo *rai)
 {
+       struct soliciter *sol;
        struct prefix *pfx;
        struct rtinfo *rti;
        struct rdnss *rdnss;
@@ -113,6 +114,11 @@
 
        rtadvd_remove_timer(&rai->timer);
 
+       while ((sol = TAILQ_FIRST(&rai->soliciter))) {
+               TAILQ_REMOVE(&rai->soliciter, sol, next);
+               free(sol);
+       }
+
        while ((pfx = TAILQ_FIRST(&rai->prefix))) {
                TAILQ_REMOVE(&rai->prefix, pfx, next);
                free(pfx);
@@ -206,6 +212,7 @@
        }
 
        ELM_MALLOC(tmp);
+       TAILQ_INIT(&tmp->soliciter);
        TAILQ_INIT(&tmp->prefix);
        TAILQ_INIT(&tmp->route);
        TAILQ_INIT(&tmp->rdnss);



Home | Main Index | Thread Index | Old Index