]> git.ozlabs.org Git - ppp.git/log
ppp.git
7 weeks agoUpdate README to fix an error ppp-2.5.1
Paul Mackerras [Wed, 18 Sep 2024 04:30:31 +0000 (14:30 +1000)]
Update README to fix an error

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7 weeks agoUpdate version to 2.5.1 for release
Paul Mackerras [Wed, 18 Sep 2024 03:54:10 +0000 (13:54 +1000)]
Update version to 2.5.1 for release

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7 weeks agoUpdate README for 2.5.1 release
Paul Mackerras [Wed, 18 Sep 2024 03:59:06 +0000 (13:59 +1000)]
Update README for 2.5.1 release

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7 weeks agoscripts: Update Makefile.am to reflect chatchat removal
Paul Mackerras [Wed, 18 Sep 2024 04:00:22 +0000 (14:00 +1000)]
scripts: Update Makefile.am to reflect chatchat removal

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7 weeks agoRemove chatchat program
Paul Mackerras [Wed, 18 Sep 2024 03:49:38 +0000 (13:49 +1000)]
Remove chatchat program

It is old and unmaintained and I don't think anyone uses it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7 weeks agochat: Add copyright notice
Paul Mackerras [Wed, 18 Sep 2024 01:57:45 +0000 (11:57 +1000)]
chat: Add copyright notice

This adds a copyright notice in my name with MIT licence permissions
to this file.  The reason is primarily to provide a concrete statement
of permission to use, copy, modify and distribute the program, for the
sake of those who are uncertain about meaning of the public domain.
See for example https://github.com/ppp-project/ppp/issues/474 .
Given that I have maintained this program for 25 years, it seems
reasonable for it to be my copyright on it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
8 weeks agoDon't overwrite configuration files in <sysconfdir>/ppp (#518)
Paul Mackerras [Sat, 14 Sep 2024 03:31:56 +0000 (13:31 +1000)]
Don't overwrite configuration files in <sysconfdir>/ppp (#518)

This renames the configuration files in etc.ppp/ to have ".example"
on the end of their names.  This is so that when they are copied to
<sysconfdir>/ppp (often /etc/ppp), they don't overwrite existing
pppd configuration files, and it is clear that they are just examples.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Don't include pppdconf.h in the tarball (#517)
Paul Mackerras [Fri, 13 Sep 2024 04:08:56 +0000 (14:08 +1000)]
pppd: Don't include pppdconf.h in the tarball (#517)

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoRemove Solaris module code (#515)
Paul Mackerras [Thu, 12 Sep 2024 03:57:50 +0000 (13:57 +1000)]
Remove Solaris module code (#515)

This code has not been updated for a long time, and nominally targets
an OS whose owner (Oracle) has all but abandoned.  It includes
zlib code which has CVEs against it, and it is unknown whether any
of them would be exploitable in this context.

Illumos, which is an OpenSolaris fork, has forked Solaris-native
drivers, which should probably work with the user-space pppd code
here.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoUpdate README files
Paul Mackerras [Thu, 12 Sep 2024 03:55:45 +0000 (13:55 +1000)]
Update README files

- Update README with more of the changes in 2.5.1

- Update the other READMEs lightly, mostly to do with how features are
  included or excluded with the new build system.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd/crypto: Fix #ifdefs that should be #ifs
Paul Mackerras [Tue, 10 Sep 2024 11:02:26 +0000 (21:02 +1000)]
pppd/crypto: Fix #ifdefs that should be #ifs

Since they are testing a condition, they should be #if not #ifdef.

Fixes: 077141058aab ("pppd: Add additional functions to handle debugging of crypto calls (#509)", 2024-09-02)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoMerge branch 'net-scripts' of https://github.com/tpaukrt/ppp
Paul Mackerras [Tue, 10 Sep 2024 10:18:27 +0000 (20:18 +1000)]
Merge branch 'net-scripts' of https://github.com/tpaukrt/ppp

2 months agopppd: Add pap-secrets and chap-secrets options (#513)
Tomas Paukrt [Tue, 10 Sep 2024 10:15:29 +0000 (12:15 +0200)]
pppd: Add pap-secrets and chap-secrets options (#513)

These options allow a user to specify paths to pap-secrets and chap-secrets files,
which is useful when running multiple instances of pppd that may use the same
username but with different passwords (e.g. running multiple PPTP tunnels).

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2 months agopppd: Add noresolvconf option (#512)
Tomas Paukrt [Tue, 10 Sep 2024 10:14:57 +0000 (12:14 +0200)]
pppd: Add noresolvconf option (#512)

This option allows a user to specify that they do not want to
create the /etc/ppp/resolv.conf file with the DNS server addresses.
This can be useful when running on a read-only root filesystem.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2 months agopppd: Add ip-pre-up-script option (#510)
Tomas Paukrt [Tue, 10 Sep 2024 10:13:59 +0000 (12:13 +0200)]
pppd: Add ip-pre-up-script option (#510)

This option allows a user to specify the path to the script
usually located at /etc/ppp/ip-pre-up, similarly to the
existing ip-up-script and ip-down-script options.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2 months agopppd: Fix reliability of print_link_stats (with option persist) (#505)
enometh [Tue, 10 Sep 2024 10:12:35 +0000 (15:42 +0530)]
pppd: Fix reliability of print_link_stats (with option persist) (#505)

* pppd/ipcp.c: (ipcp_down): fix comment
* pppd/main.c: (reset_link_stats): reset print_link_stats to 1, set
start_time even if get_ppp_stats fails.

This is an attempt to fix the problem noted in the linux-ppp mailing list on
mar-26-2024 and may-03-2024 under the subject "ppp-2.5.0 sometimes doesn't
print stats on terminating on signal 2"

The sent/recv log messages were being lost, especially with the persist option.
This seems to be an oversight during reorg in commit ba7f7e0 "Header file
reorganization and cleaning up the public API for pppd version 2.5.0 (#379)"
around the repurposing of the link_stats_valid variable as link_stats_print.

It also fixes a stray reference to the old variable in a comment.

Signed-off-by: S Madhu <enometh@meer.net>
2 months agopppd: Add net-init-script, net-pre-up-script and net-down-script options
Tomas Paukrt [Mon, 9 Sep 2024 16:46:48 +0000 (18:46 +0200)]
pppd: Add net-init-script, net-pre-up-script and net-down-script options

These options allow a user to specify paths to scripts usually located
at /etc/ppp/net-init, /etc/ppp/net-pre-up and /etc/ppp/net-down,
similarly to the existing ip-up-script and ip-down-script options.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2 months agopppd: Add additional functions to handle debugging of crypto calls (#509)
Eivind Næss [Mon, 2 Sep 2024 23:41:27 +0000 (16:41 -0700)]
pppd: Add additional functions to handle debugging of crypto calls (#509)

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
2 months agoscripts/redialer: Change the interpreter to bash since it uses bash syntax
Paul Mackerras [Wed, 21 Aug 2024 10:01:59 +0000 (20:01 +1000)]
scripts/redialer: Change the interpreter to bash since it uses bash syntax

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Log a message when the peer successfully authenticates itself to us
Paul Mackerras [Wed, 21 Aug 2024 08:26:49 +0000 (18:26 +1000)]
pppd: Log a message when the peer successfully authenticates itself to us

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoplugins/pppoatm: Remove dead code ans_byaddr and related functions
Paul Mackerras [Wed, 21 Aug 2024 07:52:08 +0000 (17:52 +1000)]
plugins/pppoatm: Remove dead code ans_byaddr and related functions

Provoked by apparent possible out-of-bounds memory access in the
unused code.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoplugins/pppoatm: Restructure code to avoid possibility of integer overflow
Paul Mackerras [Tue, 20 Aug 2024 10:27:31 +0000 (20:27 +1000)]
plugins/pppoatm: Restructure code to avoid possibility of integer overflow

This avoids the theoretical possibility of integer overflow in
adding a constant before dividing in order to get the effect of
rounding up.  Instead we divide and add 1 if the original value modulo
the divisor is non-zero.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agoplugins/winbind: Use fclose() to match with fdopen()
Paul Mackerras [Tue, 20 Aug 2024 09:30:33 +0000 (19:30 +1000)]
plugins/winbind: Use fclose() to match with fdopen()

Having done fdopen() on a couple of file descriptors, we then need to
use fclose() to close them rather than close().

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Widen types in ipcp_reqci
Paul Mackerras [Tue, 20 Aug 2024 08:21:47 +0000 (18:21 +1000)]
pppd: Widen types in ipcp_reqci

The reason is to avoid a theoretically possible overflow of cilen.
Using u_int32_t rather than u_short probably generates better code
on many machines anyway.  Also change l from int to unsigned so as
to avoid any possibility of integer overflow.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Make sure we don't return an initialized CHAP Response length
Paul Mackerras [Tue, 20 Aug 2024 07:29:16 +0000 (17:29 +1000)]
pppd: Make sure we don't return an initialized CHAP Response length

If anything goes wrong in preparing a CHAP Response, return a 0-length
response instead of leaving the length field uninitialized.  Also
print a warning message to say that something went wrong.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppdump: Remove support for decompressing compressed packets
Paul Mackerras [Tue, 20 Aug 2024 07:24:34 +0000 (17:24 +1000)]
pppdump: Remove support for decompressing compressed packets

This simplifies the code and reduces its attack surface, in response
to some deficiencies being found in the zlib code.  This should be OK
since probably no-one uses compression on PPP links any more, and in
any case, the code still exists in git if anyone wants it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Remove unused tdb code
Paul Mackerras [Tue, 20 Aug 2024 07:02:44 +0000 (17:02 +1000)]
pppd: Remove unused tdb code

Provoked by people doing static analysis and finding deficiencies
in some of the unused code.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd: Fix auth_number() to handle wildcards correctly
Paul Mackerras [Sat, 17 Aug 2024 10:43:25 +0000 (20:43 +1000)]
pppd: Fix auth_number() to handle wildcards correctly

Previously auth_number treated all entries in the permitted_numbers
list as if they were wildcards, i.e., as ending in '*', even if there
was no '*'.  This fixes it to only treat entries ending in '*' as
wildcards; without the '*', remote_number has to match the whole entry
exactly.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2 months agopppd/plugins/radius/clientid.c: handle strdup failure (#507)
Ilya Shipitsin [Sat, 17 Aug 2024 03:41:13 +0000 (05:41 +0200)]
pppd/plugins/radius/clientid.c: handle strdup failure (#507)

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2 months agoplugins/radius: Avoid buffer-overrun in rc_avpair_tostr for PW_TYPE_DATE (#506)
Jaco Kroon [Sat, 17 Aug 2024 03:40:49 +0000 (05:40 +0200)]
plugins/radius: Avoid buffer-overrun in rc_avpair_tostr for PW_TYPE_DATE (#506)

Closes: #499
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 months agoMerge pull request #492 from ppp-project/pppoe
Paul Mackerras [Sat, 18 May 2024 00:27:57 +0000 (10:27 +1000)]
Merge pull request #492 from ppp-project/pppoe

PPPoE fixes and improvements

5 months agoplugins/pppoe: Export AC name to scripts via an environment variable
Paul Mackerras [Wed, 1 May 2024 10:43:58 +0000 (20:43 +1000)]
plugins/pppoe: Export AC name to scripts via an environment variable

This saves the access concentrator (AC) name supplied by the AC in the
PADO packet and creates an environment variable called "ACNAME" with
the name as its value for scripts to use if desired.

This was inspired by a pull request from "bearmi" on github, but
reimplemented somewhat differently by me.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
5 months agoplugins/pppoe: Use value from pppoe-padi-* options
Paul Mackerras [Sun, 28 Apr 2024 23:55:05 +0000 (09:55 +1000)]
plugins/pppoe: Use value from pppoe-padi-* options

Reading the values of pppoe_padi_timeout and pppoe_padi_attempts in
PPPOEInitDevice() means that they get sampled when the parsing the
ethernet device name.  If the user provides the pppoe-padi-attempts or
pppoe-padi-timeout option after the ethernet device name, the value
given is effectively ignored.

Instead, read those variables in pppoe_check_options, which is called
after all options have been parsed, so that any user-specified values
don't get missed.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
6 months agoplugins/pppoe: Remove 5 second delay before PADR in verbose mode
Pali Rohár [Sun, 21 Apr 2024 09:03:54 +0000 (11:03 +0200)]
plugins/pppoe: Remove 5 second delay before PADR in verbose mode

This partially reverts commit 1c082acf77e6 ("pppoe: Show verbose
information about all concentrator when pppoe-verbose option is set",
2021-01-01).  That commit added a 5-second wait between receiving a
valid PADO and sending the PADR response so as to give time to see
whether any other PADOs arrive.  However, it appears that this delay
causes problems with some concentrators.

This reverts to the previous behaviour of sending the PADR
immediately.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
6 months agopppd.8: Document netmask option
Paul Mackerras [Sat, 27 Apr 2024 08:57:29 +0000 (18:57 +1000)]
pppd.8: Document netmask option

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
6 months agoCI: Updated the 'checkout' actions that were using Node.js 16 to Node.js 20. (#489)
Adrien RICCIARDI [Fri, 26 Apr 2024 09:11:31 +0000 (11:11 +0200)]
CI: Updated the 'checkout' actions that were using Node.js 16 to Node.js 20. (#489)

See https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
6 months agoUse pkg-config to detect PAM when possible (#479)
Mike Gilbert [Fri, 26 Apr 2024 09:10:16 +0000 (05:10 -0400)]
Use pkg-config to detect PAM when possible (#479)

This fixes a link error on Gentoo Linux by not putting -L/usr/lib in the
link command on 64-bit systems. The correct path is -L/usr/lib64, and
this is the default path used by GCC and clang.

Users may override pkg-config by setting PAM_CFLAGS and PAM_LDFLAGS in
the environment before calling configure. This is standard behavior for
the PKG_CHECK_MODULES macro.

The legacy detection logic is maintained when a path is given as an
argument to --with-pam. Note that this logic is broken when libdir is
not "lib".

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
6 months agoMakefile.am: Add explicit openssl directory to pppd include path
Paul Mackerras [Mon, 22 Apr 2024 22:35:03 +0000 (08:35 +1000)]
Makefile.am: Add explicit openssl directory to pppd include path

When configured with an explicit (non-default) path to the openssl
libraries, we need to add an appropriate -I option when compiling pppd
code so that it can find the openssl header files.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
6 months agoCI: Updated the Buildroot image to support the RISC-V architecture. (#482)
Adrien RICCIARDI [Fri, 19 Apr 2024 09:01:06 +0000 (11:01 +0200)]
CI: Updated the Buildroot image to support the RISC-V architecture. (#482)

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
6 months agoci: Used a Solaris VM with all needed build tools preinstalled. (#481)
Adrien RICCIARDI [Fri, 19 Apr 2024 09:00:10 +0000 (11:00 +0200)]
ci: Used a Solaris VM with all needed build tools preinstalled. (#481)

This avoids losing time updating the package cache and installing the needed packages.

This also avoids breaking the Solaris build if the Solaris mirrors are temporarily unavailable.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
8 months agopppd man page: Update header to refer to pppd 2.5.x
Paul Mackerras [Tue, 13 Feb 2024 09:40:56 +0000 (20:40 +1100)]
pppd man page: Update header to refer to pppd 2.5.x

Also remove the obsolete $Id$ tag.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
8 months agopppd: Restore adding a default route with different metric (#472)
Samuel Thibault [Tue, 13 Feb 2024 09:36:08 +0000 (10:36 +0100)]
pppd: Restore adding a default route with different metric (#472)

For instance, when using a ppp link as backup link, one would want to
add a default route on the ppp link, in *addition* to the existing
default route.

d0ccb87156c2 ("pppd: Add replacedefaultroute option (#200)") however broke
this case: sifdefaultroute was not passing the metric to
defaultroute_exists any more. This commit restores this case.

Fixes #357

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 months agopppoe: Fix sending of PADT on connection termination (#470)
Paul Mackerras [Thu, 11 Jan 2024 09:38:08 +0000 (20:38 +1100)]
pppoe: Fix sending of PADT on connection termination (#470)

Commit 2b4166d02ed0 ("Close discovery socket after session completed",
2020-11-26) arranged for the discovery socket to be closed when the
PPPOE session negotiation was complete.  However, the discovery socket
is used for sending a PADT message when the connection terminates, and
now that doesn't work because the socket has been closed.

To fix this, we reopen the discovery socket in order to send the PADT
message.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
10 months agopppd: Rework use of volatile in lcp-rtt code to eliminate warnings (#469)
Paul Mackerras [Mon, 1 Jan 2024 08:24:34 +0000 (19:24 +1100)]
pppd: Rework use of volatile in lcp-rtt code to eliminate warnings (#469)

To eliminate the warnings, the lcp_rtt_buffer variable no longer
points to volatile, and instead accesses are made using 'ring_header'
local variables, which do point to volatile, and contain the same
address.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
10 months agoRemove include/net/slcompress.h
Paul Mackerras [Wed, 27 Dec 2023 15:30:07 +0000 (15:30 +0000)]
Remove include/net/slcompress.h

This is completely unused and not needed here, so remove it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
10 months agopppd: Fix calloc calls (#416)
AtariDreams [Tue, 26 Dec 2023 18:22:23 +0000 (13:22 -0500)]
pppd: Fix calloc calls (#416)

Size and number are switched in calloc sometimes. This PR fixes that.

Signed-off-by: Seija Kijin <doremylover123@gmail.com>
Co-authored-by: Seija Kijin <doremylover123@gmail.com>
10 months agoscripts/lcp_rtt_exporter: include content length in response (#467)
Tomasz Torcz [Thu, 21 Dec 2023 19:51:57 +0000 (20:51 +0100)]
scripts/lcp_rtt_exporter: include content length in response (#467)

Signed-off-by: Tomasz Torcz <tomek@pipebreaker.pl>
10 months agoradius: Fix MPPE key decryption for the second-half of the key block (#463)
Jaco Kroon [Thu, 21 Dec 2023 19:50:58 +0000 (21:50 +0200)]
radius: Fix MPPE key decryption for the second-half of the key block (#463)

During he refactor in commit 4cb90c1 the key material used to decrypt
the second-half of the encrypted block was accidentally updated from:

MD5(radius_secret + crypt[0..15]); to:

MD5(radius_secret + crypt[0..15] + salt)

Which would obviously mismatch.

This also refactors back into what I believe to be a more readable block
with lower nesting and more comprehensive error reporting.

Closes: #453
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
10 months agoFix problem where the detection of openssl failed when pkgconfig isn't available...
Eivind Næss [Thu, 21 Dec 2023 09:29:29 +0000 (01:29 -0800)]
Fix problem where the detection of openssl failed when pkgconfig isn't available (#468)

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
10 months agopppd: constify log format strings. (#462)
Jaco Kroon [Mon, 18 Dec 2023 13:35:40 +0000 (15:35 +0200)]
pppd: constify log format strings. (#462)

Found when trying to do a simple dbglog(__FUNCTION__);

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
11 months agoci: Fix the Solaris build (#464)
Adrien RICCIARDI [Wed, 6 Dec 2023 09:26:22 +0000 (10:26 +0100)]
ci: Fix the Solaris build (#464)

Switched to the latest version of the Solaris GitHub Action that now uses Qemu
and libvirt on an Ubuntu runner instead of VirtualBox on a macOS runner.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
12 months agoFix typos in copyright dates
Paul Mackerras [Thu, 9 Nov 2023 09:02:47 +0000 (20:02 +1100)]
Fix typos in copyright dates

This fixes some typos introduced in commit d1506f182ba8, where 1994
got inadvertently changed to 1984 in three cases, and 1989 in another.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
12 months agoRemove <linux/if_ppp.h> and <net/if_ppp.h> headers
Paul Mackerras [Thu, 9 Nov 2023 06:20:36 +0000 (17:20 +1100)]
Remove <linux/if_ppp.h> and <net/if_ppp.h> headers

The if_ppp.h headers are redundant; all the relevant definitions are
now in ppp_defs.h, ppp-ioctl.h for Linux (which comes from the kernel
headers via the C library) and pppio.h for Solaris.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
12 months agoChange my paulus@samba.org email address to paulus@ozlabs.org
Paul Mackerras [Thu, 9 Nov 2023 01:19:59 +0000 (12:19 +1100)]
Change my paulus@samba.org email address to paulus@ozlabs.org

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
12 months agoREADME: Update for 2.5.1 release
Paul Mackerras [Thu, 9 Nov 2023 01:15:12 +0000 (12:15 +1100)]
README: Update for 2.5.1 release

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
12 months agopppoe: Fail if ethernet interface name is too long
Paul Mackerras [Wed, 8 Nov 2023 05:54:40 +0000 (16:54 +1100)]
pppoe: Fail if ethernet interface name is too long

If the name of the ethernet interface is longer than can fit in the
relevant structure used for system calls, generate an error rather
than using a truncated interface name.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
12 months agoFix for failure to detect the presence of sockaddr_ll in linux/if_packet.h (#456)
Eivind Næss [Wed, 8 Nov 2023 05:58:01 +0000 (21:58 -0800)]
Fix for failure to detect the presence of sockaddr_ll in linux/if_packet.h (#456)

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
12 months agoFix linking error with lld linkers (#438)
Brahmajit Das [Thu, 2 Nov 2023 05:56:18 +0000 (11:26 +0530)]
Fix linking error with lld linkers (#438)

When using lld linker, build fails with

ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../lib64/Scrt1.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../lib64/crti.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux

The fix is to check pkg-config first, and not force manual -L /usr/lib.
If pkg-config succeeded, then we don't bother with -L /usr/lib

Our guess is this what the actual intention was based upon the coments

if pkg-config is installed and openssl has installed a .pc file,
then use that information and don't search ssldirs

First found on gentoo linux with llvm profile, please check out Bug:
section of the commit for more info and a complete build log.

Bug: https://bugs.gentoo.org/905442

Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Co-authored-by: Sam James <sam@gentoo.org>
12 months agopppd/sys-linux: Fix compile with older Linux kernel headers (#452)
Jaco Kroon [Tue, 31 Oct 2023 09:47:21 +0000 (11:47 +0200)]
pppd/sys-linux: Fix compile with older Linux kernel headers (#452)

When compiling pppd against kernel headers which don't provide
the definitions for the NETLINK mechanisms, leave out the code
which uses NETLINK, so as to avoid getting compile errors.

Upstream commit in Linux refers.

commit 10c9ead9f3c6bb24bddc9a96681f7d58e6623966
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
Date:   Wed Apr 20 08:43:43 2016 -0700
rtnetlink: add new RTM_GETSTATS message to dump link stats

This commit adds the #defines and structs used, so simply not compiling
this code if the required #defines isn't there should solve the problem.

Closes: #450
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
12 months agoplugins/radius: fix segfault during shutdown. (#455)
Jaco Kroon [Thu, 26 Oct 2023 09:52:27 +0000 (11:52 +0200)]
plugins/radius: fix segfault during shutdown. (#455)

ppp_get_ifname() is the wrong thing to use in this slprintf call as
it returns an int which is the length of the interface name, not
a pointer to the interface name, which is what ppp_ifname()
returns.

Closes: #454
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
13 months agoMerge pull request #367 from jkroonza/consolidated-ifup-down-and-scripts
Paul Mackerras [Wed, 11 Oct 2023 00:44:36 +0000 (11:44 +1100)]
Merge pull request #367 from jkroonza/consolidated-ifup-down-and-scripts

Implement net-init, net-pre-up and net-down scripts in pppd.

13 months agoMerge pull request #436 from martinetd/mkdir_runtime_lock
Paul Mackerras [Tue, 10 Oct 2023 07:13:30 +0000 (18:13 +1100)]
Merge pull request #436 from martinetd/mkdir_runtime_lock

Try to create rundir before using it

13 months agotry to create rundir if missing
Dominique Martinet [Thu, 3 Aug 2023 07:37:27 +0000 (16:37 +0900)]
try to create rundir if missing

Runtime dir changed from /run to /run/pppd in commit 66a8c74c3f73 ("Let
./configure control the paths for pppd") and is likely to not exist on
some distros, in which case the pppdb will not be created.

See: #419 (lock directory moved in ppp-2.5.0)
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
13 months agoutils: add mkdir_recursive
Dominique Martinet [Wed, 30 Aug 2023 02:46:01 +0000 (11:46 +0900)]
utils: add mkdir_recursive

This will be used in the next commit.

A test file for utils has also been added to check mkdir works as
intended.

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
13 months agoRevert lock path to /var/lock (#435)
Dominique Martinet [Tue, 10 Oct 2023 01:05:50 +0000 (10:05 +0900)]
Revert lock path to /var/lock (#435)

lock dir changed on linux from /var/lock to /run/pppd/lock with
pppd-2.5.0, which makes pppd fail to start if the distribution does not
pre-create the directory.

This reverts it back to /var/lock.

The paths for other OS should be identical as LOCALSTATEDIR should be
/var, but also revert them back as well just in case.
Since the variable is no longer used remove it from makefiles.

Fixes: 66a8c74c3f73 ("Let ./configure control the paths for pppd")
Fixes: #419
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Co-authored-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
13 months agopppd: implement net-init, net-pre-up and net-down.
Jaco Kroon [Tue, 26 Sep 2023 12:45:13 +0000 (14:45 +0200)]
pppd: implement net-init, net-pre-up and net-down.

net-init executes as a blocking script directly after the unit number
becomes available.  This can be used to initialise aspects related to
the ppp connection that lives outside of the ppp connection.  It can
also be used to clean up (in the author's extremely unlikely case) where
a previous pppd crashed, and net-down didn't execute in order to clean
up.

net-pre-up executes as a blocking script after auth, prior to NCPs being
negotiated.  Unlike ip-pre-up this is guaranteed to execute prior to the
interface being brought up, and can be used in an NCP agnostic manner to
pre-initialise aspects of the interface for which it still needs to be
down (amongst others it's recommended that firewall changes happen
here).

net-down executes in a non-blocking manner just prior to pppd
terminating and can be used to clean up actions from previous scripts.

You will notice that I mention ip-pre-up doesn't gaurantee that the
interface will still be down, this is because in a Linux world all
protocols runs on the same interface, compared to solaris where I'm
informed each protocol runs on it's own sub-interface, each of which has
it's own operational state.  The man page for pppd has also been
adjusted to indicate as much.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
13 months agoMerge pull request #422 from rfc1036/lcp-rtt
Paul Mackerras [Sat, 30 Sep 2023 12:21:39 +0000 (22:21 +1000)]
Merge pull request #422 from rfc1036/lcp-rtt

Implement logging the LCP Round Trip Time

13 months agoEscape all minus characters in the man pages (#449)
Marco d'Itri [Thu, 28 Sep 2023 01:12:36 +0000 (03:12 +0200)]
Escape all minus characters in the man pages (#449)

From man-pages(7):

   Where a real minus character is required (e.g., for numbers such as -1,
   for man page cross references such as utf-8(7), or when writing options
   that  have a leading dash, such as in ls -l), use the following form in
   the man page source:

       \-

Signed-off-by: Marco d'Itri <md@linux.it>
13 months agopppoe: Fix crash when a too-long device name is given (#447)
Eivind Næss [Thu, 28 Sep 2023 01:09:51 +0000 (18:09 -0700)]
pppoe: Fix crash when a too-long device name is given (#447)

Fix for github issue #446.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
13 months agoscripts/lcp_rtt_exporter: Prometheus exporter for the LCP RTT data
Marco d'Itri [Sun, 24 Sep 2023 10:03:04 +0000 (12:03 +0200)]
scripts/lcp_rtt_exporter: Prometheus exporter for the LCP RTT data

Signed-off-by: Marco d'Itri <md@linux.it>
13 months agoscripts/lcp_rtt_dump: dump the LCP RTT log
Marco d'Itri [Sun, 7 May 2023 15:59:36 +0000 (17:59 +0200)]
scripts/lcp_rtt_dump: dump the LCP RTT log

Signed-off-by: Marco d'Itri <md@linux.it>
13 months agoimplement logging the LCP RTT
Marco d'Itri [Sun, 7 May 2023 15:56:43 +0000 (17:56 +0200)]
implement logging the LCP RTT

This change adds the lcp-rtt-file configuration option, which instructs
pppd to add a timestamp to the data section of each LCP echo request
frame and then log their round-trip time and any detected packet loss
to a circular buffer in that file.

Other programs then can asynchronously read the file and report
statistics about the line.

Signed-off-by: Marco d'Itri <md@linux.it>
14 months agoCI: Update the 'checkout' action to V3 as V2 is being deprecated. (#437)
Adrien RICCIARDI [Fri, 1 Sep 2023 11:58:46 +0000 (13:58 +0200)]
CI: Update the 'checkout' action to V3 as V2 is being deprecated. (#437)

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
14 months agopppd/options.c: fix memory leak on error path (#441)
Ilya Shipitsin [Fri, 1 Sep 2023 11:57:55 +0000 (13:57 +0200)]
pppd/options.c: fix memory leak on error path (#441)

found by Coverity

602err:
603    fclose(f);
604    privileged_option = oldpriv;
   CID 436193 (#1 of 1): Resource leak (RESOURCE_LEAK)10. overwrite_var: Overwriting option_source in option_source = oldsource leaks the storage that option_source points to.
605    option_source = oldsource;

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
15 months agopppd: Fix compilation with openssl disabled (#431)
Eivind Næss [Fri, 4 Aug 2023 06:18:09 +0000 (23:18 -0700)]
pppd: Fix compilation with openssl disabled (#431)

If openssl is disabled at configure time but microsoft extensions are enabled,
we get a compilation error due to an unnecessary include in crypto_ms.c.
This removes the unnecessary include.  With this, pppd compiles without
openssl as long as you add the following arguments to the configure script
invocation:

        --disable-peap --disable-eaptls --without-openssl

Fixes: https://github.com/ppp-project/ppp/issues/429
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
15 months agopppd/options.c: handle malloc failure (#425)
Ilya Shipitsin [Thu, 3 Aug 2023 09:32:26 +0000 (11:32 +0200)]
pppd/options.c: handle malloc failure (#425)

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
15 months agopppd/ppp-sha1.c: use uint32_t instead of u_int32_t (#432)
bkuhls [Thu, 3 Aug 2023 09:31:23 +0000 (11:31 +0200)]
pppd/ppp-sha1.c: use uint32_t instead of u_int32_t (#432)

Fixes build with musl-libc toolchains.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
15 months agopasswordfd: read password during option processing (#420)
Mike Gilbert [Thu, 3 Aug 2023 08:57:23 +0000 (04:57 -0400)]
passwordfd: read password during option processing (#420)

When configured to detach from the controlling terminal, pppd closes
file descriptors 0, 1, and 2 before the passwd hook is called. If the
user passes 0, 1, or 2 to the passwordfd option, pppd will fail to read
the password.

To work around this, treat passwordfd as a special option and read the
password during option processing, before pppd closes it.

Bug: https://bugs.gentoo.org/209294

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
16 months agoEnsure there is a '/' between PPP_PATH_VARRUN and the PID filename (#427)
Mike Gilbert [Mon, 26 Jun 2023 05:17:16 +0000 (01:17 -0400)]
Ensure there is a '/' between PPP_PATH_VARRUN and the PID filename (#427)

Bug: https://bugs.gentoo.org/907311

Fixes: 66a8c74c3f73 ("Let ./configure control the paths for pppd", 2022-07-30)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
18 months agoMove pppgetpass.8 to EXTRA_DIST (#412)
Mike Gilbert [Mon, 1 May 2023 03:33:10 +0000 (23:33 -0400)]
Move pppgetpass.8 to EXTRA_DIST (#412)

automake does not seem to include noinst_*_MANS in the dist tarball.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
18 months agoMerge pull request #417 from enaess/fixes
Paul Mackerras [Mon, 1 May 2023 03:29:50 +0000 (13:29 +1000)]
Merge pull request #417 from enaess/fixes

Fixes for #411 and #413

18 months agoUpdate version to 2.5.1-dev
Paul Mackerras [Mon, 1 May 2023 02:38:28 +0000 (12:38 +1000)]
Update version to 2.5.1-dev

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
18 months agoCloses #411, Fixing up parsing in radiusclient.conf
Eivind Naess [Sun, 23 Apr 2023 18:37:01 +0000 (11:37 -0700)]
Closes #411, Fixing up parsing in radiusclient.conf

Adding curly braces to fix the code.

Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
18 months agoAdd configure check to see if we have struct sockaddr_ll
Eivind Naess [Sun, 23 Apr 2023 18:30:43 +0000 (11:30 -0700)]
Add configure check to see if we have struct sockaddr_ll

Fixes issue #411.

Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
19 months agoFurther updates to README for 2.5.0 release ppp-2.5.0
Paul Mackerras [Sat, 10 Dec 2022 03:26:12 +0000 (14:26 +1100)]
Further updates to README for 2.5.0 release

History from the 2.4.x series is moved to Changes-2.4.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
19 months agopppd/tty.c: Use unsigned constants for ACCM calculations
Paul Mackerras [Sat, 18 Mar 2023 08:44:13 +0000 (19:44 +1100)]
pppd/tty.c: Use unsigned constants for ACCM calculations

Use unsigned constants to avoid integer overflows when shifting, and
because xmit_accm[] is an array of unsigned values.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
19 months agoradius: Fix list traversal in rc_avpair_insert
Paul Mackerras [Sat, 18 Mar 2023 07:14:04 +0000 (18:14 +1100)]
radius: Fix list traversal in rc_avpair_insert

In rc_avpair_insert, if the list element "p" is non-NULL but not
actually in the list "a", we can end up with this_node being NULL and
being dereferenced.

By changing the while test to this_node->next we avoid having
this_node being NULL; the loop will terminate when this_node == p or
this_node->next == NULL, which is what we want.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
19 months agochat: Fix loop condition to avoid possible 1-byte buffer overrun
Paul Mackerras [Sat, 18 Mar 2023 06:34:07 +0000 (17:34 +1100)]
chat: Fix loop condition to avoid possible 1-byte buffer overrun

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
19 months agopppdump: Remove compression functions from local copy of zlib
Paul Mackerras [Sat, 18 Mar 2023 06:32:20 +0000 (17:32 +1100)]
pppdump: Remove compression functions from local copy of zlib

They aren't used (pppdump only needs decompression), and removing the
unused code avoids getting reports from automated tools about possible
errors in the unused code.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
19 months agoCI: add automatic tests, enable ASAN build&test (#399)
Ilya Shipitsin [Fri, 17 Mar 2023 23:23:43 +0000 (00:23 +0100)]
CI: add automatic tests, enable ASAN build&test (#399)

* CI: add automatic tests, enable ASAN build&test

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
19 months agoMerge pull request #409 from enaess/conf-fixes
Paul Mackerras [Fri, 17 Mar 2023 23:22:33 +0000 (10:22 +1100)]
Merge pull request #409 from enaess/conf-fixes

Additional fixes for various configure options (less frequently used) that broke

19 months agoFix compilation without ipv6cp support (#408)
Eivind Næss [Fri, 17 Mar 2023 22:52:33 +0000 (15:52 -0700)]
Fix compilation without ipv6cp support (#408)

You can't reference variables that aren't included in the compile.

Add #ifdef PPP_WITH_IPV6CP in the get_notifier_by_type function.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoAdd a --with-system-ca-path <path-to-ca-directory> option to configure (#406)
Eivind Næss [Fri, 17 Mar 2023 22:50:30 +0000 (15:50 -0700)]
Add a --with-system-ca-path <path-to-ca-directory> option to configure (#406)

Allow distributions to specify a default CA path. Fix for github issue #405.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoMerge pull request #404 from enaess/stdbool
Paul Mackerras [Fri, 17 Mar 2023 22:47:17 +0000 (09:47 +1100)]
Merge pull request #404 from enaess/stdbool

Removes autotools include guards for stdbool.h and friends

19 months agoradius plugin: add fclose operation to fix file pointer not closed after use (#401)
Bmo [Fri, 17 Mar 2023 22:20:43 +0000 (06:20 +0800)]
radius plugin: add fclose operation to fix file pointer not closed after use (#401)

Signed-off-by: Wei Xing <skyxwwalker@gmail.com>
Co-authored-by: Wei Xing <skyxwwalker@gmail.com>
19 months agoAdding 'extern "C" {' and '}' declarations to exported header files
Eivind Næss [Sat, 4 Mar 2023 05:47:11 +0000 (05:47 +0000)]
Adding 'extern "C" {' and '}' declarations to exported header files

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoShould not require third party project to define HAVE_HEADER_H
Eivind Næss [Sat, 4 Mar 2023 03:03:16 +0000 (03:03 +0000)]
Should not require third party project to define HAVE_HEADER_H

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoCompiling with --enable-mslanman is broken
Eivind Næss [Fri, 10 Mar 2023 00:20:03 +0000 (00:20 +0000)]
Compiling with --enable-mslanman is broken

Correcting the call to DesEncrypt() where needed.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoAdditional fixes for broken build
Eivind Næss [Thu, 9 Mar 2023 23:59:19 +0000 (23:59 +0000)]
Additional fixes for broken build

This change fixes the build when
- ./configure is run with --disable-plugins
- ./configure is run with --disable-peap --disable-eaptls
     --disable-microsoft-extensions

The latter disables the MPPE encryption too, but <pppd/crypto.h> is
still needed.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 months agoFixing a few more memory leaks in chat.c
Robert Bartel [Sat, 11 Mar 2023 22:38:42 +0000 (22:38 +0000)]
Fixing a few more memory leaks in chat.c

Running Valgrind memcheck tool on chat.c while communicating with a
modem found additional memory leaks. These fixes plumb those.

Signed-off-by: Robert Bartel <r.bartel@gmx.net>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>