You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB

  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. so that plugin options like pppol2tp_debug_mark can be recognized by pppd.
  6. ---
  7. xl2tpd.c | 21 ++++++++++-----------
  8. 1 file changed, 10 insertions(+), 11 deletions(-)
  9. --- a/xl2tpd.c
  10. +++ b/xl2tpd.c
  11. @@ -382,7 +382,6 @@ int start_pppd (struct call *c, struct p
  12. /* char a, b; */
  13. char tty[512];
  14. char *stropt[80];
  15. - struct ppp_opts *p;
  16. #ifdef USE_KERNEL
  17. struct sockaddr_pppol2tp sax;
  18. int flags;
  19. @@ -396,16 +395,7 @@ int start_pppd (struct call *c, struct p
  20. struct call *sc;
  21. struct tunnel *st;
  22. - p = opts;
  23. stropt[0] = strdup (PPPD);
  24. - while (p)
  25. - {
  26. - stropt[pos] = (char *) malloc (strlen (p->option) + 1);
  27. - strncpy (stropt[pos], p->option, strlen (p->option) + 1);
  28. - pos++;
  29. - p = p->next;
  30. - }
  31. - stropt[pos] = NULL;
  32. if (c->pppd > 0)
  33. {
  34. l2tp_log(LOG_WARNING, "%s: PPP already started on call!\n", __FUNCTION__);
  35. @@ -467,7 +457,6 @@ int start_pppd (struct call *c, struct p
  36. snprintf (stropt[pos], 10, "%d", c->ourcid);
  37. pos++;
  38. }
  39. - stropt[pos] = NULL;
  40. }
  41. else
  42. #endif
  43. @@ -497,6 +486,16 @@ int start_pppd (struct call *c, struct p
  44. return -EINVAL;
  45. }
  46. stropt[pos++] = strdup(tty);
  47. + }
  48. +
  49. + {
  50. + struct ppp_opts *p = opts;
  51. + while (p)
  52. + {
  53. + stropt[pos] = strdup (p->option);
  54. + pos++;
  55. + p = p->next;
  56. + }
  57. stropt[pos] = NULL;
  58. }