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>
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>
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>
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>
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>
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>
Change my paulus@samba.org email address to paulus@ozlabs.org Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
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>
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>
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>
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>