Source-Changes-HG archive

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

[src/trunk]: src/sys/net Clear AC-Name and Service-Name if params are not spe...



details:   https://anonhg.NetBSD.org/src/rev/ab17005758dc
branches:  trunk
changeset: 944261:ab17005758dc
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Sep 25 06:12:33 2020 +0000

description:
Clear AC-Name and Service-Name if params are not specified

diffstat:

 sys/net/if_pppoe.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 4a80c5062e45 -r ab17005758dc sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Fri Sep 25 06:07:31 2020 +0000
+++ b/sys/net/if_pppoe.c        Fri Sep 25 06:12:33 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.151 2020/09/18 09:53:50 yamaguchi Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.152 2020/09/25 06:12:33 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.151 2020/09/18 09:53:50 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.152 2020/09/25 06:12:33 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -1248,6 +1248,10 @@
                                free(sc->sc_concentrator_name, M_DEVBUF);
                        sc->sc_concentrator_name = b;
                        PPPOE_UNLOCK(sc);
+               } else {
+                       if (sc->sc_concentrator_name)
+                               free(sc->sc_concentrator_name, M_DEVBUF);
+                       sc->sc_concentrator_name = NULL;
                }
                if (parms->service_name != NULL) {
                        size_t s;
@@ -1271,6 +1275,10 @@
                                free(sc->sc_service_name, M_DEVBUF);
                        sc->sc_service_name = b;
                        PPPOE_UNLOCK(sc);
+               } else {
+                       if (sc->sc_service_name)
+                               free(sc->sc_service_name, M_DEVBUF);
+                       sc->sc_service_name = NULL;
                }
                return 0;
        }



Home | Main Index | Thread Index | Old Index