Source-Changes-HG archive

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

[src/trunk]: src/sys/net Send RTM_IFINFO when a network configuration protocol



details:   https://anonhg.NetBSD.org/src/rev/83b344b77c1f
branches:  trunk
changeset: 1021483:83b344b77c1f
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Jun 01 05:04:06 2021 +0000

description:
Send RTM_IFINFO when a network configuration protocol
is up or down

diffstat:

 sys/net/if_spppsubr.c |  42 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 37 insertions(+), 5 deletions(-)

diffs (115 lines):

diff -r ca09669ca920 -r 83b344b77c1f sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Tue Jun 01 04:59:50 2021 +0000
+++ b/sys/net/if_spppsubr.c     Tue Jun 01 05:04:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.252 2021/06/01 04:59:50 yamaguchi Exp $       */
+/*     $NetBSD: if_spppsubr.c,v 1.253 2021/06/01 05:04:06 yamaguchi Exp $       */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.252 2021/06/01 04:59:50 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.253 2021/06/01 05:04:06 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -417,6 +417,7 @@
 static void sppp_ipcp_confrej(struct sppp *, struct lcp_header *, int);
 static void sppp_ipcp_confnak(struct sppp *, struct lcp_header *, int);
 static void sppp_ipcp_tlu(struct sppp *);
+static void sppp_ipcp_tld(struct sppp *);
 static void sppp_ipcp_scr(struct sppp *);
 
 static void sppp_ipv6cp_init(struct sppp *);
@@ -427,6 +428,7 @@
 static void sppp_ipv6cp_confrej(struct sppp *, struct lcp_header *, int);
 static void sppp_ipv6cp_confnak(struct sppp *, struct lcp_header *, int);
 static void sppp_ipv6cp_tlu(struct sppp *);
+static void sppp_ipv6cp_tld(struct sppp *);
 static void sppp_ipv6cp_scr(struct sppp *);
 
 static void sppp_pap_input(struct sppp *, struct mbuf *);
@@ -504,7 +506,7 @@
        "ipcp",
        sppp_up_event, sppp_down_event, sppp_ipcp_open,
        sppp_ipcp_close, sppp_to_event,
-       sppp_ipcp_tlu, sppp_null, sppp_tls,
+       sppp_ipcp_tlu, sppp_ipcp_tld, sppp_tls,
        sppp_tlf, sppp_ipcp_scr, sppp_screply,
        sppp_ipcp_confreq, sppp_ipcp_confrej, sppp_ipcp_confnak,
 };
@@ -519,7 +521,7 @@
        "ipv6cp",
        sppp_up_event, sppp_down_event, sppp_ipv6cp_open,
        sppp_close_event, sppp_to_event,
-       sppp_ipv6cp_tlu, sppp_null, sppp_tls,
+       sppp_ipv6cp_tlu, sppp_ipv6cp_tld, sppp_tls,
        sppp_tlf, sppp_ipv6cp_scr, sppp_screply,
        sppp_ipv6cp_confreq, sppp_ipv6cp_confrej, sppp_ipv6cp_confnak,
 };
@@ -3936,8 +3938,9 @@
 #ifdef INET
        struct ifnet *ifp;
 
+       KASSERT(SPPP_WLOCKED(sp));
+
        ifp = &sp->pp_if;
-       KASSERT(SPPP_WLOCKED(sp));
        if ((sp->ipcp.flags & IPCP_MYADDR_DYN) &&
            ((sp->ipcp.flags & IPCP_MYADDR_SEEN) == 0)) {
                log(LOG_WARNING, "%s: no IP address, closing IPCP\n",
@@ -3947,11 +3950,25 @@
        } else {
                /* we are up. Set addresses and notify anyone interested */
                sppp_set_ip_addrs(sp);
+               rt_ifmsg(ifp);
        }
 #endif
 }
 
 static void
+sppp_ipcp_tld(struct sppp *sp)
+{
+#ifdef INET
+       struct ifnet *ifp;
+
+       KASSERT(SPPP_WLOCKED(sp));
+
+       ifp = &sp->pp_if;
+       rt_ifmsg(ifp);
+#endif
+}
+
+static void
 sppp_ipcp_scr(struct sppp *sp)
 {
        uint8_t opt[6 /* compression */ + 6 /* address */ + 12 /* dns addresses */];
@@ -4483,10 +4500,25 @@
 static void
 sppp_ipv6cp_tlu(struct sppp *sp)
 {
+       struct ifnet *ifp;
 
        KASSERT(SPPP_WLOCKED(sp));
+
+       ifp = &sp->pp_if;
        /* we are up - notify isdn daemon */
        sppp_notify_con_wlocked(sp);
+       rt_ifmsg(ifp);
+}
+
+static void
+sppp_ipv6cp_tld(struct sppp *sp)
+{
+       struct ifnet *ifp;
+
+       KASSERT(SPPP_WLOCKED(sp));
+
+       ifp = &sp->pp_if;
+       rt_ifmsg(ifp);
 }
 
 static void



Home | Main Index | Thread Index | Old Index