ppp.git
6 months agopppoe: Custom host-uniq tag
Matteo Croce [Sat, 4 May 2019 16:48:53 +0000 (18:48 +0200)]
pppoe: Custom host-uniq tag

Add pppoe 'host-uniq' option to set an arbitrary
host-uniq tag instead of the pppd pid.
Some ISPs use such tag to authenticate the CPE,
so it must be set to a proper value to connect.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 months agoplugins/rp-pppoe: Fix compile errors
Paul Mackerras [Sat, 18 May 2019 08:18:53 +0000 (18:18 +1000)]
plugins/rp-pppoe: Fix compile errors

This fixes compile errors introduced in commit fcb076c ("Various fixes
for errors found by coverity static analysis (#109)", 2019-05-06).
Including pppd.h gave errors on some systems (e.g. recent Debian and
Ubuntu) regarding the type 'u_char' being undefined.  To fix this, we
simply take out the lines that define _POSIX_SOURCE.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 months agoVarious fixes for errors found by coverity static analysis (#109)
Jaroslav Škarvada [Sun, 5 May 2019 22:46:02 +0000 (00:46 +0200)]
Various fixes for errors found by coverity static analysis (#109)

Fixes #108

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
16 months agoMerge branch 'pppd_print_changes' of https://github.com/nlhintz/ppp into nlhintz...
Paul Mackerras [Sat, 23 Jun 2018 10:36:22 +0000 (20:36 +1000)]
Merge branch 'pppd_print_changes' of https://github.com/nlhintz/ppp into nlhintz-pppd_print_changes

16 months agoMerge branch 'pppoe-discovery-cleanup' of https://github.com/TDT-AG/ppp
Paul Mackerras [Sat, 23 Jun 2018 10:16:25 +0000 (20:16 +1000)]
Merge branch 'pppoe-discovery-cleanup' of https://github.com/TDT-AG/ppp

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
16 months agopppd: Use openssl for the DES instead of the libcrypt / glibc
Jaroslav Škarvada [Fri, 6 Apr 2018 12:27:18 +0000 (14:27 +0200)]
pppd: Use openssl for the DES instead of the libcrypt / glibc

It seems the latest glibc (in Fedora glibc-2.27.9000-12.fc29) dropped
libcrypt.  The libxcrypt standalone package can be used instead, but
it dropped the old setkey/encrypt API which ppp uses for DES.  There
is support for using openssl in pppcrypt.c, but it contains typos
preventing it from compiling and seems to be written for an ancient
openssl version.

This updates the code to use current openssl.

[paulus@ozlabs.org - wrote the commit description, fixed comment in
 Makefile.linux.]

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
17 months agoradius.c: Include CLASS attribute in radius_acct_interim and radius_acct_stop
Hauras Wigelstukas Alex [Fri, 17 Feb 2017 12:38:36 +0000 (19:38 +0700)]
radius.c: Include CLASS attribute in radius_acct_interim and radius_acct_stop

Some radius servers will not accept accounting packets without CLASS
attribute, so this includes it.

Signed-off-by: Hauras Wigelstukas Alex <sysop@880.ru>
17 months agopppd: Don't try to free(NULL - 1)
Paul Mackerras [Sat, 23 Jun 2018 07:26:42 +0000 (17:26 +1000)]
pppd: Don't try to free(NULL - 1)

A logic bug in update_script_environment() means that it can call
remove_script_env() even when the variable being removed is not
present in the script_env array.  The result of that is that
remove_script_env() will call free() with argument NULL - 1.
To fix this, we avoid calling remove_script_env() in this case.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
17 months agopppd: Fix compile warning due to comparing pointer to NUL character
Paul Mackerras [Sat, 23 Jun 2018 06:40:27 +0000 (16:40 +1000)]
pppd: Fix compile warning due to comparing pointer to NUL character

Evidently this means to check for arg pointing to an empty string,
not arg being NULL, since the ensuing error talks about the variable
name being missing.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
17 months agopppd: Fix printing call in print_option()
Vegard Nossum [Wed, 13 Jun 2018 10:38:53 +0000 (12:38 +0200)]
pppd: Fix printing call in print_option()

print_option() was in this case passing p/opt->addr2 as the format string
instead of the string to be printed (as a quoted string). That could lead
to a nasty crash.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
17 months agoHonor LDFLAGS
Jaroslav Škarvada [Wed, 4 Apr 2018 09:29:12 +0000 (11:29 +0200)]
Honor LDFLAGS

This makes the makefiles include $(LDFLAGS) as a parameter when
linking executables.  Distros use this as a way of applying linker
flags across all the executables they build.

[paulus@ozlabs.org - supplied the patch description]

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
20 months agoUse systemd's sd_notify with option up_sdnotify
Jacob Floyd [Sat, 11 Mar 2017 05:25:23 +0000 (23:25 -0600)]
Use systemd's sd_notify with option up_sdnotify

This adds an up_sdnotify option so that systemd services of
Type=notify can have pppd send the READY=1 signal to systemd
once a network protocol (typically IP) is up.

To use up_sdnotify, pppd must be compiled with SYSTEMD=y.

up_sdnotify is safe as a non-priveleged option because systemd will
ignore any notifications that it is not expecting. If systemd starts
pppd in a unit-file that is Type=notify, then (and only then) will it
handle the READY=1 signal. If systemd didn't start the process, it
ignroes any notifications unless the signaling process was started by a
service that systemd is monitoring (directly or indirectly, such as a
grandchild process in the same cgroup as a process that systemd started)
AND that service is Type=notify, AND that service is explicitly
configured to allow other processes to send a notification on behalf of
that service by setting NotifyAccess=all.

Also, the socket used is defined in an environment variable provided and
deleted by systemd, allowing system and user services to use a different
socket. I really don't think there's any way to use that socket (even via
the sd_notify api of their library) to gain elevated privileges.

Another reason that up_sdnotify is a non-priveleged option is for cases
where ppp should be started as a system service under a non-priveleged
account. There may be other issues with running ppp under other
accounts, but systemd does not require root--or other privileged--access
in order to use the notification feature. Instead the security for this
feature is provided at the process level in that systemd knows which
processes it did and did not start, and which processes those processes
started (ie other processes in the systemd unit's cgroup), as explained
above.

Signed-off-by: Jacob Floyd <cognifloyd@gmail.com>
23 months agopppoe-discovery: add options to tune discovery timeout and attempts
Martin Schiller [Thu, 7 Dec 2017 08:30:40 +0000 (09:30 +0100)]
pppoe-discovery: add options to tune discovery timeout and attempts

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
23 months agopppoe-discovery: add quiet-mode option
Martin Schiller [Thu, 7 Dec 2017 08:20:56 +0000 (09:20 +0100)]
pppoe-discovery: add quiet-mode option

In quiet-mode, no AC information is printed and the program
exits after the first PADO was received.

This is very useful if you use the tool in shell script
environments where you just want to evaluate the exit code.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
23 months agopppoe-discovery: use correct exit code depending on PADO replies.
Martin Schiller [Thu, 7 Dec 2017 07:55:53 +0000 (08:55 +0100)]
pppoe-discovery: use correct exit code depending on PADO replies.

This makes it possible to evaluate the exit code of the tool,
e.g. if you just want to know if there is an access concentrator
or not.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
23 months agopppoe-discovery: show real usage information
Martin Schiller [Thu, 7 Dec 2017 07:49:58 +0000 (08:49 +0100)]
pppoe-discovery: show real usage information

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2 years agoMerge branch 'master' of https://github.com/gburgessiv/ppp
Paul Mackerras [Sat, 18 Mar 2017 11:24:25 +0000 (22:24 +1100)]
Merge branch 'master' of https://github.com/gburgessiv/ppp

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 years agoMerge branch 'rp-pppoe-error' of https://github.com/snickl/lpppd
Paul Mackerras [Sat, 18 Mar 2017 11:20:37 +0000 (22:20 +1100)]
Merge branch 'rp-pppoe-error' of https://github.com/snickl/lpppd

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 years agoMerge branch 'sys-to-errno-h' of https://github.com/snickl/lpppd
Paul Mackerras [Sat, 18 Mar 2017 11:18:36 +0000 (22:18 +1100)]
Merge branch 'sys-to-errno-h' of https://github.com/snickl/lpppd

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 years agoMerge https://github.com/yasuoka/ppp
Paul Mackerras [Sat, 18 Mar 2017 11:12:36 +0000 (22:12 +1100)]
Merge https://github.com/yasuoka/ppp

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 years agoMerge branch 'lr/linux-4.8' of https://github.com/NetworkManager/ppp
Paul Mackerras [Sat, 18 Mar 2017 11:10:00 +0000 (22:10 +1100)]
Merge branch 'lr/linux-4.8' of https://github.com/NetworkManager/ppp

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 years agopppoe: include netinet/in.h before linux/in.h
Lubomir Rintel [Mon, 9 Jan 2017 13:34:23 +0000 (13:34 +0000)]
pppoe: include netinet/in.h before linux/in.h

This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
included before <linux/in.h> otherwise the earlier, unaware of the latter,
tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't work
alone anymore, since it pulls the headers in the wrong order, so we better
include <netinet/in.h> early.

2 years agopppd: fix pppol2tp option printing
Nathan Hintz [Sun, 4 Dec 2016 20:37:33 +0000 (12:37 -0800)]
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 <nlhintz@hotmail.com>
---

Note: This patch resolves issue #32 (https://github.com/paulusmack/ppp/issues/32).

2 years agopppd: add missing parameter in call to 'printer'
Nathan Hintz [Sun, 4 Dec 2016 20:35:50 +0000 (12:35 -0800)]
pppd: add missing parameter in call to 'printer'

The 'arg' parameter is missing from a call to the 'printer'
function; modify the call to use the correct parameter set.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
2 years agoppp: fix printing of DNS/WINS addresses
Nathan Hintz [Sat, 4 Apr 2015 19:26:05 +0000 (12:26 -0700)]
ppp: fix printing of DNS/WINS addresses

Options "ms-dns" and "ms-wins" may be specified several times.  This
allows the second occurrence to be printed.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
3 years agopppd: Provide error() implementation in pppoe-discovery
Stefan Nickl [Wed, 10 Aug 2016 14:52:12 +0000 (16:52 +0200)]
pppd: Provide error() implementation in pppoe-discovery

The pppoe-discovery program calls error() from the CHECK_ROOM macro
defined in pppoe.h. Since pppoe-discovery is a standalone program not
linked with the rest of pppd, the only way this could build is by
linking to glibc's proprietary error(3) function instead of the function
of the same name (but with different arguments) defined in pppd/utils.c.

So with glibc this builds, but will probably crash when the assertion is
triggered. As the assertion is unlikely to fail, nobody has noticed.

The build however fails with musl libc or uClibc since they don't
provide the doppelganger.

Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
3 years agopppd: Remove unused declaration of ttyname.
George Burgess IV [Sat, 10 Sep 2016 00:36:54 +0000 (17:36 -0700)]
pppd: Remove unused declaration of ttyname.

Signed-off-by: George Burgess IV <george@gbiv.net>
3 years agopppd: allow use of arbitrary interface names
Paul Mackerras [Tue, 23 Aug 2016 06:10:21 +0000 (16:10 +1000)]
pppd: allow use of arbitrary interface names

This is a modified version of a patch from openSUSE that enables PPP interfaces
to be called arbitrary names, rather than simply pppX where X is the unit
number.

The modifications from the stock openSUSE patch are:
- refresh patch on top of 018_ip-up_option.diff
- fix a printf format-string vulnerability in pppd/main.c:set_ifunit()
- clarify the pppd.8 manpage additions
- patch pppstats/pppstats.c to query renamed interfaces without complaint

Origin: SUSE
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646
Forwarded: no
Reviewed-by: Chris Boot <bootc@debian.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
3 years agoChange include from sys/errno.h to errno.h
Stefan Nickl [Wed, 10 Aug 2016 19:32:21 +0000 (21:32 +0200)]
Change include from sys/errno.h to errno.h

According to POSIX, the canonical location for errno.h is on the top level.

Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
3 years agoMerge branch 'plog-usability' of https://github.com/mityada/ppp
Paul Mackerras [Sat, 9 Jul 2016 11:02:05 +0000 (12:02 +0100)]
Merge branch 'plog-usability' of https://github.com/mityada/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
3 years agoplog: count only relevant lines from syslog
Dmitry Deshevoy [Thu, 31 Mar 2016 19:39:32 +0000 (23:39 +0400)]
plog: count only relevant lines from syslog

Closes paulusmack/ppp#42

3 years agoFix a typo in comment. Diff from Yuuichi Someya.
YASUOKA Masahiko [Wed, 16 Mar 2016 04:39:19 +0000 (13:39 +0900)]
Fix a typo in comment.  Diff from Yuuichi Someya.

4 years agoMerge branch 'send-padt-on-disconnect' of git://github.com/farnz/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:32:43 +0000 (20:32 +1000)]
Merge branch 'send-padt-on-disconnect' of git://github.com/farnz/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agoMerge branch 'no-error-on-already-closed' of git://github.com/farnz/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:31:15 +0000 (20:31 +1000)]
Merge branch 'no-error-on-already-closed' of git://github.com/farnz/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agoMerge branch 'master' of git://github.com/pprindeville/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:28:39 +0000 (20:28 +1000)]
Merge branch 'master' of git://github.com/pprindeville/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agoMerge branch 'bug_fix' of git://github.com/radaiming/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:27:41 +0000 (20:27 +1000)]
Merge branch 'bug_fix' of git://github.com/radaiming/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agoMerge branch 'master' of git://github.com/vapier/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:16:16 +0000 (20:16 +1000)]
Merge branch 'master' of git://github.com/vapier/ppp

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agoMerge branch 'master' of https://github.com/ncopa/ppp
Paul Mackerras [Fri, 14 Aug 2015 10:11:23 +0000 (20:11 +1000)]
Merge branch 'master' of https://github.com/ncopa/ppp

This merges in one commit, which adds the new "defaultroute-metric" option.

Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agopppd: Fix ccp_cilen calculated size if both deflate_correct and deflate_draft are...
Sylvain Rochet [Tue, 24 Mar 2015 20:21:40 +0000 (21:21 +0100)]
pppd: Fix ccp_cilen calculated size if both deflate_correct and deflate_draft are enabled

This fixes a bug where ccp_cilen() will return 4 bytes less than
necessary for the addci buffer if both deflate_correct and
deflate_draft are enabled.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agopppd: Fix ccp_options.mppe type
Sylvain Rochet [Tue, 24 Mar 2015 23:25:18 +0000 (00:25 +0100)]
pppd: Fix ccp_options.mppe type

This corrects the type of ccp_options.mppe; it is actually a bitfield of
MPPE_OPT_* and not a boolean.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
4 years agopppd: ipxcp: Prevent buffer overrun on remote router name
Paul Mackerras [Fri, 14 Aug 2015 07:56:26 +0000 (17:56 +1000)]
pppd: ipxcp: Prevent buffer overrun on remote router name

This fixes an if condition to prevent a possible 1-byte overrun
on ipxcp_hisoptions[0].name.

Reported-by: "Sabas Rosales, Blanca E" <blanca.e.sabas.rosales@intel.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agoSend PADT on PPPoE disconnect
Simon Farnsworth [Sun, 1 Mar 2015 11:53:58 +0000 (11:53 +0000)]
Send PADT on PPPoE disconnect

Once we've terminated the PPP session, there is no chance of a PPP layer
disconnect. Some PPPoE relays don't detect the PPP session going down, and
depend on a long timeout or a PPPoE PADT to terminate the session.

Send a PADT on disconnect to work around these buggy relays.

Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
4 years agoSuppress false error message on PPPoE disconnect
Simon Farnsworth [Sun, 1 Mar 2015 11:49:06 +0000 (11:49 +0000)]
Suppress false error message on PPPoE disconnect

Once the kernel handles PPPoE PADTs correctly[1], a PADT triggered
disconnect will result in EALREADY when pppd tries to clear the session ID.

Simply ignore the error if, and only if, the error is EALREADY

[1] https://patchwork.ozlabs.org/patch/444717/

Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
4 years agopppd: Fix sign-extension when displaying bytes in octal
Philip A. Prindeville [Sat, 20 Dec 2014 00:52:58 +0000 (17:52 -0700)]
pppd: Fix sign-extension when displaying bytes in octal

print_string() displays characters as \\%.03o but without first
casting it from "char" to "unsigned char" so it gets sign-extended
to an int. This causes output like \37777777630 instead of \230.

Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
4 years ago scripts: Avoid killing wrong pppd
radaiming [Sat, 13 Dec 2014 06:42:34 +0000 (14:42 +0800)]
 scripts: Avoid killing wrong pppd

 poff could kill other pppd processes when there are many pppd
 running on different serial port.

Signed-off-by: Ming Dai <radaiming@gmail.com>
5 years agopppd: add support for defaultroute-metric option
Natanael Copa [Tue, 3 Jun 2014 08:53:47 +0000 (08:53 +0000)]
pppd: add support for defaultroute-metric option

This allows user to specify the 'metric' (or 'prio') for the default
route set by pppd. This is useful in multi-ISP setups where there
might be more than one default gateway.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agoabort on errors in subdir builds
Martin von Gagern [Sun, 10 Aug 2014 02:44:45 +0000 (22:44 -0400)]
abort on errors in subdir builds

The current recursive loops do not check the exit status of make
in subdirs which leads to `make` passing even when a subdir failed
to compile or install.

URL: https://bugs.gentoo.org/334727
Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
5 years agoUpdate README and patchlevel for 2.4.7 release ppp-2.4.7
Paul Mackerras [Sat, 9 Aug 2014 12:31:39 +0000 (22:31 +1000)]
Update README and patchlevel for 2.4.7 release

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agoMerge branch 'master' of git://github.com/cmcqueen/ppp
Paul Mackerras [Fri, 1 Aug 2014 11:41:27 +0000 (21:41 +1000)]
Merge branch 'master' of git://github.com/cmcqueen/ppp

This merges in one commit, which adds the new "stop-bits" option.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agowinbind plugin: Add -DMPPE=1 to eliminate compiler warnings
Paul Mackerras [Fri, 1 Aug 2014 11:40:18 +0000 (21:40 +1000)]
winbind plugin: Add -DMPPE=1 to eliminate compiler warnings

When compiling the winbind plugin, we need an equivalent definition
of the MPPE symbol to that which applied when the main pppd was
compiled.  This adds that to Makefile.linux.

Reported-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Fix a stack variable overflow in MSCHAP-v2
John Crispin [Fri, 1 Aug 2014 08:12:36 +0000 (18:12 +1000)]
pppd: Fix a stack variable overflow in MSCHAP-v2

This fixes a bug introduced in 08ef47ca ("pppd: Make MSCHAP-v2 cope
better with packet loss").

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Eliminate memory leak with multiple instances of a string option
Paul Mackerras [Fri, 1 Aug 2014 07:32:15 +0000 (17:32 +1000)]
pppd: Eliminate memory leak with multiple instances of a string option

This eliminates the memory leak which occurs when a user gives the
same string option multiple times.  Although the leak is trivial under
normal conditions, the fact that it can be triggered by the user
means that it may be of interest to attackers, so let's plug the leak.

This also means that any o_string option without OPT_STATIC set needs
to have opt->addr pointing to a pointer which starts out NULL.  That
is the case for all current uses of o_string.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Eliminate potential integer overflow in option parsing
Paul Mackerras [Fri, 1 Aug 2014 06:05:42 +0000 (16:05 +1000)]
pppd: Eliminate potential integer overflow in option parsing

When we are reading in a word from an options file, we maintain a count
of the length we have seen so far in 'len', which is an int.  When len
exceeds MAXWORDLEN - 1 (i.e. 1023) we cease storing characters in the
buffer but we continue to increment len.  Since len is an int, it will
wrap around to -2147483648 after it reaches 2147483647.  At that point
our test of (len < MAXWORDLEN-1) will succeed and we will start writing
characters to memory again.

This may enable an attacker to overwrite the heap and thereby corrupt
security-relevant variables.  For this reason it has been assigned a
CVE identifier, CVE-2014-3158.

This fixes the bug by ceasing to increment len once it reaches MAXWORDLEN.

Reported-by: Lee Campbell <leecam@google.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agoradius: Fix realms-config-file option
Paul Mackerras [Sat, 12 Jul 2014 00:41:20 +0000 (10:41 +1000)]
radius: Fix realms-config-file option

Since radrealms_config is an array of char not a pointer to char, we
need OPT_STATIC in the configuration option that points to it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Eliminate some unnecessary ifdefs
Paul Mackerras [Sun, 9 Mar 2014 06:48:07 +0000 (17:48 +1100)]
pppd: Eliminate some unnecessary ifdefs

Since we only support Linux and Solaris these days, statements like:

#if defined(SOL2) || defined(__linux__)

are always true and can be removed, along with anything in the #else
branch of such a #if, and anything within a #if with the inverse
condition.  Furthermore, inside a #if !defined(__linux__) we know
that SOL2 must be defined.

This simplifies the code along these lines.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Add declarations to eliminate compile warnings
Paul Mackerras [Sun, 9 Mar 2014 06:43:11 +0000 (17:43 +1100)]
pppd: Add declarations to eliminate compile warnings

This adds declarations for sif6up, sif6down and setifstate in order
to eliminate warnings about implicit function declarations.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppol2tp: Connect up/down events to notifiers and add IPv6 ones
Benjamin Cama [Wed, 26 Feb 2014 18:13:40 +0000 (19:13 +0100)]
pppol2tp: Connect up/down events to notifiers and add IPv6 ones

Connect ip up/down events instead of using hooks, and add IPv6 up/down
events notifications too, so that we signal IPv6-only sessions
correctly; otherwise, they may get taken down because the L2TP daemon
has not received any notification.

Signed-off-by: Benjamin Cama <benjamin.cama@telecom-bretagne.eu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Separate IPv6 handling for sifup/sifdown
Benjamin Cama [Wed, 26 Feb 2014 18:13:39 +0000 (19:13 +0100)]
pppd: Separate IPv6 handling for sifup/sifdown

The current code is buggy regarding handling of link state when using
both IPCP and IPv6CP: if IPv6CP has been set up and if during IPCP
negociation, ipcp_up() fails, it will incorrectly take the interface
down. The simple solution here is to change the platform code to do the
same as on Solaris: separate IPv6CP up/down state handling with sif6up()
and sif6down(), so that we really know when the interface is allowed to
go down.

Signed-off-by: Benjamin Cama <benjamin.cama@telecom-bretagne.eu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Add option "stop-bits" to set number of serial port stop bits.
Craig McQueen [Mon, 30 Sep 2013 05:01:20 +0000 (15:01 +1000)]
pppd: Add option "stop-bits" to set number of serial port stop bits.

This allows for configuring the serial device for 2 stop bits (default is 1 stop bit).

Signed-off-by: Craig McQueen <craig.mcqueen@beamcommunications.com>
5 years agoUpdate README and patchlevel for 2.4.6 release
Paul Mackerras [Thu, 2 Jan 2014 04:42:08 +0000 (15:42 +1100)]
Update README and patchlevel for 2.4.6 release

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agoconfig: Update Solaris compiler options and enable CHAPMS and IPV6
Paul Mackerras [Thu, 2 Jan 2014 04:29:15 +0000 (15:29 +1100)]
config: Update Solaris compiler options and enable CHAPMS and IPV6

As suggested by James Carlson.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Accept IPCP ConfAck packets containing MS-WINS options
Bertram Felgenhauer [Thu, 2 Jan 2014 04:20:35 +0000 (15:20 +1100)]
pppd: Accept IPCP ConfAck packets containing MS-WINS options

Since last week I'm seeing IPCP negotiations going like this (and
eventually failing) when connecting to my ISP:

Jul 11 20:03:25 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfNak id=0x2 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfAck id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:27 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
...

with the last two lines repeating until the IPCP error limit is
reached. As you can see, the peer added two extra fields in the
ConfNak reply. This is allowed, and indeed the following sent
ConfReq packet reflects this. However, when the ConfAck packet
is received, pppd discards it as invalid, because of the ms-wins
fields.

This fixes it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
5 years agopppd: Don't crash if NULL pointer passed to vslprintf for %q or %v
Paul Mackerras [Thu, 2 Jan 2014 04:00:12 +0000 (15:00 +1100)]
pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v

This is to avoid crashes like that reported in
https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1244714

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agochat, pppd: Use \e instead of \\ in man pages
Paul Mackerras [Mon, 10 Jun 2013 02:59:34 +0000 (12:59 +1000)]
chat, pppd: Use \e instead of \\ in man pages

This avoids the need to double up the backslashes in some places, and
eliminates some errors reported by doclifter.

Reported-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agoradius: Handle additional attributes
Vadim Zotov [Fri, 11 Aug 2006 08:06:24 +0000 (08:06 +0000)]
radius: Handle additional attributes

This allows radius plugin to handle additional radius attributes:

- Filter-ID (sets RADIUS_FILTER_ID env. var.)
- Framed-Route (sets RADIUS_FRAMED_ROUTE env. var.)
- Idle-Timeout
- NAS-IP-Address
- MS-Primary-DNS-Server
- MS-Secondary-DNS-Server
- MS-Primary-NBNS-Server
- MS-Secondary-NBNS-Server

[paulus@samba.org: Fixed formatting and simplified code making
 dns-1 and dns-2 default to each other, similarly wins-1 and wins-2]

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agoREADME.pppoe: Minor semantic fix
Paul Mackerras [Sun, 9 Jun 2013 12:11:32 +0000 (22:11 +1000)]
README.pppoe: Minor semantic fix

From Debian ppp patch set.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agochat: Fix some text that was intended to be literal
Paul Mackerras [Sun, 9 Jun 2013 12:10:47 +0000 (22:10 +1000)]
chat: Fix some text that was intended to be literal

This escapes a \c and adds a .br so that the "$ \c" comes out in the
nroff output, instead of the \c being interpreted as a line continuation.
This seems to be what was intended and makes sense as part of the chat
script fragment.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Fix segfault in update_db_entry()
Martin.Lottermoser@t-online.de [Sun, 9 Jun 2013 12:04:25 +0000 (22:04 +1000)]
pppd: Fix segfault in update_db_entry()

The function update_db_entry() may only be called if pppdb is not NULL;
unfortunately in one situation it is.  Other calls to update_db_entry()
are protected against this, see, e.g., the end of script_setenv().

This is from the Debian pppd patches, and fixes Debian bug 308136
(SEGV in pppd).

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppoatm: Remove explicit loading of pppoatm kernel module
Paul Mackerras [Sun, 9 Jun 2013 02:20:34 +0000 (12:20 +1000)]
pppoatm: Remove explicit loading of pppoatm kernel module

The kernel does this automatically itself.  Patch from debian package.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agoplugins/radius: Handle bindaddr keyword in radiusclient.conf
Adrian Ban [Wed, 3 Apr 2013 20:19:52 +0000 (23:19 +0300)]
plugins/radius: Handle bindaddr keyword in radiusclient.conf

This adds code to the radius plugin to handle the bindaddr keyword in
/etc/radiusclient/radiusclient.conf, thus allowing the administrator
to specify which local IP address to use when sending packets to the
radius server.

This is very common for setups where the router has multiple
interfaces for upstream and you don't know which connection is active.
In this case sometimes the packet uses the IP of interface 1 and
sometimes uses the IP of interface 2.  With this patch (adapted from
radiusclient-ng) you can specify the IP of the loopback address, and
the plugin will bind to that IP and send the packet with a fixed IP
every time.

Slimmed a little bit at James Carlson's suggestion.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppstats: Fix undefined macro in man page
Paul Mackerras [Mon, 11 Mar 2013 08:40:59 +0000 (19:40 +1100)]
pppstats: Fix undefined macro in man page

This resulted in the word "pppstats" missing at one point.  Fix from
Debian package.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Default exit status to EXIT_CONNECT_FAILED during connection phase
Paul Mackerras [Mon, 11 Mar 2013 08:30:21 +0000 (19:30 +1100)]
pppd: Default exit status to EXIT_CONNECT_FAILED during connection phase

The rp-pppoe plugin doesn't set the exit status in its connect
function, resulting in pppd exiting with a status of EXIT_OK (0)
if rp-pppoe fails to connect.  This fixes the problem for rp-pppoe
and any other plugins that don't set the exit status explicitly
by making the status default to EXIT_CONNECT_FAILED if the channel's
connect function fails.

Reported-by: Peter Warasin <peter@endian.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Add master_detach option
Paul Mackerras [Sat, 2 Mar 2013 09:25:28 +0000 (20:25 +1100)]
pppd: Add master_detach option

This adds a new option, master_detach, to allow pppd to detach from
the controlling terminal when it is the multilink bundle master but
its own link has terminated, even if the nodetach option has been
given.

Requested-by: Stephen Marron <sfm@boxfusion.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Fix man page description of case when remote IP address isn't known
Paul Mackerras [Sat, 2 Mar 2013 06:30:25 +0000 (17:30 +1100)]
pppd: Fix man page description of case when remote IP address isn't known

We use a made-up address in the 10.x.x.x range, rather than refusing
to bring up the link.

Reported-by: Matthijs Kooijman
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agochat: Fix *roff errors in the man page
Paul Mackerras [Sun, 3 Feb 2013 10:53:28 +0000 (21:53 +1100)]
chat: Fix *roff errors in the man page

Fixes these errors:

$ nroff -man -ww chat/chat.8
chat/chat.8:227: warning: number register `"' not defined
chat/chat.8:291: warning: macro `'' not defined
chat/chat.8:368: warning: macro `PR' not defined

Patch partly from Debian BTS by Bjarni Ingi Gislason.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agoplugins/passprompt: Fix potential out-of-bounds array reference
Paul Mackerras [Sun, 3 Feb 2013 10:44:11 +0000 (21:44 +1100)]
plugins/passprompt: Fix potential out-of-bounds array reference

From Debian BTS, fix suggested by Timo Weingärtner.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Fix spelling errors in man page
Paul Mackerras [Sun, 3 Feb 2013 10:37:50 +0000 (21:37 +1100)]
pppd: Fix spelling errors in man page

From Fedora patch.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agochat: Correct spelling errors in the man page
Paul Mackerras [Sun, 3 Feb 2013 10:35:00 +0000 (21:35 +1100)]
chat: Correct spelling errors in the man page

From Fedora patch.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppdump: Eliminate some compiler warnings
Paul Mackerras [Sun, 3 Feb 2013 06:51:12 +0000 (17:51 +1100)]
pppdump: Eliminate some compiler warnings

gcc lacks the -fyes-actually-I-do-know-the-C-operator-precedence-rules
option, so add some parentheses to shut it up.  Also remove some unused
variables.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Arrange to use logwtmp from libutil on Linux
Paul Mackerras [Sun, 3 Feb 2013 06:35:43 +0000 (17:35 +1100)]
pppd: Arrange to use logwtmp from libutil on Linux

Idea stolen from Fedora ppp patches.

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Take out unused %r conversion completely
Paul Mackerras [Sun, 3 Feb 2013 03:56:18 +0000 (14:56 +1100)]
pppd: Take out unused %r conversion completely

This just removes some code surrounded by #if 0/#endif, which Fedora
apparently feels the need to patch...

Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agoppp: ignore unrecognised radiusclient configuration directives
Charlie Brady [Thu, 30 Aug 2012 23:24:00 +0000 (19:24 -0400)]
ppp: ignore unrecognised radiusclient configuration directives

New versions of freeradius occasionally add configuration keywords.
There's no reason that the pppd plugin should fail when that occurs.

Signed-off-by: Charlie Brady <charlieb@budge.apana.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6 years agopppd: Clarify circumstances where DNS1/DNS2 environment variables are set
Paul Mackerras [Wed, 23 Jan 2013 11:59:45 +0000 (22:59 +1100)]
pppd: Clarify circumstances where DNS1/DNS2 environment variables are set

Make it clear that the DNS1 and DNS2 environment variables being set
for scripts doesn't depend on whether the usepeerdns option was given,
only on whether the peer provided DNS server addresses.

Reported-by: William McCall
Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agorp-pppoe plugin: Import some fixes from rp-pppoe-3.10
Paul Mackerras [Sun, 20 May 2012 09:36:23 +0000 (19:36 +1000)]
rp-pppoe plugin: Import some fixes from rp-pppoe-3.10

* Make timeout for PADO/PADS be the total time we wait for, not the
  time that each individual select call waits for.

* Open the discovery socket in PPPOEConnectDevice() rather than
  discovery().

* Open the session socket earlier in PPPOEConnectDevice() to avoid
  missing session packets sent by the server just after the PADS
  packet.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Eliminate some warnings
Paul Mackerras [Sun, 20 May 2012 07:09:16 +0000 (17:09 +1000)]
pppd: Eliminate some warnings

auth.c: In function ‘start_link’:
auth.c:556:11: warning: variable ‘msg’ set but not used [-Wunused-but-set-variable]
utils.c: In function ‘logit’:
utils.c:655:9: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
sys-linux.c: In function ‘ether_to_eui64’:
sys-linux.c:2881:9: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Don't crash if crypt() returns NULL
Paul Mackerras [Sun, 20 May 2012 04:14:55 +0000 (14:14 +1000)]
pppd: Don't crash if crypt() returns NULL

It is possible for crypt() to return NULL under some circumstances,
so we need to check the return value before passing it to strcmp().
If we do get NULL from crypt(), treat it as an authentication failure.

Reported-by: Paul Wouters <pwouters@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agocontrib: Fix pppgetpass.gtk compilation
Peter Meiser [Tue, 24 Apr 2012 09:27:33 +0000 (03:27 -0600)]
contrib: Fix pppgetpass.gtk compilation

We need to use pkg-config not gtk-config these days.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Enable IPV6 by default and fix some warnings
Paul Mackerras [Sun, 20 May 2012 02:01:48 +0000 (12:01 +1000)]
pppd: Enable IPV6 by default and fix some warnings

Fixes these warnings:

ipv6cp.c: In function ‘ipv6_check_options’:
ipv6cp.c:1106:2: warning: implicit declaration of function ‘ether_to_eui64’ [-Wimplicit-function-declaration]
ipv6cp.c:1133:2: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
ipv6cp.c:1133:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Notify IPv6 up/down as we do for IPv4
Markus Becker [Wed, 14 Mar 2012 15:48:44 +0000 (16:48 +0100)]
pppd: Notify IPv6 up/down as we do for IPv4

This adds support for notification of IPv6 up/down, mainly for the sake of
NetworkManager.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agorp-pppoe plugin: Print leading zeros in MAC address
Benjamin LaHaise [Wed, 7 Dec 2011 19:44:21 +0000 (14:44 -0500)]
rp-pppoe plugin: Print leading zeros in MAC address

The rp-pppoe pppd plugin prints MAC addresses without the leading 0.
That looks odd, so this adds the leading 0.

Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agoscripts: Make poff ignore extra arguments to pppd
Jason St. John [Fri, 14 Oct 2011 04:08:14 +0000 (00:08 -0400)]
scripts: Make poff ignore extra arguments to pppd

This allows /usr/bin/poff to properly end a /usr/sbin/pppd process
that was started with additional arguments.

The problem with the current poff script is on line 93 where the
output of `ps axw` is piped into grep. The current regular expression
that grep searches for prevents the PID of the specified pppd process
from being found, which results in the script failing to terminate the
pppd process. The output of poff in that case would be the following:

/usr/bin/poff: I could not find a pppd process for provider 'cit-vpn'.
None stopped.

The reason for this is that the " *\$" at the end of the regular
expression does not match the output of the following example from `ps
axw`:

11846 ?        Ss     0:00 /usr/sbin/pppd call cit-vpn updetach persist

To resolve this issue, I removed the troublesome part of the regular
expression (" *\$") and now grep can properly match the example output
provided above.

I have tested this using ppp 2.4.5-2 in conjunction with
pptpclient-1.7.2-3 on Arch Linux x86_64.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Make MSCHAP-v2 cope better with packet loss
Deomid Ryabkov [Sat, 31 Mar 2012 04:14:23 +0000 (05:14 +0100)]
pppd: Make MSCHAP-v2 cope better with packet loss

This implements response caching for MSCHAP-v2.  It caches our
responses and the responses we expect from the peer.  MSCHAP-v2 is
unusual in that the authenticatee's CHAP-Response contains what is
effectively a challenge to the authenticator, and the authenticator's
CHAP-Success packet contains a response to that challenge.  Having
the response cache lets us (a) answer challenges consistently and
(b) cope with a CHAP-Success packet that corresponds to one of our
CHAP-Responses that wasn't the last one we sent.

This solves a problem where MSCHAP-v2 does not handle replay/retry
properly.  Here's what a typical normal session looks like:

Mar 31 02:47:40 nbm pppd[12895]: rcvd [CHAP Challenge id=0x37 <7ac9de47e66fc440e4b142e28c1a2064>, name = "jeeves"]
Mar 31 02:47:40 nbm pppd[12895]: sent [CHAP Response id=0x37 <12986c68266e0d60e7e0de9c8326073200000000000000005da37272ed71b6743f65bc00f7ae2ca148db9210627b646500>, name = "murka"]
Mar 31 02:47:40 nbm pppd[12895]: rcvd [CHAP Success id=0x37 "S=ED8FB5829C8049C331AAE0C570F63F8B558DEA2C M=Access granted"]
Mar 31 02:47:40 nbm pppd[12895]: CHAP authentication succeeded

however, this breaks down if, for whatever reason - packet loss,
reordering or whatnot - server sends a second challenge that arrives
before the response - it changes client's expectation and the
authentication fails.  Here's how it looks in the logs:

Mar 31 02:47:47 nbm pppd[13014]: rcvd [CHAP Challenge id=0x8a <5070251e94455e2155d2cf4d698d23c9>, name = "jeeves"]
Mar 31 02:47:47 nbm pppd[13014]: sent [CHAP Response id=0x8a <14d788f835add58b60d2aff362c183160000000000000000d780f3849076e9e013272f67bcb8c8cfa0e9b51c0fe3ee2100>, name = "murka"]
Mar 31 02:47:48 nbm pppd[13014]: rcvd [CHAP Challenge id=0x8a <5070251e94455e2155d2cf4d698d23c9>, name = "jeeves"]
Mar 31 02:47:48 nbm pppd[13014]: sent [CHAP Response id=0x8a <df950da43b90e235048810469d3283dd0000000000000000ace042b145f5eb9f118349b5672d4829eb5038192050a90b00>, name = "murka"]
Mar 31 02:47:48 nbm pppd[13014]: rcvd [CHAP Success id=0x8a "S=ABAEA4DF5601FADF25F8729455D39BF6D971D501 M=Access granted"]
Mar 31 02:47:48 nbm pppd[13014]: MS-CHAPv2 mutual authentication failed.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agoRemove old version of Linux if_pppol2tp.h
Paul Mackerras [Sun, 20 May 2012 06:48:17 +0000 (16:48 +1000)]
Remove old version of Linux if_pppol2tp.h

This has been in the Linux kernel source now for long enough that we
can rely on getting a usable version from /usr/include on all
distributions that we care about.  The version we have here had started
to lag behind what is in the Linux kernel, causing compilation errors
due to struct pppol2tpv3_addr being undefined.  Removing our local
version means we will use what is in /usr/include instead.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7 years agopppd: Don't unconditionally disable VJ compression under Linux
Paul Mackerras [Sun, 6 May 2012 07:32:26 +0000 (17:32 +1000)]
pppd: Don't unconditionally disable VJ compression under Linux

We were always clearing vjcomp if it was set, so VJ header compression
was never getting enabled.  This adds a pair of braces so it only gets
disabled if there was an error.

Reported by Stanislav Litvinenko.

Signed-off-by: Paul Mackerras <paulus@samba.org>
8 years agopppdump: Fix printfs with insufficient arguments
Paul Mackerras [Sat, 5 Mar 2011 04:10:57 +0000 (15:10 +1100)]
pppdump: Fix printfs with insufficient arguments

Reported-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
9 years agochat: Allow TIMEOUT value to come from environment variable
Ashok Rao [Sat, 11 Sep 2010 12:14:48 +0000 (22:14 +1000)]
chat: Allow TIMEOUT value to come from environment variable

This allows the TIMEOUT value to be obtained from the environment
using the $ENVVAR syntax.

Signed-off-by: Paul Mackerras <paulus@samba.org>
9 years agorp-pppoe: allow MTU to be increased up to 1500
Simon Arlott [Tue, 4 May 2010 19:06:06 +0000 (20:06 +0100)]
rp-pppoe: allow MTU to be increased up to 1500

The ethernet data limit on rp-pppoe has been increased to 1508 to
allow an MTU of 1500 to be used. To prevent problems the interface
MTU is checked and used to lower the configured MTU/MRU.

If MIN(MTU/MRU) is > 1492, PPP-Max-Payload is added to PADI and
PADR. If PPP-Max-Payload is received in PADO or PADS, it will be
used to lower the configured MTU/MRU as required.

The MTU/MRU settings are stored and reloaded whenever a connection
is made, to allow for the peer or interface MTU/MRU to increase if
used with persist option.

Conforming to RFC4638, if no PPP-Max-Payload is received, the
negotiated MRU will be limited to 1492.

9 years agoFix quote handling in configuration files to be more like shell quoting.
James Carlson [Mon, 23 Aug 2010 14:03:07 +0000 (10:03 -0400)]
Fix quote handling in configuration files to be more like shell quoting.

The specific case that confused a user was:
ROUTES="216.220.192.0/20 10.0.100.0/24"
which was interpreted as two separate words, merely because the first quote
mark was in the middle of a word.

9 years agoNit: use _exit when exec fails and restrict values to 0-255 per POSIX.
James Carlson [Mon, 23 Aug 2010 14:01:48 +0000 (10:01 -0400)]
Nit: use _exit when exec fails and restrict values to 0-255 per POSIX.

9 years agoAdd set and reset options to control environment variables for scripts.
James Carlson [Mon, 23 Aug 2010 13:59:56 +0000 (09:59 -0400)]
Add set and reset options to control environment variables for scripts.