Hi,

On Sat, 20 Apr 2013 01:00:14 +0900
trick star <[email protected]> wrote:
> hi, I have problem in the OpenBSD -snapshots 5.3 npppd pppoe setting!
> server's npppd was down for segmantation fault. when client to attache
> the server.
> before -current version was fine. but new -snapshots is suck.
> if anyone could help my problem. please suggest for me.

npppd pppoe server has been broken since September.  I fixed the
problem on cvs and I attached the diff below.  I'd like you to apply
the diff and let me know if the diff doesn't fix your problem.

Thank you your report.

Index: pppoe/pppoed.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/pppoe/pppoed.c,v
retrieving revision 1.11
diff -u -p -r1.11 pppoed.c
--- pppoe/pppoed.c      18 Sep 2012 13:14:08 -0000      1.11
+++ pppoe/pppoed.c      6 Apr 2013 01:56:29 -0000
@@ -470,8 +470,9 @@ pppoed_reload(pppoed *_this, struct pppo
        struct ifaddrs    *ifa0;
        slist              rmlist, newlist;
        struct {
-               char       ifname[IF_NAMESIZE];
-               char       name[PPPOED_PHY_LABEL_SIZE];
+               char                     ifname[IF_NAMESIZE];
+               char                     name[PPPOED_PHY_LABEL_SIZE];
+               struct pppoe_conf       *conf;
        } listeners[PPPOE_NLISTENER];
        pppoed_listener   *l;
        pppoe_session     *session;
@@ -493,6 +494,7 @@ pppoed_reload(pppoed *_this, struct pppo
                    sizeof(listeners[count].ifname));
                strlcpy(listeners[count].name, conf->name,
                    sizeof(listeners[count].name));
+               listeners[count].conf = conf;
                count++;
        }
 
@@ -520,6 +522,7 @@ pppoed_reload(pppoed *_this, struct pppo
                strlcpy(l->tun_name, listeners[i].name, sizeof(l->tun_name));
                strlcpy(l->listen_ifname, listeners[i].ifname,
                    sizeof(l->listen_ifname));
+               l->conf = listeners[i].conf;
                if (slist_add(&newlist, l) == NULL) {
                        pppoed_log(_this, LOG_ERR,
                            "slist_add() failed in %s(): %m", __func__);

Index: l2tp/l2tpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/l2tp/l2tpd.c,v
retrieving revision 1.11
diff -u -p -r1.11 l2tpd.c
--- l2tp/l2tpd.c        18 Sep 2012 13:14:08 -0000      1.11
+++ l2tp/l2tpd.c        19 Apr 2013 03:19:17 -0000
@@ -573,8 +573,6 @@ l2tpd_reload(l2tpd *_this, struct l2tp_c
                return 0;
        }
 
-       if (l2tpd_init(_this) != 0)
-               return -1;
        i = 0;
        TAILQ_FOREACH(conf, l2tp_conf, entry)
                l2tpd_add_listener(_this, i++, conf);
Index: npppd/npppd.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/npppd/npppd.c,v
retrieving revision 1.28
diff -u -p -r1.28 npppd.c
--- npppd/npppd.c       16 Apr 2013 07:42:27 -0000      1.28
+++ npppd/npppd.c       19 Apr 2013 03:19:20 -0000
@@ -286,6 +286,18 @@ npppd_init(npppd *_this, const char *con
 
        _this->boot_id = (uint32_t)random();
 
+#ifdef USE_NPPPD_L2TP
+       if (l2tpd_init(&_this->l2tpd) != 0)
+               return (-1);
+#endif
+#ifdef USE_NPPPD_PPTP
+       if (pptpd_init(&_this->pptpd) != 0)
+               return (-1);
+#endif
+#ifdef USE_NPPPD_PPPOE
+       if (pppoed_init(&_this->pppoed) != 0)
+               return (-1);
+#endif
        /* load configuration */
        if ((status = npppd_reload_config(_this)) != 0)
                return status;
Index: pptp/pptpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/pptp/pptpd.c,v
retrieving revision 1.16
diff -u -p -r1.16 pptpd.c
--- pptp/pptpd.c        6 Apr 2013 17:03:51 -0000       1.16
+++ pptp/pptpd.c        19 Apr 2013 03:19:22 -0000
@@ -589,8 +589,6 @@ pptpd_reload(pptpd *_this, struct pptp_c
                return 0;
        }
 
-       if (pptpd_init(_this) != 0)
-               return -1;
        i = 0;
        TAILQ_FOREACH(conf, pptp_conf, entry)
                pptpd_add_listener(_this, i++, conf);

Reply via email to