From: Nathan Hintz Date: Sun, 4 Dec 2016 20:37:33 +0000 (-0800) Subject: pppd: fix pppol2tp option printing X-Git-Tag: ppp-2.4.8~30^2 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=afc4b130bbd6f5f5cd9baafdc7e836d8f6238deb;ds=sidebyside pppd: fix pppol2tp option printing PPPD crashes (SEGV) when the 'dump' or 'dryrun' options are specified and the 'pppol2tp' option is specified. The crash occurs because the 'pppol2tp' option value is not saved when the parameter is processed (in the pppol2tp plugin), but is then referenced when printed. This was encountered using xl2tpd and the l2tp_ppp kernel module. Modify the 'pppol2tp' plugin to save the option value. Signed-off-by: Nathan Hintz --- Note: This patch resolves issue #32 (https://github.com/paulusmack/ppp/issues/32). --- diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c index 0e28606..1be0ad2 100644 --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c @@ -148,6 +148,10 @@ static int setdevname_pppol2tp(char **argv) fatal("PPPoL2TP kernel driver not installed"); } + pppol2tp_fd_str = strdup(*argv); + if (pppol2tp_fd_str == NULL) + novm("PPPoL2TP FD"); + /* Setup option defaults. Compression options are disabled! */ modem = 0;