Skip to content

Commit

Permalink
pppd: update to 2.4.8
Browse files Browse the repository at this point in the history
78cd384 Update README and patchlevel.h for 2.4.8 release
5d03403 pppd: Avoid use of strnlen (and strlen) in vslprintf
a1e950a pppd: Fix IPv6 default route code for Solaris
ca5e61b plugins/rp-pppoe: Make tag parsing loop condition more accurate
c10c3c7 pppd: Make sure word read from options file is null-terminated
b311e98 pppd: Limit memory accessed by string formats with max length specified
3ea9de9 pppd: Eliminate some more compiler warnings
57edb1a pppd: Include time.h header before using time_t
09f695f pppd: Don't free static string
03104ba pppd.h: Add missing headers
388597e pppd: Add defaultroute6 and related options
66ce4ba pppd: Avoid declarations within statements in main.c
5637180 pppd: Fix `ifname` option in case of multilink (openwrt#105)
d00f8a0 pppd: Fix variable reference syntax in Makefile.linux
b6b4d28 pppd: Check tdb pointer before closing

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
  • Loading branch information
dengqf6 authored and hauke committed Jan 5, 2020
1 parent 3d7f763 commit 983605e
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 68 deletions.
11 changes: 5 additions & 6 deletions package/network/services/ppp/Makefile
Expand Up @@ -9,19 +9,18 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=ppp
PKG_RELEASE:=2
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
PKG_SOURCE_DATE:=2019-10-04
PKG_SOURCE_VERSION:=0d004db25edd42f6720f48eedc51f68a781278db
PKG_MIRROR_HASH:=93f66ee06d58c447288c88ac1c17453c2b12a8af7f16ef132b31529b1955b7a2
PKG_SOURCE_VERSION:=78cd384ce0f48bb5edb84e4fe9a574eab4a4ad14
PKG_MIRROR_HASH:=cf284c312b0c90974d11f8aeece173bcac8475f5b810911f4feb2c5a4db263fe
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_RELEASE_VERSION:=2.4.8
PKG_VERSION:=$(PKG_RELEASE_VERSION)

PKG_BUILD_DEPENDS:=libpcap

Expand Down
Expand Up @@ -85,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
"Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -332,6 +332,8 @@ extern int connect_delay; /* Time to del
@@ -334,6 +334,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 */
Expand Down
Expand Up @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -460,6 +460,13 @@ int generic_establish_ppp (int fd)
@@ -467,6 +467,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;

Expand Down
Expand Up @@ -11,7 +11,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

--- a/pppd/main.c
+++ b/pppd/main.c
@@ -776,8 +776,7 @@ detach()
@@ -780,8 +780,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);
Expand Down
8 changes: 4 additions & 4 deletions package/network/services/ppp/patches/105-debian_demand.patch
Expand Up @@ -150,9 +150,9 @@
} else {
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -1231,7 +1231,7 @@ ipv6cp_up(f)
}

@@ -1252,7 +1252,7 @@ ipv6cp_up(f)
if (sif6defaultroute(f->unit, go->ourid, ho->hisid))
default_route_set[f->unit] = 1;
}
- demand_rexmit(PPP_IPV6);
+ demand_rexmit(PPP_IPV6,0);
Expand All @@ -161,7 +161,7 @@
} else {
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -599,7 +599,7 @@ void demand_conf __P((void)); /* config
@@ -601,7 +601,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 */
Expand Down
26 changes: 13 additions & 13 deletions package/network/services/ppp/patches/110-debian_defaultroute.patch
Expand Up @@ -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
@@ -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.
@@ -133,6 +133,11 @@ the gateway, when IPv6CP negotiation is
This entry is removed when the PPP connection is broken. This option
is privileged if the \fInodefaultroute6\fR option has been specified.
.TP
+.B replacedefaultroute
+This option is a flag to the defaultroute option. If defaultroute is
Expand All @@ -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
@@ -740,7 +745,12 @@ disable both forms of hardware flow cont
@@ -746,7 +751,12 @@ disable both forms of hardware flow cont
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
Expand All @@ -150,10 +150,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+wishes to prevent users from replacing a default route with pppd
can do so by placing this option in the /etc/ppp/options file.
.TP
.B nodeflate
.B nodefaultroute6
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -681,7 +681,7 @@ int sif6addr __P((int, eui64_t, eui64_t
@@ -683,7 +683,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
Expand All @@ -164,16 +164,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* Delete default route through i/f */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -207,6 +207,8 @@ static unsigned char inbuf[512]; /* buff
static int if_is_up; /* Interface has been marked up */
@@ -209,6 +209,8 @@ static int if_is_up; /* Interface has be
static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
static int have_default_route; /* Gateway for default route added */
static int have_default_route6; /* Gateway for default IPv6 route added */
+static struct rtentry old_def_rt; /* Old default route */
+static int default_rt_repl_rest; /* replace and restore old default rt */
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 */
@@ -1570,6 +1572,9 @@ static int read_route_table(struct rtent
@@ -1577,6 +1579,9 @@ static int read_route_table(struct rtent
p = NULL;
}

Expand All @@ -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);
@@ -1642,20 +1647,52 @@ int have_route_to(u_int32_t addr)
@@ -1649,20 +1654,52 @@ int have_route_to(u_int32_t addr)
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
Expand Down Expand Up @@ -249,7 +249,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}

memset (&rt, 0, sizeof (rt));
@@ -1671,10 +1708,16 @@ int sifdefaultroute (int unit, u_int32_t
@@ -1678,10 +1715,16 @@ int sifdefaultroute (int unit, u_int32_t

rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
Expand All @@ -267,7 +267,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

have_default_route = 1;
return 1;
@@ -1708,11 +1751,21 @@ int cifdefaultroute (int unit, u_int32_t
@@ -1715,11 +1758,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()) {
Expand All @@ -292,7 +292,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
--- a/pppd/sys-solaris.c
+++ b/pppd/sys-solaris.c
@@ -2038,12 +2038,18 @@ cifaddr(u, o, h)
@@ -2119,12 +2119,18 @@ cifaddr(u, o, h)
* sifdefaultroute - assign a default route through the address given.
*/
int
Expand Down
Expand Up @@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
"Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -1268,7 +1268,7 @@ ipv6cp_up(f)
@@ -1294,7 +1294,7 @@ ipv6cp_up(f)
*/
if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) {
ipv6cp_script_state = s_up;
Expand All @@ -57,7 +57,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
}

@@ -1320,7 +1320,7 @@ ipv6cp_down(f)
@@ -1346,7 +1346,7 @@ ipv6cp_down(f)
/* Execute the ipv6-down script */
if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) {
ipv6cp_script_state = s_down;
Expand All @@ -66,7 +66,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
}

@@ -1363,13 +1363,13 @@ ipv6cp_script_done(arg)
@@ -1389,13 +1389,13 @@ ipv6cp_script_done(arg)
case s_up:
if (ipv6cp_fsm[0].state != OPENED) {
ipv6cp_script_state = s_down;
Expand All @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -334,6 +334,8 @@ extern int req_unit; /* interface unit n
@@ -336,6 +336,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 */
Expand Down
Expand Up @@ -42,7 +42,7 @@
*/
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -569,6 +569,11 @@ to 1) if the \fIproxyarp\fR option is us
@@ -575,6 +575,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
Expand Down
@@ -1,8 +1,8 @@
--- a/pppd/sha1.c
+++ b/pppd/sha1.c
@@ -18,7 +18,7 @@

@@ -19,7 +19,7 @@
#include <string.h>
#include <time.h>
#include <netinet/in.h> /* htonl() */
-#include <net/ppp_defs.h>
+#include "pppd.h"
Expand Down
4 changes: 2 additions & 2 deletions package/network/services/ppp/patches/200-makefile.patch
Expand Up @@ -38,8 +38,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#LIBS += -lshadow $(LIBS)
endif

-ifneq ($(wildcard $(shell $CC --print-sysroot)/usr/include/crypt.h),)
+#ifneq ($(wildcard $(shell $CC --print-sysroot)/usr/include/crypt.h),)
-ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
+#ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
CFLAGS += -DHAVE_CRYPT_H=1
LIBS += -lcrypt
-endif
Expand Down
Expand Up @@ -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");
@@ -1270,6 +1273,36 @@ struct callout {
@@ -1274,6 +1277,36 @@ struct callout {

static struct callout *callout = NULL; /* Callout list */
static struct timeval timenow; /* Current time */
Expand Down Expand Up @@ -74,7 +74,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

/*
* timeout - Schedule a timeout.
@@ -1340,6 +1373,8 @@ calltimeout()
@@ -1344,6 +1377,8 @@ calltimeout()
{
struct callout *p;

Expand All @@ -83,7 +83,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
while (callout != NULL) {
p = callout;

@@ -1367,6 +1402,8 @@ timeleft(tvp)
@@ -1371,6 +1406,8 @@ timeleft(tvp)
{
if (callout == NULL)
return NULL;
Expand Down
Expand Up @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

--- a/pppd/main.c
+++ b/pppd/main.c
@@ -1051,7 +1051,8 @@ get_input()
@@ -1055,7 +1055,8 @@ get_input()
}
notice("Modem hangup");
hungup = 1;
Expand Down
Expand Up @@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
@@ -1510,6 +1526,29 @@ callfile(argv)
@@ -1511,6 +1527,29 @@ callfile(argv)
return ok;
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
/* make sure the string is null-terminated */
rec.dptr[rec.dsize-1] = 0;
- /* parse the interface number */
- parse_num(rec.dptr, "IFNAME=ppp", &unit);
- parse_num(rec.dptr, "UNIT=", &unit);
+
/* check the pid value */
if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid)
Expand Down Expand Up @@ -114,7 +114,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
TDB_DATA kd, vd;
int ret = 0;

- slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit);
- slprintf(ifkey, sizeof(ifkey), "UNIT=%d", unit);
+ slprintf(ifkey, sizeof(ifkey), "IFNAME=%s", ifname);
+
kd.dptr = ifkey;
Expand All @@ -126,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
@@ -693,6 +693,16 @@ void cfg_bundle(int mrru, int mtru, int
@@ -700,6 +700,16 @@ void cfg_bundle(int mrru, int mtru, int
add_fd(ppp_dev_fd);
}

Expand All @@ -143,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
@@ -711,6 +721,8 @@ void make_new_bundle(int mrru, int mtru,
@@ -718,6 +728,8 @@ void make_new_bundle(int mrru, int mtru,

/* set the mrru and flags */
cfg_bundle(mrru, mtru, rssn, tssn);
Expand Down
Expand Up @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>

--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -1760,6 +1760,7 @@ int cifdefaultroute (int unit, u_int32_t
@@ -1767,6 +1767,7 @@ int cifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}

Expand Down
Expand Up @@ -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
@@ -1717,6 +1717,9 @@ int sifdefaultroute (int unit, u_int32_t
memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET);

Expand All @@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
rt.rt_dev = ifname;
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */

@@ -1718,7 +1721,7 @@ int sifdefaultroute (int unit, u_int32_t
@@ -1725,7 +1728,7 @@ int sifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}

Expand Down

0 comments on commit 983605e

Please sign in to comment.