ocserv: corrected checksum
[feed/packages.git] / net / xl2tpd / patches / 204-start_pppd-place-opts-after-plugin-pppol2tp.so.patch
1 From 7a343f7b79b70a8e7e04b2bd465d344ad0ef4c49 Mon Sep 17 00:00:00 2001
2 From: Yousong Zhou <yszhou4tech@gmail.com>
3 Date: Wed, 29 Apr 2015 16:30:17 +0800
4 Subject: [PATCH 4/7] start_pppd: place opts after "plugin pppol2tp.so".
5
6 so that plugin options like pppol2tp_debug_mark can be recognized by pppd.
7 ---
8 xl2tpd.c | 21 ++++++++++-----------
9 1 file changed, 10 insertions(+), 11 deletions(-)
10
11 --- a/xl2tpd.c
12 +++ b/xl2tpd.c
13 @@ -382,7 +382,6 @@ int start_pppd (struct call *c, struct p
14 /* char a, b; */
15 char tty[512];
16 char *stropt[80];
17 - struct ppp_opts *p;
18 #ifdef USE_KERNEL
19 struct sockaddr_pppol2tp sax;
20 int flags;
21 @@ -396,16 +395,7 @@ int start_pppd (struct call *c, struct p
22 struct call *sc;
23 struct tunnel *st;
24
25 - p = opts;
26 stropt[0] = strdup (PPPD);
27 - while (p)
28 - {
29 - stropt[pos] = (char *) malloc (strlen (p->option) + 1);
30 - strncpy (stropt[pos], p->option, strlen (p->option) + 1);
31 - pos++;
32 - p = p->next;
33 - }
34 - stropt[pos] = NULL;
35 if (c->pppd > 0)
36 {
37 l2tp_log(LOG_WARNING, "%s: PPP already started on call!\n", __FUNCTION__);
38 @@ -467,7 +457,6 @@ int start_pppd (struct call *c, struct p
39 snprintf (stropt[pos], 10, "%d", c->ourcid);
40 pos++;
41 }
42 - stropt[pos] = NULL;
43 }
44 else
45 #endif
46 @@ -497,6 +486,16 @@ int start_pppd (struct call *c, struct p
47 return -EINVAL;
48 }
49 stropt[pos++] = strdup(tty);
50 + }
51 +
52 + {
53 + struct ppp_opts *p = opts;
54 + while (p)
55 + {
56 + stropt[pos] = strdup (p->option);
57 + pos++;
58 + p = p->next;
59 + }
60 stropt[pos] = NULL;
61 }
62