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>master
parent
f01044e85c
commit
eaaee181d1
@ -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)
|
@ -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
|
||||
{
|
@ -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);
|
||||
}
|
@ -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)
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in new issue