| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Adding curly braces to fix the code.
Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
|
|
|
|
|
|
| |
Fixes issue #411.
Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
Additional fixes for various configure options (less frequently used) that broke
|
| |
| |
| |
| |
| |
| | |
Correcting the call to DesEncrypt() where needed.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Allow distributions to specify a default CA path. Fix for github issue #405.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
|\ \
| | |
| | | |
Removes autotools include guards for stdbool.h and friends
|
| | |
| | |
| | |
| | | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |/
| |
| |
| | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
|/
|
|
|
|
|
| |
(#401)
Signed-off-by: Wei Xing <skyxwwalker@gmail.com>
Co-authored-by: Wei Xing <skyxwwalker@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix for coverity issue 436265, we should cap copy to size of destination buffer
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fix for coverity issue 436262, llv6_ntoa() returns a pointer to a buffer that can be up to 64 bytes long; likely not a problem, but this will quiet coverity
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fix for coverity issue 436251, not freeing path in the normal flow of the code
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436258, Digest maybe uninitialized in some paths of this code
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fix for coverity issue 436254, forgot to free 's' before returning from the function?
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436251, memory leak in put_string() function
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue 436215, should copy at most sizeof(devname) bytes
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436203, if no authentication (or no accounting) server was found, we still need to free the allocated local instance
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436171, use of uninitialized variable
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Use of signed vs unsigned variable in printf for MD4Update
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436182, fixing possible buffer overrun in handling of PW_CLASS attribute
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Fixing coverity issue #436156
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Compile errors
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
[paulus@ozlabs.org - Squashed to avoid breaking bisection]
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
|
|\
| |
| | |
Few more changes before 2.5.0 release
|
| |
| |
| |
| | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
* Add 'const' parameter to input arguments in crypto_ms.*
* Round ZPasswordHash buffers up to 24 bytes, as the DES MakeKey() function
accesses ZPasswordHash[21]
Closes github issue #392
[paulus@ozlabs.org - tidied up headline and commit message]
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2.5.0 (#379)
This commit does several things, being a squash-and-merge of a series
of changes; squashed in order not to break bisection.
* Clean up pppd.h, moving declarations that should only be accessed by
pppd code (not by users of pppd) to a new pppd-private.h. Also,
other parts of pppd.h were moved to multilink.h, chap.h, eap.h,
eui64.h, and a new options.h.
* Provide an API for access to data that is needed by plugins (in no
particular order):
- ifname
- ifunit
- remote_name
- remote_number
- peer_authname
- status (now called "code" internally)
- phase
- doing_multilink
- multilink_master
- idle_time_limit
- link_connect_time
- max_connect_time
- link_stats
- ipparam
- hostname
- got_sigterm
- got_sigusr2
- got_sighup
- session_number
- maxoctets
- maxoctets_dir
- debug
- persist
- devnam
- modem
- peer_authname
- sync_serial
* Update the version number to 2.5.0.
* Detect availability of stddef.h and stdarg.h.
* Rename some headers:
- pppcrypt.c/h to crypto_ms.c/h
- ppp-crypto.c/h to crypto.c/h
- ppp-crypto-priv.h to crypto-priv.h
- chap-new.c/h to chap.c/h
* Remove chap-md5.h, crypto-priv.h, eap-tls.h, etc. from the list of
header files to be installed.
* Provide typedefs for the hook functions.
* Provide a typedef for the "phase" variable.
* Provide a typedef for the link statistics array.
* Remove the option_t typedef.
* Rename the following functions by adding a "ppp_" prefix (with the
intention that these are a "public" API for use by plugins):
- option_error
- add_options
- int_option,
- options_from_file
- script_setenv
- bad_ip_adrs,
- netif_get/set_mtu (renamed to ppp_get/set_mtu)
- get_time
- timeout
- untimeout
- safe_fork
- sys_close
- set_session_number
- update_link_stats (renamed to ppp_get_link_stats)
- add_notifier (renamed to ppp_add_notify)
- remove_notifier (renamed to ppp_del_notify)
- generic_[dis]establish_ppp (to ppp_generic_[dis]establish)
* Rename ppp_devnam to ppp_devname.
* Rename ppp_available() to ppp_check_kernel_support().
* Use unsigned char instead of u_char, unsigned short instead of
u_short, uint32_t instead of u_int32_t.
* Add const to some declarations
* Update comments
* Change the interface for notifiers to use an enum to identify which
notifier is to be modified.
* Provide an API for getting the path to a file, with an enum to
identify different types of file.
* Link plugins with the -DPLUGIN flag
[paulus@ozlabs.org - wrote commit message]
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
|
|
|
| |
Signed-off-by: Dianne Skoll <dianne@skoll.ca>
|
|\
| |
| | |
radius: distinguish between User-Request and Admin-Reset.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For the purposes of our definition:
User-Request - remote side hanging up.
Admin-Reset - local side hanging up.
Reasoning is that typically radius will be used to authentication
dial-in users, so if the pppd gets killed locally, that's not the User
(client) requesting hangup, but rather the local administrator (be that
a manual kill, or as a result of a CoA/Disconnect).
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the lcp-echo-adaptive option is specified, it means that seeing
received traffic on the link is considered to be an indication that
the link is working. Hence, this resets the count of missing LCP
echo-replies to 0 when traffic is seen. Without this, occasional
echo failures interspersed with link traffic can accumulate and end up
causing a disconnection even when the link is working correctly.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
|
|\ \
| | |
| | | |
pppd: Retry registering interface when on rtnetlink -EBUSY error
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to workaround in kernel module ppp_generic.ko in function
ppp_nl_newlink(), kernel may return -EBUSY error to prevent possible
mutex deadlock. In this case userspace needs to retry its request.
Proper way would be to fix kernel module to order requests and mutex
locking, so prevent deadlock in kernel and so never return this error to
userspace. Until it happens we need retry code in userspace.
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|\ \
| | |
| | | |
Add option to show all options (show-options)
|
| | |
| | |
| | |
| | |
| | |
| | | |
text to include copyright and package name from autotools.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
|\ \ \
| |_|/
|/| | |
Create an new API that allows us to abstract the use of the standard crypto functions
|
| | |
| | |
| | |
| | |
| | |
| | | |
incarnation DES w.r.t. RFC2759
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| | |
| | |
| | |
| | |
| | |
| | | |
Avoid using these variables in function descriptors.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This re-introduces the missing DES encryption functions copied from Openssl 3.0 project. Incorporates a new API for performing MD4/MD5/SHA and encryption using DES-ECB mode.
Unit tests are included for respective digest/encryption functions using this new API. With this change, you can pass configure --without-openssl to use the internally provided functions. If you do have openssl, then it will default to use these functions. This also provides a framework to allow other vendors to provide crypto.
This closes #333, partially addresses #242 (except the pkcs11 engine support). Word has it that openssl is working on support for this, and the libp11 / opensc project are inclined not to support this.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| | |
Move reading of rtnelink response code from get_ppp_stats_rtnetlink() to
one common rtnetlink function rtnetlink_msg() and use it.
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|/
|
|
|
|
|
| |
Move common code for sending rtnetlink message into the new
send_rtnetlink_msg() function.
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|\
| |
| | |
PPP autotools
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was previously done by specifying an overriding value for _ROOT_PATH. With this change, this variable is now gone.
Instead, pathnames.h will use the SYSCONFDIR and LOCALSTATEDIR to resolve these paths. These directories is already controlled by
configure.
Package maintainers should be aware though that this may change their current configuration. The convential ./configure way is to
specify:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run --with-plugin-dir=/usr/lib/pppd/2.4.10
If one omit the --sysconfdir option, then the default location is by ${prefix}/etc which may not be what you want.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| | |
Response structure is incomplete when returned length is less than required
structure length.
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux kernel has nasty bug / feature. If PPPIOCNEWUNIT is called with
negative ppp unit id (which is default option when command line argument
"unit" is not specified; and tells kernel to choose some free ppp unit id)
and the lowest unused/free ppp unit id is present in some existing network
interface name prefixed by "ppp" string then this PPPIOCNEWUNIT ioctl
fails. In this case kernel is basically unable to create a new ppp
interface via PPPIOCNEWUNIT ioctl when user does not specify some unused
and non-conflicted unit id.
Linux kernel should be fixed to choose usable ppp unit id when was
requested via PPPIOCNEWUNIT parameter -1.
Until this happens, add a workaround for pppd to help choosing some random
ppp unit id when kernel returns this error.
Simple test case (run on system when there is no ppp interface):
sudo ./pppd ifname ppp1 nodefaultroute noauth nolock local nodetach pty "./pppd nodefaultroute noauth nolock local nodetach notty"
Second pppd process without this patch prints into syslog following error:
pppd 2.4.10-dev started by pali, uid 0
Couldn't create new ppp unit: File exists
Exit.
With this patch it falls back to random ppp unit id and succeeds:
pppd 2.4.10-dev started by pali, uid 0
Using interface ppp1361
Connect: ppp1361 <--> /dev/pts/14
...
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|
|
| |
Signed-off-by: Vlados Korneev <allaods97@gmail.com>
|
|\
| |
| |
| | |
pppd: Add support for registering ppp interface via Linux rtnetlink API
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
pppd currently creates ppp network interface via PPPIOCNEWUNIT ioctl API.
This API creates a new ppp network interface named "ppp<unit_id>". If user
supply option "ifname" with custom network name then pppd calls SIOCSIFNAME
ioctl to rename "ppp<unit_id>" to custom name immediately after successful
PPPIOCNEWUNIT ioctl call. If custom name is already registered then
SIOCSIFNAME ioctl fails and pppd close current channel (which destroy also
network interface).
This has side effect that in the first few miliseconds interface has
different name as what user supplied.
Tools like systemd, udev or NetworkManager are trying to query
interface attributes based on interface name immediately when new
network interface is created.
But if interface is renamed immediately after creation then these tools
fails. For example when running pppd with option "ifname ppp-wan" following
error is reported by systemd / udev into dmesg log:
[ 35.718732] PPP generic driver version 2.4.2
[ 35.793914] NET: Registered protocol family 24
[ 35.889924] systemd-udevd[1852]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[ 35.901450] ppp-wan: renamed from ppp0
[ 35.930332] systemd-udevd[1852]: link_config: could not get ethtool features for ppp0
[ 35.939473] systemd-udevd[1852]: Could not set offload features of ppp0: No such device
There is an easy way to fix this issue: Use new rtnetlink API.
Via rtnetlink API it is possible to create ppp network interface with
custom ifname atomically. Just it is not possible to specify custom ppp
unit id.
So use new rtnetlink API when user requested custom ifname without custom
ppp unit id. This will avoid system issues with interface renaming as ppp
interface is directly registered with specified final name.
This has also advantage that if requested interface name already exists
then pppd fail during registering of networking interface and not during
renaming network interface which happens after successful registration.
If user supply custom ppp unit id then it is required to use old ioctl API
as currently it is the only API which allows specifying ppp unit id.
When user does not specify custom ifname stay also with old ioctl API.
There is currently a bug in kernel which cause that when empty interface is
specified in rtnetlink message for creating ppp interface then kernel
creates ppp interface but with pseudo-random name, not derived from ppp
unit id. And therefore it is not possible to retrieve what is the name of
newly created network interface. So when user does not specify interface
name via "ifname" option (which means that want from kernel to choose some
"free" interface name) it is needed to use old ioctl API which do it
correctly for now.
Signed-off-by: Pali Rohár <pali@kernel.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This rearranges the PPP_WITH_IPV6CP guards added in commit
80b8744eb42c ("Changing INET6 to PPP_WITH_IPV6CP and adding configure
option", 2021-08-06) so that we (a) always include the rtnetlink
headers, since we need them for get_ppp_stats_rtnetlink(), and (b)
don't include eui64.h unless we have IPV6 support.
Fixes: 80b8744eb42c ("Changing INET6 to PPP_WITH_IPV6CP and adding configure option")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
|
| |
| |
| |
| |
| |
| | |
it can be controlled via config options. It does nothing by default
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
buildroot, others)
The one provided by glibc simply includes <linux/ppp_defs.h>. This include is still needed on SunOS
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| | |
consistency
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is to ensure compatibility with the OS you are compiling against and that
headers are maintained in upstream projects.
- Moved PPP_EAP and PPP_ECP into respective header files in lieu of not currently
existing in the linux/ppp_defs.h
- Unchained the top-level ${topsrc_dir}/include, this folder is included for
prosterity and may continue to exist on github, but in the future eliminated from
distribution
- Bogus upstream file in glibc for <net/if_ppp.h>, its content should be replaced
with a simple include to <linux/ppp-ioctl.h>. The lack of an appropriate ifreq
structure with ppp_stats or ppp_comp_stats, implementet that inline (and tested).
- Updated instances where PPP_FCS() macro would expand the fcstab, while PPP_GOODFCS
and PPP_INITFCS is provided in <linux/ppp_defs.h>, the latter is tied to a lookup
table. It's used in two places, so add the PPP_FCS macro where applicable.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| | |
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the need to include the following heades in pppd.h
<limits.h>, this is included where needed (main.c). The number of groups already retrieved is stored in the "int ngroups" variable.
<sys/params.h>, use MAXPATHLEN where needed
<net/if.h>, such that the value of IFNAMSIZ doesn't have to be declared to include <pppd/pppd.h>
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change does a few different things.
* Projects that needs #include "config.h" should use a config.h.in for the project generated by configure in the project's local directory.
* All projects will use #include <pppd/pppd.h>, and Makefile will add -I${top_srcdir} to the appropriate *_CPPFLAGS variable.
* The inclusion of <pppd/pppdconf.h> will set the presidence for all features enabled/disabled in pppd
* Plugins will now need to use PPPD_VERSION as it conflicts with VERSION from config.h generated by autotools for third party packages
Currently, only pppoe require the use of config.h to correctly set the defines for which header files and so on was detected by configure
Other projects only needed to include <pppd/pppd.h> (and maybe a few other header files), a future change will fixup <pppd/pppd.h> to include features as needed such that it's the only needed include for a plugin. This will avoid littering the code with #ifdef/#endif constructs.
BREAKING CHANGE!
pppd/pppd.h no longer provide VERSION, third party packages are required to switch to use PPPD_VERSION. This is to avoid conflict with a source package's own VERSION as set by autotools / config.h. Also, the use of PPP_VERSION conflicts with public header files from Glibc/Linux kernel.
Example:
char pppd_version[] = PPPD_VERSION;
pppd will load plugins, and also look for the symbol "pppd_version" to validate that the plugin was built for the current version of pppd.
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
|