ppp: update to version 2.4.7.git-2018-06-23

This bumps ppp to latest git version.

There is one upstream commit, which changes DES encryption calls from
libcrypt / glibc to openssl.

As long as we don't use glibc-2.28, revert this commit.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
openwrt-19.07
Martin Schiller 2018-12-06 13:10:54 +01:00 committed by Hans Dedecker
parent f01044e85c
commit eaaee181d1
33 changed files with 270 additions and 406 deletions

View File

@ -9,16 +9,20 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ppp
PKG_VERSION:=2.4.7
PKG_RELEASE:=14
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/
PKG_HASH:=02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
PKG_SOURCE_DATE:=2018-06-23
PKG_SOURCE_VERSION:=5c765a67fd25f9d84e71ed61ace37c8c97f6be15
PKG_MIRROR_HASH:=a79e62d0569e3d6a3207f2a693532d34629fb5b3b9d8c1d9b9786ebd1d1de70f
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-4-Clause
PKG_CPE_ID:=cpe:/a:samba:ppp
PKG_RELEASE_VERSION:=2.4.7
PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libpcap
@ -215,7 +219,7 @@ define Package/ppp/script_install
endef
define Package/ppp/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/ppp
@ -232,21 +236,21 @@ endef
Package/ppp-multilink/install=$(Package/ppp/install)
define Package/ppp-mod-pppoa/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoatm.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
endef
define Package/ppp-mod-pppoe/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/rp-pppoe.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
endef
define Package/ppp-mod-radius/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/radius.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
$(INSTALL_DIR) $(1)/etc/ppp
$(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
$(INSTALL_DIR) $(1)/etc/ppp/radius
@ -257,23 +261,23 @@ define Package/ppp-mod-radius/install
endef
define Package/ppp-mod-pppol2tp/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppol2tp.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
endef
define Package/ppp-mod-pptp/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pptp.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pptp.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
$(INSTALL_DIR) $(1)/etc/ppp
$(INSTALL_DATA) ./files/etc/ppp/options.pptp $(1)/etc/ppp/
endef
define Package/ppp-mod-passwordfd/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/passwordfd.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/passwordfd.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
endef
define Package/chat/install

View File

@ -1,39 +0,0 @@
--- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux
@@ -43,13 +43,13 @@ install: all
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
radius.so: radius.o libradiusclient.a
- $(CC) -o radius.so -shared radius.o libradiusclient.a
+ $(CC) $(CFLAGS) -o radius.so -shared radius.o libradiusclient.a
radattr.so: radattr.o
- $(CC) -o radattr.so -shared radattr.o
+ $(CC) $(CFLAGS) -o radattr.so -shared radattr.o
radrealms.so: radrealms.o
- $(CC) -o radrealms.so -shared radrealms.o
+ $(CC) $(CFLAGS) -o radrealms.so -shared radrealms.o
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
clientid.o sendserver.o lock.o util.o md5.o
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -30,7 +30,7 @@ CFLAGS=$(COPTS) -I../../../include '-DRP
all: rp-pppoe.so pppoe-discovery
pppoe-discovery: pppoe-discovery.o debug.o
- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
+ $(CC) $(CFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
pppoe-discovery.o: pppoe-discovery.c
$(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
@@ -39,7 +39,7 @@ debug.o: debug.c
$(CC) $(CFLAGS) -c -o debug.o debug.c
rp-pppoe.so: plugin.o discovery.o if.o common.o
- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(CFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
install: all
$(INSTALL) -d -m 755 $(LIBDIR)

View File

@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -316,6 +316,9 @@ main(argc, argv)
@@ -308,6 +308,9 @@ main(argc, argv)
struct protent *protp;
char numbuf[16];
@ -60,18 +60,18 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -114,6 +114,8 @@ char linkname[MAXPATHLEN]; /* logical na
bool tune_kernel; /* may alter kernel settings */
@@ -118,6 +118,8 @@ bool tune_kernel; /* may alter kernel s
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
@@ -299,6 +301,13 @@ option_t general_options[] = {
"Unset user environment variable",
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
@@ -317,6 +319,13 @@ option_t general_options[] = {
"Metric to use for the default route (Linux only; -1 for default behavior)",
OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
+ { "ip-up-script", o_string, path_ipup,
+ "Set pathname of ip-up script",
@ -85,10 +85,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
"Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -318,6 +318,8 @@ extern bool tune_kernel; /* May alter ke
extern int connect_delay; /* Time to delay after connect script */
@@ -332,6 +332,8 @@ extern int connect_delay; /* Time to del
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
extern bool multilink; /* enable multilink operation */

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -458,6 +458,13 @@ int generic_establish_ppp (int fd)
@@ -460,6 +460,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;

View File

@ -11,7 +11,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -773,8 +773,7 @@ detach()
@@ -768,8 +768,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);

View File

@ -161,7 +161,7 @@
} else {
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -585,7 +585,7 @@ void demand_conf __P((void)); /* config
@@ -599,7 +599,7 @@ void demand_conf __P((void)); /* config
void demand_block __P((void)); /* set all NPs to queue up packets */
void demand_unblock __P((void)); /* set all NPs to pass packets */
void demand_discard __P((void)); /* set all NPs to discard packets */

View File

@ -125,9 +125,9 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
bool old_vj; /* use old (short) form of VJ option? */
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -121,6 +121,11 @@ the gateway, when IPCP negotiation is su
This entry is removed when the PPP connection is broken. This option
is privileged if the \fInodefaultroute\fR option has been specified.
@@ -127,6 +127,11 @@ is no other default route with the same
value of -1, the route is only added if there is no default route at
all.
.TP
+.B replacedefaultroute
+This option is a flag to the defaultroute option. If defaultroute is
@ -137,7 +137,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
@@ -734,7 +739,12 @@ disable both forms of hardware flow cont
@@ -740,7 +745,12 @@ disable both forms of hardware flow cont
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
@ -153,7 +153,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
.B nodeflate
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -667,7 +667,7 @@ int sif6addr __P((int, eui64_t, eui64_t
@@ -681,7 +681,7 @@ int sif6addr __P((int, eui64_t, eui64_t
int cif6addr __P((int, eui64_t, eui64_t));
/* Remove an IPv6 address from i/f */
#endif
@ -173,7 +173,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
static char proxy_arp_dev[16]; /* Device for proxy arp entry */
static u_int32_t our_old_addr; /* for detecting address changes */
@@ -1552,6 +1554,9 @@ static int read_route_table(struct rtent
@@ -1570,6 +1572,9 @@ static int read_route_table(struct rtent
p = NULL;
}
@ -183,7 +183,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
@@ -1621,20 +1626,51 @@ int have_route_to(u_int32_t addr)
@@ -1642,20 +1647,52 @@ int have_route_to(u_int32_t addr)
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
@ -193,10 +193,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-{
- struct rtentry rt;
-
- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
- if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) {
- if (rt.rt_flags & RTF_GATEWAY)
- error("not replacing existing default route via %I",
- SIN_ADDR(rt.rt_gateway));
- error("not replacing existing default route via %I with metric %d",
- SIN_ADDR(rt.rt_gateway), dfl_route_metric);
- else
+ *
+ * If the global default_rt_repl_rest flag is set, then this function
@ -218,16 +218,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ are called again, we will delete the current default route
+ and set the new default route in this function.
+ - this is normally only the case the doing demand: */
+ if (defaultroute_exists(&tmp_rt))
+ if (defaultroute_exists(&tmp_rt, dfl_route_metric))
+ del_rt = &tmp_rt;
+ } else if (defaultroute_exists(&old_def_rt) &&
+ } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) &&
+ strcmp(old_def_rt.rt_dev, ifname) != 0) {
+ /* We did not yet replace an existing default route, let's
+ check if we should save and replace a default route: */
+ if (old_def_rt.rt_flags & RTF_GATEWAY) {
+ if (!replace) {
+ error("not replacing existing default route via %I",
+ SIN_ADDR(old_def_rt.rt_gateway));
+ error("not replacing existing default route via %I with metric %d",
+ SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric);
+ return 0;
+ } else {
+ /* we need to copy rt_dev because we need it permanent too: */
@ -235,20 +235,21 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ strcpy(tmp_dev, old_def_rt.rt_dev);
+ old_def_rt.rt_dev = tmp_dev;
+
+ notice("replacing old default route to %s [%I]",
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
+ notice("replacing old default route to %s [%I] with metric %d",
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway),
+ dfl_route_metric);
+ default_rt_repl_rest = 1;
+ del_rt = &old_def_rt;
+ }
+ } else
error("not replacing existing default route through %s",
- rt.rt_dev);
error("not replacing existing default route through %s with metric %d",
- rt.rt_dev, dfl_route_metric);
- return 0;
+ old_def_rt.rt_dev);
+ old_def_rt.rt_dev, dfl_route_metric);
}
memset (&rt, 0, sizeof (rt));
@@ -1649,10 +1685,16 @@ int sifdefaultroute (int unit, u_int32_t
@@ -1671,10 +1708,16 @@ int sifdefaultroute (int unit, u_int32_t
rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
@ -266,7 +267,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
have_default_route = 1;
return 1;
@@ -1683,11 +1725,21 @@ int cifdefaultroute (int unit, u_int32_t
@@ -1708,11 +1751,21 @@ int cifdefaultroute (int unit, u_int32_t
rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
if (still_ppp()) {

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -318,6 +318,8 @@ main(argc, argv)
@@ -310,6 +310,8 @@ main(argc, argv)
strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
new_phase(PHASE_INITIALIZE);
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -116,6 +116,8 @@ int connect_delay = 1000; /* wait this m
int req_unit = -1; /* requested interface unit */
@@ -120,6 +120,8 @@ int req_unit = -1; /* requested interfa
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
+char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
@ -32,7 +32,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
@@ -308,6 +310,13 @@ option_t general_options[] = {
@@ -326,6 +328,13 @@ option_t general_options[] = {
"Set pathname of ip-down script",
OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
@ -84,8 +84,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -320,6 +320,8 @@ extern int max_data_rate; /* max bytes/s
extern int req_unit; /* interface unit number to use */
@@ -334,6 +334,8 @@ extern int req_unit; /* interface unit n
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
+extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */

View File

@ -42,7 +42,7 @@
*/
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -563,6 +563,11 @@ to 1) if the \fIproxyarp\fR option is us
@@ -569,6 +569,11 @@ to 1) if the \fIproxyarp\fR option is us
dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
1) in demand mode if the local address changes.
.TP

View File

@ -1,19 +1,5 @@
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -73,12 +73,12 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
-#include <sys/errno.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/sysmacros.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
@@ -102,22 +102,15 @@
#define MAX_ADDR_LEN 7
#endif

View File

@ -1,7 +1,7 @@
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -48,11 +48,7 @@
#endif
@@ -52,11 +52,7 @@
#include <netinet/in.h>
/* Ugly header files on some Linux boxes... */
-#if defined(HAVE_LINUX_IF_H)
@ -12,15 +12,13 @@
#ifdef HAVE_NET_IF_TYPES_H
#include <net/if_types.h>
@@ -80,22 +76,8 @@ typedef unsigned long UINT32_t;
@@ -84,20 +80,7 @@ typedef unsigned long UINT32_t;
#error Could not find a 32-bit integer type
#endif
-#ifdef HAVE_LINUX_IF_ETHER_H
-#include <linux/if_ether.h>
-#endif
-
#include <netinet/in.h>
-
-#ifdef HAVE_NETINET_IF_ETHER_H
-#include <sys/types.h>
@ -35,45 +33,11 @@
+#include <net/ethernet.h>
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -16,6 +16,7 @@
#include <string.h>
#include "pppoe.h"
+#include "pppd/pppd.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -717,6 +718,23 @@ char *xstrdup(const char *s)
return ret;
}
+void
+error(char *fmt, ...)
+{
+ va_list pvar;
+
+#if defined(__STDC__)
+ va_start(pvar, fmt);
+#else
+ char *fmt;
+ va_start(pvar);
+ fmt = va_arg(pvar, char *);
+#endif
+
+ fprintf(stderr, fmt, pvar);
+ va_end(pvar);
+}
+
void usage(void)
{
fprintf(stderr, "Usage: pppoe-discovery [options]\n");
/* Ethernet frame types according to RFC 2516 */
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -33,7 +33,7 @@ pppoe-discovery: pppoe-discovery.o debug
$(CC) $(CFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
$(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
pppoe-discovery.o: pppoe-discovery.c
- $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c

View File

@ -23,9 +23,9 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-USE_TDB=y
+#USE_TDB=y
HAS_SHADOW=y
#USE_PAM=y
@@ -80,7 +80,7 @@ MAXOCTETS=y
# Uncomment the next line to enable Type=notify services in systemd
# If enabled, and the user sets the up_sdnotify option, then
@@ -85,7 +85,7 @@ MAXOCTETS=y
INCLUDE_DIRS= -I../include
@ -34,7 +34,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
@@ -120,10 +120,10 @@ CFLAGS += -DHAS_SHADOW
@@ -125,10 +125,10 @@ CFLAGS += -DHAS_SHADOW
#LIBS += -lshadow $(LIBS)
endif

View File

@ -559,8 +559,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->bsd_compress) {
opt_buf[0] = CI_BSD_COMPRESS;
opt_buf[1] = CILEN_BSD_COMPRESS;
@@ -679,7 +814,8 @@ ccp_cilen(f)
+ (go->deflate? CILEN_DEFLATE: 0)
@@ -680,7 +815,8 @@ ccp_cilen(f)
+ (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
+ (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ (go->predictor_2? CILEN_PREDICTOR_2: 0)
- + (go->mppe? CILEN_MPPE: 0);
@ -569,7 +569,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
/*
@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp)
@@ -694,6 +830,8 @@ ccp_addci(f, p, lenp)
{
int res;
ccp_options *go = &ccp_gotoptions[f->unit];
@ -578,7 +578,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
u_char *p0 = p;
/*
@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp)
@@ -702,22 +840,43 @@ ccp_addci(f, p, lenp)
* in case it gets Acked.
*/
#ifdef MPPE
@ -631,7 +631,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate) {
p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
p[1] = CILEN_DEFLATE;
@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp)
@@ -803,7 +962,7 @@ ccp_addci(f, p, lenp)
/*
* ccp_ackci - process a received configure-ack, and return
@ -640,7 +640,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
*/
static int
ccp_ackci(f, p, len)
@@ -811,24 +970,44 @@ ccp_ackci(f, p, len)
@@ -812,24 +971,44 @@ ccp_ackci(f, p, len)
int len;
{
ccp_options *go = &ccp_gotoptions[f->unit];
@ -694,7 +694,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate) {
if (len < CILEN_DEFLATE
|| p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject)
@@ -902,6 +1081,8 @@ ccp_nakci(f, p, len, treat_as_reject)
int treat_as_reject;
{
ccp_options *go = &ccp_gotoptions[f->unit];
@ -703,7 +703,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ccp_options no; /* options we've seen already */
ccp_options try; /* options to ask for next time */
@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject)
@@ -909,28 +1090,100 @@ ccp_nakci(f, p, len, treat_as_reject)
try = *go;
#ifdef MPPE
@ -822,7 +822,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate && len >= CILEN_DEFLATE
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
&& p[1] == CILEN_DEFLATE) {
@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len)
@@ -1003,14 +1256,50 @@ ccp_rejci(f, p, len)
return -1;
#ifdef MPPE
@ -877,7 +877,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate_correct && len >= CILEN_DEFLATE
&& p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak)
@@ -1074,14 +1363,15 @@ ccp_reqci(f, p, lenp, dont_nak)
int dont_nak;
{
int ret, newret, res;
@ -897,7 +897,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ret = CONFACK;
retp = p0 = p;
@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak)
@@ -1104,106 +1394,302 @@ ccp_reqci(f, p, lenp, dont_nak)
switch (type) {
#ifdef MPPE
case CI_MPPE:
@ -1293,7 +1293,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (!ao->deflate || clen != CILEN_DEFLATE
@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak)
@@ -1345,12 +1831,6 @@ ccp_reqci(f, p, lenp, dont_nak)
else
*lenp = retp - p0;
}
@ -1306,7 +1306,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
return ret;
}
@@ -1371,24 +1851,35 @@ method_name(opt, opt2)
@@ -1372,24 +1852,35 @@ method_name(opt, opt2)
char *p = result;
char *q = result + sizeof(result); /* 1 past result */
@ -1358,7 +1358,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
@@ -1444,12 +1935,12 @@ ccp_up(f)
@@ -1445,12 +1936,12 @@ ccp_up(f)
} else if (ANY_COMPRESS(*ho))
notice("%s transmit compression enabled", method_name(ho, NULL));
#ifdef MPPE
@ -1373,7 +1373,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
/*
@@ -1472,7 +1963,7 @@ ccp_down(f)
@@ -1473,7 +1964,7 @@ ccp_down(f)
lcp_close(f->unit, "MPPE disabled");
}
}
@ -1382,7 +1382,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
/*
@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg)
@@ -1533,24 +2024,28 @@ ccp_printpkt(p, plen, printer, arg)
#ifdef MPPE
case CI_MPPE:
if (optlen >= CILEN_MPPE) {
@ -1423,7 +1423,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (optlen >= CILEN_DEFLATE) {
@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len)
@@ -1636,6 +2131,7 @@ ccp_datainput(unit, pkt, len)
error("Lost compression sync: disabling compression");
ccp_close(unit, "Lost compression sync");
#ifdef MPPE
@ -1431,7 +1431,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* If we were doing MPPE, we must also take the link down.
*/
@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len)
@@ -1643,9 +2139,18 @@ ccp_datainput(unit, pkt, len)
error("Too many MPPE errors, closing LCP");
lcp_close(unit, "Too many MPPE errors");
}
@ -1459,7 +1459,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
bool deflate_draft; /* use draft RFC code for deflate? */
+ bool lzs; /* do Stac LZS? */
+ bool mppc; /* do MPPC? */
bool mppe; /* do MPPE? */
u_char mppe; /* MPPE bitfield */
+ bool mppe_40; /* allow 40 bit encryption? */
+ bool mppe_56; /* allow 56 bit encryption? */
+ bool mppe_128; /* allow 128 bit encryption? */

View File

@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
clean:
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -102,7 +102,7 @@ ifdef USE_SRP
@@ -107,7 +107,7 @@ ifdef USE_SRP
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
TARGETS += srp-entry
@ -28,7 +28,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
MANPAGES += srp-entry.8
EXTRACLEAN += srp-entry.o
NEEDDES=y
@@ -208,7 +208,7 @@ all: $(TARGETS)
@@ -219,7 +219,7 @@ all: $(TARGETS)
install: pppd
mkdir -p $(BINDIR) $(MANDIR)
$(EXTRAINSTALL)

View File

@ -18,6 +18,23 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol.
@@ -43,13 +44,13 @@ install: all
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
radius.so: radius.o libradiusclient.a
- $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
+ $(CC) $(LDFLAGS) -fPIC -o radius.so -shared radius.o libradiusclient.a
radattr.so: radattr.o
- $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
+ $(CC) $(LDFLAGS) -fPIC -o radattr.so -shared radattr.o
radrealms.so: radrealms.o
- $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
+ $(CC) $(LDFLAGS) -fPIC -o radrealms.so -shared radrealms.o
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
clientid.o sendserver.o lock.o util.o md5.o
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@
@ -36,8 +53,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
$(CC) $(CFLAGS) -c -o debug.o debug.c
rp-pppoe.so: plugin.o discovery.o if.o common.o
- $(CC) $(CFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(CFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
- $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
install: all
$(INSTALL) -d -m 755 $(LIBDIR)

View File

@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
static void setup_signals __P((void));
static void create_pidfile __P((int pid));
static void create_linkpidfile __P((int pid));
@@ -535,6 +537,7 @@ main(argc, argv)
@@ -527,6 +529,7 @@ main(argc, argv)
info("Starting link");
}
@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
gettimeofday(&start_time, NULL);
script_unsetenv("CONNECT_TIME");
script_unsetenv("BYTES_SENT");
@@ -1267,6 +1270,36 @@ struct callout {
@@ -1262,6 +1265,36 @@ struct callout {
static struct callout *callout = NULL; /* Callout list */
static struct timeval timenow; /* Current time */
@ -74,7 +74,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* timeout - Schedule a timeout.
@@ -1337,6 +1370,8 @@ calltimeout()
@@ -1332,6 +1365,8 @@ calltimeout()
{
struct callout *p;
@ -83,7 +83,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
while (callout != NULL) {
p = callout;
@@ -1364,6 +1399,8 @@ timeleft(tvp)
@@ -1359,6 +1394,8 @@ timeleft(tvp)
{
if (callout == NULL)
return NULL;

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -1048,7 +1048,8 @@ get_input()
@@ -1043,7 +1043,8 @@ get_input()
}
notice("Modem hangup");
hungup = 1;

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -178,8 +178,8 @@ endif
@@ -189,8 +189,8 @@ endif
ifdef FILTER
ifneq ($(wildcard /usr/include/pcap-bpf.h),)

View File

@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to enable multilink PPP (enabled by default)
# Linux distributions: Please leave multilink ENABLED in your builds
# of pppd!
@@ -183,6 +186,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)
@@ -194,6 +197,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)
endif
endif
@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on...
@@ -165,6 +166,13 @@ static int setlogfile __P((char **));
@@ -170,6 +171,13 @@ static int setlogfile __P((char **));
static int loadplugin __P((char **));
#endif
@ -62,7 +62,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef PPP_FILTER
static int setpassfilter __P((char **));
static int setactivefilter __P((char **));
@@ -344,6 +352,14 @@ option_t general_options[] = {
@@ -362,6 +370,14 @@ option_t general_options[] = {
"set filter for active pkts", OPT_PRIO },
#endif
@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
@@ -1493,6 +1509,29 @@ callfile(argv)
@@ -1511,6 +1527,29 @@ callfile(argv)
return ok;
}

View File

@ -1,135 +0,0 @@
pppd: Support arbitrary interface names
This patch implements a new string option "ifname" which allows to specify
fully custom PPP interface names on Linux. It does so by renaming the
allocated pppX device immediately after it has been created to the requested
interface name.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -745,8 +745,11 @@ void
set_ifunit(iskey)
int iskey;
{
- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ if (use_ifname[0] == 0)
+ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ else
+ slprintf(ifname, sizeof(ifname), "%s", use_ifname);
+ info("Using interface %s", ifname);
script_setenv("IFNAME", ifname, iskey);
if (iskey) {
create_pidfile(getpid()); /* write pid to file */
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -112,6 +112,7 @@ int log_to_fd = 1; /* send log messages
bool log_default = 1; /* log_to_fd is default (stdout) */
int maxfail = 10; /* max # of unsuccessful connection attempts */
char linkname[MAXPATHLEN]; /* logical name for link */
+char use_ifname[IFNAMSIZ]; /* physical name for PPP link */
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
@@ -277,6 +278,9 @@ option_t general_options[] = {
{ "linkname", o_string, linkname,
"Set logical name for link",
OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXPATHLEN },
+ { "ifname", o_string, use_ifname,
+ "Set physical name for PPP interface",
+ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, IFNAMSIZ },
{ "maxfail", o_int, &maxfail,
"Maximum number of unsuccessful connection attempts to allow",
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -74,6 +74,10 @@
#include "eui64.h"
#endif
+#ifndef IFNAMSIZ
+#define IFNAMSIZ 16
+#endif
+
/*
* Limits.
*/
@@ -317,6 +321,7 @@ extern char *record_file; /* File to rec
extern bool sync_serial; /* Device is synchronous serial device */
extern int maxfail; /* Max # of unsuccessful connection attempts */
extern char linkname[MAXPATHLEN]; /* logical name for link */
+extern char use_ifname[IFNAMSIZ]; /* physical name for PPP interface */
extern bool tune_kernel; /* May alter kernel settings as necessary */
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -161,6 +161,10 @@ struct in6_ifreq {
/* We can get an EIO error on an ioctl if the modem has hung up */
#define ok_error(num) ((num)==EIO)
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME "ppp"
+#endif /* !defined(PPP_DRV_NAME) */
+
static int tty_disc = N_TTY; /* The TTY discipline */
static int ppp_disc = N_PPP; /* The PPP discpline */
static int initfdflags = -1; /* Initial file descriptor flags for fd */
@@ -620,7 +624,8 @@ void generic_disestablish_ppp(int dev_fd
*/
static int make_ppp_unit()
{
- int x, flags;
+ struct ifreq ifr;
+ int x, flags, s;
if (ppp_dev_fd >= 0) {
dbglog("in make_ppp_unit, already had /dev/ppp open?");
@@ -643,6 +648,30 @@ static int make_ppp_unit()
}
if (x < 0)
error("Couldn't create new ppp unit: %m");
+
+ if (use_ifname[0] != 0) {
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_PACKET, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_UNIX, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ slprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s%d", PPP_DRV_NAME, ifunit);
+ slprintf(ifr.ifr_newname, sizeof(ifr.ifr_newname), "%s", use_ifname);
+ x = ioctl(s, SIOCSIFNAME, &ifr);
+ close(s);
+ } else {
+ x = s;
+ }
+ if (x < 0) {
+ error("Couldn't rename %s to %s", ifr.ifr_name, ifr.ifr_newname);
+ close(ppp_dev_fd);
+ ppp_dev_fd = -1;
+ }
+ }
+
return x;
}
--- a/pppstats/pppstats.c
+++ b/pppstats/pppstats.c
@@ -506,10 +506,12 @@ main(argc, argv)
if (argc > 0)
interface = argv[0];
+#if 0
if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
fprintf(stderr, "%s: invalid interface '%s' specified\n",
progname, interface);
}
+#endif
#ifndef STREAMS
{

View File

@ -8,7 +8,15 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
2 files changed, 53 insertions(+), 14 deletions(-)
--- a/pppd/multilink.c
+++ b/pppd/multilink.c
@@ -56,7 +56,8 @@ static void iterate_bundle_links __P((vo
@@ -35,6 +35,7 @@
#include <signal.h>
#include <netinet/in.h>
#include <unistd.h>
+#include <net/if.h>
#include "pppd.h"
#include "fsm.h"
@@ -56,7 +57,8 @@ static void iterate_bundle_links __P((vo
static int get_default_epdisc __P((struct epdisc *));
static int parse_num __P((char *str, const char *key, int *valp));
@ -18,7 +26,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
#define set_ip_epdisc(ep, addr) do { \
ep->length = 4; \
@@ -197,35 +198,38 @@ mp_join_bundle()
@@ -197,35 +199,38 @@ mp_join_bundle()
key.dptr = bundle_id;
key.dsize = p - bundle_id;
pid = tdb_fetch(pppdb, key);
@ -65,7 +73,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
}
/* we have to make a new bundle */
@@ -408,22 +412,45 @@ parse_num(str, key, valp)
@@ -408,22 +413,45 @@ parse_num(str, key, valp)
return 0;
}
@ -118,7 +126,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
&& memcmp(vd.dptr, key.dptr, vd.dsize) == 0;
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -698,6 +698,16 @@ void cfg_bundle(int mrru, int mtru, int
@@ -686,6 +686,16 @@ void cfg_bundle(int mrru, int mtru, int
add_fd(ppp_dev_fd);
}
@ -135,7 +143,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
/*
* make_new_bundle - create a new PPP unit (i.e. a bundle)
* and connect our channel to it. This should only get called
@@ -716,6 +726,8 @@ void make_new_bundle(int mrru, int mtru,
@@ -704,6 +714,8 @@ void make_new_bundle(int mrru, int mtru,
/* set the mrru and flags */
cfg_bundle(mrru, mtru, rssn, tssn);

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -1756,6 +1756,7 @@ int cifdefaultroute (int unit, u_int32_t
@@ -1753,6 +1753,7 @@ int cifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}

View File

@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -1710,6 +1710,9 @@ int sifdefaultroute (int unit, u_int32_t
@@ -1703,6 +1703,9 @@ int sifdefaultroute (int unit, u_int32_t
memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET);
@ -21,9 +21,9 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ SIN_ADDR(rt.rt_gateway) = gateway;
+
rt.rt_dev = ifname;
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
if (kernel_version > KVERSION(2,1,0)) {
@@ -1717,7 +1720,7 @@ int sifdefaultroute (int unit, u_int32_t
@@ -1711,7 +1714,7 @@ int sifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}

View File

@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -196,7 +196,7 @@ static int driver_is_old = 0;
@@ -192,7 +192,7 @@ static int driver_is_old = 0;
static int restore_term = 0; /* 1 => we've munged the terminal */
static struct termios inittermios; /* Initial TTY termios */
@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
static char loop_name[20];
static unsigned char inbuf[512]; /* buffer for chars read from loopback */
@@ -214,8 +214,8 @@ static int looped; /* 1 if using loop
@@ -210,8 +210,8 @@ static int looped; /* 1 if using loop
static int link_mtu; /* mtu for the link (not bundle) */
static struct utsname utsname; /* for the kernel version */
@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#define MAX_IFS 100
@@ -1451,11 +1451,12 @@ int ccp_fatal_error (int unit)
@@ -1439,11 +1439,12 @@ int ccp_fatal_error (int unit)
*
* path_to_procfs - find the path to the proc file system mount point
*/
@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
struct mntent *mntent;
FILE *fp;
@@ -1477,6 +1478,7 @@ static char *path_to_procfs(const char *
@@ -1465,6 +1466,7 @@ static char *path_to_procfs(const char *
fclose (fp);
}
}
@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
strlcpy(proc_path + proc_path_len, tail,
sizeof(proc_path) - proc_path_len);
@@ -2129,15 +2131,19 @@ int ppp_available(void)
@@ -2126,15 +2128,19 @@ int ppp_available(void)
int my_version, my_modification, my_patch;
int osmaj, osmin, ospatch;
@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* XXX should get from driver */
driver_version = 2;
@@ -2197,6 +2203,7 @@ int ppp_available(void)
@@ -2194,6 +2200,7 @@ int ppp_available(void)
if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
ok = 0;
@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* This is the PPP device. Validate the version of the driver at this
@@ -2730,6 +2737,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
@@ -2727,6 +2734,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
}
#endif /* TIOCGPTN */
@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (sfd < 0) {
/* the old way - scan through the pty name space */
for (i = 0; i < 64; ++i) {
@@ -2748,6 +2756,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
@@ -2745,6 +2753,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
}
}
}
@ -125,7 +125,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
char *pppd_pppoe_service = NULL;
static char *acName = NULL;
static char *existingSession = NULL;
@@ -371,10 +368,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
@@ -372,10 +369,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
void
plugin_init(void)
{

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -317,7 +317,6 @@ extern int holdoff; /* Dead time before
@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before
extern bool holdoff_specified; /* true if user gave a holdoff value */
extern bool notty; /* Stdin/out is not a tty */
extern char *pty_socket; /* Socket to connect to pty */

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -2267,6 +2267,7 @@ int ppp_available(void)
@@ -2264,6 +2264,7 @@ int ppp_available(void)
void logwtmp (const char *line, const char *name, const char *host)
{
@ -15,7 +15,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
struct utmp ut, *utp;
pid_t mypid = getpid();
#if __GLIBC__ < 2
@@ -2332,6 +2333,7 @@ void logwtmp (const char *line, const ch
@@ -2329,6 +2330,7 @@ void logwtmp (const char *line, const ch
close (wtmp);
}
#endif

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -882,14 +882,17 @@ struct protocol_list {
@@ -874,14 +874,17 @@ struct protocol_list {
const char *name;
} protocol_list[] = {
{ 0x21, "IP" },
@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x33, "Stream Protocol ST-II" },
{ 0x35, "Banyan Vines" },
{ 0x39, "AppleTalk EDDP" },
@@ -903,8 +906,11 @@ struct protocol_list {
@@ -895,8 +898,11 @@ struct protocol_list {
{ 0x49, "Serial Data Transport Protocol (PPP-SDTP)" },
{ 0x4b, "SNA over 802.2" },
{ 0x4d, "SNA" },
@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x53, "Encryption" },
{ 0x55, "Individual Link Encryption" },
{ 0x57, "IPv6" },
@@ -915,12 +921,15 @@ struct protocol_list {
@@ -907,12 +913,15 @@ struct protocol_list {
{ 0x65, "RTP IPHC Compressed non-TCP" },
{ 0x67, "RTP IPHC Compressed UDP 8" },
{ 0x69, "RTP IPHC Compressed RTP 8" },
@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x0203, "IBM Source Routing BPDU" },
{ 0x0205, "DEC LANBridge100 Spanning Tree" },
{ 0x0207, "Cisco Discovery Protocol" },
@@ -932,15 +941,19 @@ struct protocol_list {
@@ -924,15 +933,19 @@ struct protocol_list {
{ 0x0231, "Luxcom" },
{ 0x0233, "Sigma Network Systems" },
{ 0x0235, "Apple Client Server Protocol" },
@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x4001, "Cray Communications Control Protocol" },
{ 0x4003, "CDPD Mobile Network Registration Protocol" },
{ 0x4005, "Expand accelerator protocol" },
@@ -951,8 +964,10 @@ struct protocol_list {
@@ -943,8 +956,10 @@ struct protocol_list {
{ 0x4023, "RefTek Protocol" },
{ 0x4025, "Fibre Channel" },
{ 0x4027, "EMIT Protocols" },
@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8023, "OSI Network Layer Control Protocol" },
{ 0x8025, "Xerox NS IDP Control Protocol" },
{ 0x8027, "DECnet Phase IV Control Protocol" },
@@ -961,7 +976,9 @@ struct protocol_list {
@@ -953,7 +968,9 @@ struct protocol_list {
{ 0x8031, "Bridging NCP" },
{ 0x8033, "Stream Protocol Control Protocol" },
{ 0x8035, "Banyan Vines Control Protocol" },
@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x803f, "NETBIOS Framing Control Protocol" },
{ 0x8041, "Cisco Systems Control Protocol" },
{ 0x8043, "Ascom Timeplex" },
@@ -970,18 +987,24 @@ struct protocol_list {
@@ -962,18 +979,24 @@ struct protocol_list {
{ 0x8049, "Serial Data Control Protocol (PPP-SDCP)" },
{ 0x804b, "SNA over 802.2 Control Protocol" },
{ 0x804d, "SNA Control Protocol" },
@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8207, "Cisco Discovery Protocol Control" },
{ 0x8209, "Netcs Twin Routing" },
{ 0x820b, "STP - Control Protocol" },
@@ -990,24 +1013,29 @@ struct protocol_list {
@@ -982,24 +1005,29 @@ struct protocol_list {
{ 0x8281, "MPLSCP" },
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" },
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" },

View File

@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -336,13 +336,14 @@ option_t general_options[] = {
@@ -350,13 +350,14 @@ option_t general_options[] = {
"Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 },
{ "nomultilink", o_bool, &multilink,
"Disable multilink operation", OPT_PRIOSUB | 0 },

View File

@ -147,7 +147,7 @@
strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -348,7 +348,7 @@ packetIsForMe(PPPoEConnection *conn, PPP
@@ -356,7 +356,7 @@ packetIsForMe(PPPoEConnection *conn, PPP
if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
/* If we're not using the Host-Unique tag, then accept the packet */
@ -156,7 +156,7 @@
parsePacket(packet, parseForHostUniq, &forMe);
return forMe;
@@ -474,16 +474,12 @@ sendPADI(PPPoEConnection *conn)
@@ -494,16 +494,12 @@ sendPADI(PPPoEConnection *conn)
cursor += namelen + TAG_HDR_SIZE;
/* If we're using Host-Uniq, copy it over */
@ -179,17 +179,17 @@
}
packet.length = htons(plen);
@@ -645,7 +641,7 @@ int main(int argc, char *argv[])
@@ -669,7 +665,7 @@ int main(int argc, char *argv[])
conn->discoveryTimeout = PADI_TIMEOUT;
conn->discoveryAttempts = MAX_PADI_ATTEMPTS;
memset(conn, 0, sizeof(PPPoEConnection));
- while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
+ while ((opt = getopt(argc, argv, "I:D:VUW:AS:C:h")) > 0) {
- while ((opt = getopt(argc, argv, "I:D:VUQS:C:t:a:h")) > 0) {
+ while ((opt = getopt(argc, argv, "I:D:VUW:QS:C:t:a:h")) > 0) {
switch(opt) {
case 'S':
conn->serviceName = xstrdup(optarg);
@@ -654,7 +650,23 @@ int main(int argc, char *argv[])
conn->acName = xstrdup(optarg);
@@ -696,7 +692,23 @@ int main(int argc, char *argv[])
}
break;
case 'U':
- conn->useHostUniq = 1;
@ -224,7 +224,7 @@
/* How do we access raw Ethernet devices? */
#undef USE_LINUX_PACKET
@@ -217,7 +219,7 @@ typedef struct PPPoEConnectionStruct {
@@ -219,7 +221,7 @@ typedef struct PPPoEConnectionStruct {
char *serviceName; /* Desired service name, if any */
char *acName; /* Desired AC name, if any */
int synchronous; /* Use synchronous PPP */
@ -233,7 +233,7 @@
int printACNames; /* Just print AC names */
FILE *debugFile; /* Debug file for dumping packets */
int numPADOs; /* Number of PADO packets received */
@@ -273,6 +275,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
@@ -276,6 +278,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
void (*printer)(void *, char *, ...), void *arg);
void pppoe_log_packet(const char *prefix, PPPoEPacket *packet);

View File

@ -1,11 +0,0 @@
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -275,7 +275,7 @@ PPPOEDisconnectDevice(void)
sizeof(struct sockaddr_pppox)) < 0)
error("Failed to disconnect PPPoE socket: %d %m", errno);
close(conn->sessionSocket);
- /* don't send PADT?? */
+ sendPADT(conn, NULL);
if (conn->discoverySocket >= 0)
close(conn->discoverySocket);
}

View File

@ -1,14 +0,0 @@
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -271,9 +271,8 @@ PPPOEDisconnectDevice(void)
sp.sa_addr.pppoe.sid = 0;
memcpy(sp.sa_addr.pppoe.dev, conn->ifName, IFNAMSIZ);
memcpy(sp.sa_addr.pppoe.remote, conn->peerEth, ETH_ALEN);
- if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
- sizeof(struct sockaddr_pppox)) < 0)
- error("Failed to disconnect PPPoE socket: %d %m", errno);
+ connect(conn->sessionSocket, (struct sockaddr *) &sp,
+ sizeof(struct sockaddr_pppox));
close(conn->sessionSocket);
sendPADT(conn, NULL);
if (conn->discoverySocket >= 0)

View File

@ -1,11 +0,0 @@
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -1013,7 +1013,7 @@ print_option(opt, mainopt, printer, arg)
p = (char *) opt->addr2;
if ((opt->flags & OPT_STATIC) == 0)
p = *(char **)p;
- printer("%q", p);
+ printer(arg, "%q", p);
} else if (opt->flags & OPT_A2LIST) {
struct option_value *ovp;

View File

@ -0,0 +1,94 @@
From 831dca008699d485f2c8e91749657ef2d0b06166 Mon Sep 17 00:00:00 2001
From: Martin Schiller <ms@dev.tdt.de>
Date: Thu, 6 Dec 2018 08:43:17 +0100
Subject: [PATCH] Revert "pppd: Use openssl for the DES instead of the libcrypt
/ glibc"
For musl and glibc2.27 we can keep linking to crypt; however if we
switch to glibc 2.28 we will have to link to one of the SSL libraries.
This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
---
pppd/Makefile.linux | 7 +++----
pppd/pppcrypt.c | 18 +++++++++---------
2 files changed, 12 insertions(+), 13 deletions(-)
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -35,10 +35,10 @@ endif
COPTS = -O2 -pipe -Wall -g
LIBS =
-# Uncomment the next line to include support for Microsoft's
+# Uncomment the next 2 lines to include support for Microsoft's
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
CHAPMS=y
-#USE_CRYPT=y
+USE_CRYPT=y
# Don't use MSLANMAN unless you really know what you're doing.
#MSLANMAN=y
# Uncomment the next line to include support for MPPE. CHAPMS (above) must
@@ -140,8 +140,7 @@ endif
ifdef NEEDDES
ifndef USE_CRYPT
-CFLAGS += -I/usr/include/openssl
-LIBS += -lcrypto
+LIBS += -ldes $(LIBS)
else
CFLAGS += -DUSE_CRYPT=1
endif
--- a/pppd/pppcrypt.c
+++ b/pppd/pppcrypt.c
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
des_key[7] = Get7Bits(key, 49);
#ifndef USE_CRYPT
- DES_set_odd_parity((DES_cblock *)des_key);
+ des_set_odd_parity((des_cblock *)des_key);
#endif
}
@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
}
#else /* USE_CRYPT */
-static DES_key_schedule key_schedule;
+static des_key_schedule key_schedule;
bool
DesSetkey(key)
u_char *key;
{
- DES_cblock des_key;
+ des_cblock des_key;
MakeKey(key, des_key);
- DES_set_key(&des_key, &key_schedule);
+ des_set_key(&des_key, key_schedule);
return (1);
}
bool
-DesEncrypt(clear, cipher)
+DesEncrypt(clear, key, cipher)
u_char *clear; /* IN 8 octets */
u_char *cipher; /* OUT 8 octets */
{
- DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
- &key_schedule, 1);
+ des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
+ key_schedule, 1);
return (1);
}
@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
u_char *cipher; /* IN 8 octets */
u_char *clear; /* OUT 8 octets */
{
- DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
- &key_schedule, 0);
+ des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
+ key_schedule, 0);
return (1);
}