lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [PATCH] PPP, PPPoE: Use service name and concentrator name


From: Jacob Kroon
Subject: [lwip-devel] [PATCH] PPP, PPPoE: Use service name and concentrator name
Date: Wed, 19 Dec 2018 22:24:57 +0100

Make pppoe_create() actually store the passed service name and
concentrator name, so that they are passed in the PADI/PADR/PADS packets.
---
 src/netif/ppp/pppoe.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/netif/ppp/pppoe.c b/src/netif/ppp/pppoe.c
index 47ec95b1..8cfc54c4 100644
--- a/src/netif/ppp/pppoe.c
+++ b/src/netif/ppp/pppoe.c
@@ -175,8 +175,8 @@ ppp_pcb *pppoe_create(struct netif *pppif,
 {
   ppp_pcb *ppp;
   struct pppoe_softc *sc;
-  LWIP_UNUSED_ARG(service_name);
-  LWIP_UNUSED_ARG(concentrator_name);
+  LWIP_UNUSED_ARG(service_name);      /* if !PPPOE_SCNAME_SUPPORT */
+  LWIP_UNUSED_ARG(concentrator_name); /* if !PPPOE_SCNAME_SUPPORT */
   LWIP_ASSERT_CORE_LOCKED();
 
   sc = (struct pppoe_softc *)LWIP_MEMPOOL_ALLOC(PPPOE_IF);
@@ -193,6 +193,12 @@ ppp_pcb *pppoe_create(struct netif *pppif,
   memset(sc, 0, sizeof(struct pppoe_softc));
   sc->pcb = ppp;
   sc->sc_ethif = ethif;
+#if PPPOE_SCNAME_SUPPORT
+  if (service_name != NULL)
+    sc->sc_service_name = strdup(service_name);
+  if (concentrator_name != NULL)
+    sc->sc_concentrator_name = strdup(concentrator_name);
+#endif /* PPPOE_SCNAME_SUPPORT */
   /* put the new interface at the head of the list */
   sc->next = pppoe_softc_list;
   pppoe_softc_list = sc;
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]