Use values exported from $(TOPDIR)/rules.mk for determining
the target system instead of the host configuration
-Index: ppp-2.4.3/configure
-===================================================================
---- ppp-2.4.3.orig/configure 2007-06-04 13:22:08.549555552 +0200
-+++ ppp-2.4.3/configure 2007-06-04 13:22:08.618545064 +0200
-@@ -8,9 +8,9 @@
+--- a/configure
++++ b/configure
+@@ -8,9 +8,9 @@ SYSCONF=/etc
# if [ -d /NextApps ]; then
# system="NeXTStep"
# else
-diff -Naur ppp-2.4.4.orig/pppd/ipcp.c ppp-2.4.4/pppd/ipcp.c
---- ppp-2.4.4.orig/pppd/ipcp.c 2005-08-25 19:59:34.000000000 -0400
-+++ ppp-2.4.4/pppd/ipcp.c 2009-05-07 15:47:29.000000000 -0400
-@@ -1850,7 +1850,7 @@
+--- a/pppd/ipcp.c
++++ b/pppd/ipcp.c
+@@ -1850,7 +1850,7 @@ ipcp_up(f)
*/
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
ipcp_script_state = s_up;
}
}
-@@ -1900,7 +1900,7 @@
+@@ -1900,7 +1900,7 @@ ipcp_down(f)
/* Execute the ip-down script */
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
ipcp_script_state = s_down;
}
}
-@@ -1954,13 +1954,13 @@
+@@ -1954,13 +1954,13 @@ ipcp_script_done(arg)
case s_up:
if (ipcp_fsm[0].state != OPENED) {
ipcp_script_state = s_down;
}
break;
}
-diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
---- ppp-2.4.4.orig/pppd/main.c 2006-06-03 23:52:50.000000000 -0400
-+++ ppp-2.4.4/pppd/main.c 2009-05-07 15:47:29.000000000 -0400
-@@ -315,6 +315,9 @@
+--- a/pppd/main.c
++++ b/pppd/main.c
+@@ -315,6 +315,9 @@ main(argc, argv)
struct protent *protp;
char numbuf[16];
link_stats_valid = 0;
new_phase(PHASE_INITIALIZE);
-diff -Naur ppp-2.4.4.orig/pppd/options.c ppp-2.4.4/pppd/options.c
---- ppp-2.4.4.orig/pppd/options.c 2006-06-18 07:26:00.000000000 -0400
-+++ ppp-2.4.4/pppd/options.c 2009-05-07 15:47:29.000000000 -0400
-@@ -113,6 +113,8 @@
+--- a/pppd/options.c
++++ b/pppd/options.c
+@@ -113,6 +113,8 @@ char linkname[MAXPATHLEN]; /* logical na
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 */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
-@@ -281,6 +283,13 @@
+@@ -281,6 +283,13 @@ option_t general_options[] = {
"Number of seconds to wait for child processes at exit",
OPT_PRIO },
#ifdef HAVE_MULTILINK
{ "multilink", o_bool, &multilink,
"Enable multilink operation", OPT_PRIO | 1 },
-diff -Naur ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
---- ppp-2.4.4.orig/pppd/pppd.h 2005-08-25 19:59:34.000000000 -0400
-+++ ppp-2.4.4/pppd/pppd.h 2009-05-07 15:47:29.000000000 -0400
-@@ -312,6 +312,8 @@
+--- a/pppd/pppd.h
++++ b/pppd/pppd.h
+@@ -312,6 +312,8 @@ extern bool tune_kernel; /* May alter ke
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
-diff -Naur ppp-2.4.4.orig/pppd/sys-linux.c ppp-2.4.4/pppd/sys-linux.c
---- ppp-2.4.4.orig/pppd/sys-linux.c 2005-08-26 18:44:35.000000000 -0400
-+++ ppp-2.4.4/pppd/sys-linux.c 2009-05-07 15:50:00.000000000 -0400
-@@ -453,6 +453,13 @@
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -453,6 +453,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;
-diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
---- ppp-2.4.4.orig/pppd/main.c 2009-05-07 15:49:34.000000000 -0400
-+++ ppp-2.4.4/pppd/main.c 2009-05-07 15:53:42.000000000 -0400
-@@ -1570,6 +1570,8 @@
+--- a/pppd/main.c
++++ b/pppd/main.c
+@@ -1570,6 +1570,8 @@ safe_fork(int infd, int outfd, int errfd
if (errfd == 0 || errfd == 1)
errfd = dup(errfd);
/* dup the in, out, err fds to 0, 1, 2 */
if (infd != 0)
dup2(infd, 0);
-@@ -1578,7 +1580,6 @@
+@@ -1578,7 +1580,6 @@ safe_fork(int infd, int outfd, int errfd
if (errfd != 2)
dup2(errfd, 2);
-diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
---- ppp-2.4.4.orig/pppd/main.c 2009-05-07 15:58:00.000000000 -0400
-+++ ppp-2.4.4/pppd/main.c 2009-05-07 15:58:19.000000000 -0400
-@@ -772,8 +772,7 @@
+--- a/pppd/main.c
++++ b/pppd/main.c
+@@ -772,8 +772,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);
-diff -Naur ppp-2.4.4.orig/pppd/chap_ms.c ppp-2.4.4/pppd/chap_ms.c
---- ppp-2.4.4.orig/pppd/chap_ms.c 2006-05-21 07:56:40.000000000 -0400
-+++ ppp-2.4.4/pppd/chap_ms.c 2009-05-07 16:13:09.000000000 -0400
-@@ -852,7 +852,7 @@
+--- a/pppd/chap_ms.c
++++ b/pppd/chap_ms.c
+@@ -852,7 +852,7 @@ ChapMS2(u_char *rchallenge, u_char *Peer
u_char *p = &response[MS_CHAP2_PEER_CHALLENGE];
int i;
-diff -Naur ppp-2.4.4.orig/pppd/demand.c ppp-2.4.4/pppd/demand.c
---- ppp-2.4.4.orig/pppd/demand.c 2005-08-25 08:14:18.000000000 -0400
-+++ ppp-2.4.4/pppd/demand.c 2009-05-07 16:16:20.000000000 -0400
+--- a/pppd/demand.c
++++ b/pppd/demand.c
@@ -36,6 +36,8 @@
#include <errno.h>
#include <fcntl.h>
#ifdef PPP_FILTER
#include <pcap-bpf.h>
#endif
-@@ -221,6 +225,14 @@
+@@ -221,6 +225,14 @@ loop_chars(p, n)
int c, rv;
rv = 0;
for (; n > 0; --n) {
c = *p++;
if (c == PPP_FLAG) {
-@@ -299,17 +311,102 @@
+@@ -299,17 +311,102 @@ loop_frame(frame, len)
* loopback, now that the real serial link is up.
*/
void
output(0, pkt->data, pkt->length);
free(pkt);
} else {
-diff -Naur ppp-2.4.4.orig/pppd/ipcp.c ppp-2.4.4/pppd/ipcp.c
---- ppp-2.4.4.orig/pppd/ipcp.c 2009-05-07 15:49:34.000000000 -0400
-+++ ppp-2.4.4/pppd/ipcp.c 2009-05-07 16:16:20.000000000 -0400
-@@ -1776,7 +1776,7 @@
+--- a/pppd/ipcp.c
++++ b/pppd/ipcp.c
+@@ -1776,7 +1776,7 @@ ipcp_up(f)
proxy_arp_set[f->unit] = 1;
}
sifnpmode(f->unit, PPP_IP, NPMODE_PASS);
} else {
-diff -Naur ppp-2.4.4.orig/pppd/ipv6cp.c ppp-2.4.4/pppd/ipv6cp.c
---- ppp-2.4.4.orig/pppd/ipv6cp.c 2005-08-25 19:59:34.000000000 -0400
-+++ ppp-2.4.4/pppd/ipv6cp.c 2009-05-07 16:16:20.000000000 -0400
-@@ -1232,7 +1232,7 @@
+--- a/pppd/ipv6cp.c
++++ b/pppd/ipv6cp.c
+@@ -1232,7 +1232,7 @@ ipv6cp_up(f)
}
}
sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS);
} else {
-diff -Naur ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
---- ppp-2.4.4.orig/pppd/pppd.h 2009-05-07 15:49:34.000000000 -0400
-+++ ppp-2.4.4/pppd/pppd.h 2009-05-07 16:16:20.000000000 -0400
-@@ -565,7 +565,7 @@
+--- a/pppd/pppd.h
++++ b/pppd/pppd.h
+@@ -565,7 +565,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 */
-diff -Naur ppp-2.4.4.orig/pppd/chap-new.c ppp-2.4.4/pppd/chap-new.c
---- ppp-2.4.4.orig/pppd/chap-new.c 2005-07-13 06:41:58.000000000 -0400
-+++ ppp-2.4.4/pppd/chap-new.c 2009-05-07 16:18:37.000000000 -0400
-@@ -57,6 +57,7 @@
+--- a/pppd/chap-new.c
++++ b/pppd/chap-new.c
+@@ -57,6 +57,7 @@ int (*chap_verify_hook)(char *name, char
int chap_timeout_time = 3;
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
/*
* Command-line options.
-@@ -68,6 +69,8 @@
+@@ -68,6 +69,8 @@ static option_t chap_option_list[] = {
"Set max #xmits for challenge", OPT_PRIO },
{ "chap-interval", o_int, &chap_rechallenge_time,
"Set interval for rechallenge", OPT_PRIO },
{ NULL }
};
-@@ -335,6 +338,14 @@
+@@ -335,6 +338,14 @@ chap_handle_response(struct chap_server_
/* Null terminate and clean remote name. */
slprintf(rname, sizeof(rname), "%.*v", len, name);
name = rname;
-diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
---- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2006-05-21 08:44:41.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:22:22.000000000 -0400
-@@ -70,18 +70,20 @@
+--- a/pppd/plugins/pppoatm/pppoatm.c
++++ b/pppd/plugins/pppoatm/pppoatm.c
+@@ -70,18 +70,20 @@ static int setdevname_pppoatm(const char
{
struct sockaddr_atmpvc addr;
extern struct stat devstat;
memcpy(&pvcaddr, &addr, sizeof pvcaddr);
strlcpy(devnam, cp, sizeof devnam);
devstat.st_mode = S_IFSOCK;
-@@ -93,7 +95,6 @@
+@@ -93,7 +95,6 @@ static int setdevname_pppoatm(const char
lcp_allowoptions[0].neg_asyncmap = 0;
lcp_wantoptions[0].neg_pcompression = 0;
}
device_got_set = 1;
return 1;
}
-@@ -108,6 +109,7 @@
+@@ -108,6 +109,7 @@ static void no_device_given_pppoatm(void
static void set_line_discipline_pppoatm(int fd)
{
struct atm_backend_ppp be;
be.backend_num = ATM_BACKEND_PPP;
if (!llc_encaps)
be.encaps = PPPOATM_ENCAPS_VC;
-@@ -115,6 +117,7 @@
+@@ -115,6 +117,7 @@ static void set_line_discipline_pppoatm(
be.encaps = PPPOATM_ENCAPS_LLC;
else
be.encaps = PPPOATM_ENCAPS_AUTODETECT;
if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
fatal("ioctl(ATM_SETBACKEND): %m");
}
-@@ -175,16 +178,19 @@
+@@ -175,16 +178,19 @@ static void send_config_pppoa(int mtu,
{
int sock;
struct ifreq ifr;
}
static void recv_config_pppoa(int mru,
-@@ -198,7 +204,7 @@
+@@ -198,7 +204,7 @@ static void recv_config_pppoa(int mru,
void plugin_init(void)
{
extern int new_style_driver; /* From sys-linux.c */
if (!ppp_available() && !new_style_driver)
fatal("Kernel doesn't support ppp_generic - "
-@@ -206,9 +212,9 @@
+@@ -206,9 +212,9 @@ void plugin_init(void)
#else
fatal("No PPPoATM support on this OS");
#endif
-diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
---- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:41.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:57.000000000 -0400
-@@ -179,8 +179,11 @@
+--- a/pppd/plugins/pppoatm/pppoatm.c
++++ b/pppd/plugins/pppoatm/pppoatm.c
+@@ -179,8 +179,11 @@ static void send_config_pppoa(int mtu,
int sock;
struct ifreq ifr;
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
-@@ -198,8 +201,11 @@
+@@ -198,8 +201,11 @@ static void recv_config_pppoa(int mru,
int pcomp,
int accomp)
{
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/common.c ppp-2.4.4/pppd/plugins/rp-pppoe/common.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/common.c 2004-02-01 22:36:46.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/common.c 2009-05-07 17:01:46.000000000 -0400
-@@ -18,10 +18,6 @@
+--- a/pppd/plugins/rp-pppoe/common.c
++++ b/pppd/plugins/rp-pppoe/common.c
+@@ -18,10 +18,6 @@ static char const RCSID[] =
#include "pppoe.h"
#include <string.h>
#include <errno.h>
#include <stdlib.h>
-@@ -50,17 +46,17 @@
+@@ -50,17 +46,17 @@ parsePacket(PPPoEPacket *packet, ParseFu
UINT16_t tagType, tagLen;
if (packet->ver != 1) {
return -1;
}
-@@ -76,7 +72,7 @@
+@@ -76,7 +72,7 @@ parsePacket(PPPoEPacket *packet, ParseFu
return 0;
}
if ((curTag - packet->payload) + tagLen + TAG_HDR_SIZE > len) {
return -1;
}
func(tagType, tagLen, curTag+TAG_HDR_SIZE, extra);
-@@ -105,17 +101,17 @@
+@@ -105,17 +101,17 @@ findTag(PPPoEPacket *packet, UINT16_t ty
UINT16_t tagType, tagLen;
if (packet->ver != 1) {
return NULL;
}
-@@ -131,7 +127,7 @@
+@@ -131,7 +127,7 @@ findTag(PPPoEPacket *packet, UINT16_t ty
return NULL;
}
if ((curTag - packet->payload) + tagLen + TAG_HDR_SIZE > len) {
return NULL;
}
if (tagType == type) {
-@@ -143,6 +139,7 @@
+@@ -143,6 +139,7 @@ findTag(PPPoEPacket *packet, UINT16_t ty
return NULL;
}
/**********************************************************************
*%FUNCTION: printErr
*%ARGUMENTS:
-@@ -158,6 +155,7 @@
+@@ -158,6 +155,7 @@ printErr(char const *str)
fprintf(stderr, "pppoe: %s\n", str);
syslog(LOG_ERR, "%s", str);
}
/**********************************************************************
-@@ -172,7 +170,7 @@
+@@ -172,7 +170,7 @@ strDup(char const *str)
{
char *copy = malloc(strlen(str)+1);
if (!copy) {
}
strcpy(copy, str);
return copy;
-@@ -467,9 +465,10 @@
+@@ -467,9 +465,10 @@ sendPADT(PPPoEConnection *conn, char con
fprintf(conn->debugFile, "\n");
fflush(conn->debugFile);
}
/**********************************************************************
*%FUNCTION: parseLogErrs
*%ARGUMENTS:
-@@ -501,4 +500,5 @@
+@@ -501,4 +500,5 @@ parseLogErrs(UINT16_t type, UINT16_t len
break;
}
}
+#endif
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/discovery.c ppp-2.4.4/pppd/plugins/rp-pppoe/discovery.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/discovery.c 2005-03-22 05:22:32.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/discovery.c 2009-05-07 17:01:46.000000000 -0400
-@@ -13,10 +13,6 @@
+--- a/pppd/plugins/rp-pppoe/discovery.c
++++ b/pppd/plugins/rp-pppoe/discovery.c
+@@ -13,10 +13,6 @@ static char const RCSID[] =
#include "pppoe.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-@@ -167,24 +163,21 @@
+@@ -167,24 +163,21 @@ parsePADOTags(UINT16_t type, UINT16_t le
if (conn->printACNames) {
printf("Got a Service-Name-Error tag: %.*s\n", (int) len, data);
} else {
}
break;
}
-@@ -209,20 +202,14 @@
+@@ -209,20 +202,14 @@ parsePADSTags(UINT16_t type, UINT16_t le
PPPoEConnection *conn = (PPPoEConnection *) extra;
switch(type) {
case TAG_SERVICE_NAME:
case TAG_RELAY_SESSION_ID:
conn->relayId.type = htons(type);
conn->relayId.length = htons(len);
-@@ -336,7 +323,7 @@
+@@ -336,7 +323,7 @@ waitForPADO(PPPoEConnection *conn, int t
if (r >= 0 || errno != EINTR) break;
}
if (r < 0) {
}
if (r == 0) return; /* Timed out */
}
-@@ -346,8 +333,7 @@
+@@ -346,8 +333,7 @@ waitForPADO(PPPoEConnection *conn, int t
/* Check length */
if (ntohs(packet.length) + HDR_SIZE > len) {
continue;
}
-@@ -366,16 +352,16 @@
+@@ -366,16 +352,16 @@ waitForPADO(PPPoEConnection *conn, int t
if (packet.code == CODE_PADO) {
if (BROADCAST(packet.ethHdr.h_source)) {
continue;
}
conn->numPADOs++;
-@@ -513,7 +499,7 @@
+@@ -513,7 +499,7 @@ waitForPADS(PPPoEConnection *conn, int t
if (r >= 0 || errno != EINTR) break;
}
if (r < 0) {
}
if (r == 0) return;
}
-@@ -523,8 +509,7 @@
+@@ -523,8 +509,7 @@ waitForPADS(PPPoEConnection *conn, int t
/* Check length */
if (ntohs(packet.length) + HDR_SIZE > len) {
continue;
}
-@@ -556,11 +541,12 @@
+@@ -556,11 +541,12 @@ waitForPADS(PPPoEConnection *conn, int t
/* Don't bother with ntohs; we'll just end up converting it back... */
conn->session = packet.session;
}
}
-@@ -620,7 +606,7 @@
+@@ -620,7 +606,7 @@ discovery(PPPoEConnection *conn)
/* If we're only printing access concentrator names, we're done */
if (conn->printACNames) {
}
timeout = PADI_TIMEOUT;
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/if.c ppp-2.4.4/pppd/plugins/rp-pppoe/if.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/if.c 2001-12-13 21:55:20.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/if.c 2009-05-07 17:01:46.000000000 -0400
-@@ -40,10 +40,6 @@
+--- a/pppd/plugins/rp-pppoe/if.c
++++ b/pppd/plugins/rp-pppoe/if.c
+@@ -40,10 +40,6 @@ static char const RCSID[] =
#include <sys/ioctl.h>
#endif
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-@@ -127,7 +123,7 @@
+@@ -127,7 +123,7 @@ etherType(PPPoEPacket *packet)
{
UINT16_t type = (UINT16_t) ntohs(packet->ethHdr.h_proto);
if (type != Eth_PPPOE_Discovery && type != Eth_PPPOE_Session) {
}
return type;
}
-@@ -156,7 +152,7 @@
+@@ -156,7 +152,7 @@ getHWaddr(int sock, char const *ifname,
ifc.ifc_len = sizeof(inbuf);
ifc.ifc_buf = inbuf;
if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
}
ifr = ifc.ifc_req;
ifreq.ifr_name[0] = '\0';
-@@ -172,9 +168,7 @@
+@@ -172,9 +168,7 @@ getHWaddr(int sock, char const *ifname,
(sdl->sdl_alen == ETH_ALEN) &&
!strncmp(ifname, ifr->ifr_name, sizeof(ifr->ifr_name))) {
if (found) {
} else {
found = 1;
memcpy(hwaddr, LLADDR(sdl), ETH_ALEN);
-@@ -183,9 +177,7 @@
+@@ -183,9 +177,7 @@ getHWaddr(int sock, char const *ifname,
}
}
if (!found) {
}
}
-@@ -252,7 +244,7 @@
+@@ -252,7 +244,7 @@ initFilter(int fd, UINT16_t type, unsign
/* Apply the filter */
if (ioctl(fd, BIOCSETF, &bpfProgram) < 0) {
}
}
}
-@@ -298,42 +290,36 @@
+@@ -298,42 +290,36 @@ openInterface(char const *ifname, UINT16
if (fd < 0) {
switch (errno) {
case EACCES: /* permission denied */
}
getHWaddr(sock, ifname, hwaddr);
initFilter(fd, type, hwaddr);
-@@ -342,58 +328,52 @@
+@@ -342,58 +328,52 @@ openInterface(char const *ifname, UINT16
#if !defined(__OpenBSD__)
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(sock, SIOCGIFMTU, &ifr) < 0) {
ifname,
hwaddr[0], hwaddr[1], hwaddr[2],
hwaddr[3], hwaddr[4], hwaddr[5],
-@@ -442,48 +422,41 @@
+@@ -442,48 +422,41 @@ openInterface(char const *ifname, UINT16
if ((fd = socket(domain, stype, htons(type))) < 0) {
/* Give a more helpful message for the common error case */
if (errno == EPERM) {
}
#ifdef HAVE_STRUCT_SOCKADDR_LL
-@@ -493,7 +466,7 @@
+@@ -493,7 +466,7 @@ openInterface(char const *ifname, UINT16
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) {
}
sa.sll_ifindex = ifr.ifr_ifindex;
-@@ -503,7 +476,7 @@
+@@ -503,7 +476,7 @@ openInterface(char const *ifname, UINT16
/* We're only interested in packets on specified interface */
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
}
return fd;
-@@ -527,13 +500,11 @@
+@@ -527,13 +500,11 @@ sendPacket(PPPoEConnection *conn, int so
{
#if defined(USE_BPF)
if (write(sock, pkt, size) < 0) {
}
#else
#ifdef USE_DLPI
-@@ -577,12 +548,11 @@
+@@ -577,12 +548,11 @@ sendPacket(PPPoEConnection *conn, int so
struct sockaddr sa;
if (!conn) {
}
#endif
#endif
-@@ -632,26 +602,24 @@
+@@ -632,26 +602,24 @@ receivePacket(int sock, PPPoEPacket *pkt
if (bpfSize <= 0) {
bpfOffset = 0;
if ((bpfSize = read(sock, bpfBuffer, bpfLength)) < 0) {
clearPacketHeader(pkt); /* resets bpfSize and bpfOffset */
return 0;
}
-@@ -676,16 +644,14 @@
+@@ -676,16 +644,14 @@ receivePacket(int sock, PPPoEPacket *pkt
data.len = 0;
if ((retval = getmsg(sock, NULL, &data, &flags)) < 0) {
}
#endif
#endif
-@@ -716,7 +682,7 @@
+@@ -716,7 +682,7 @@ openInterface(char const *ifname, UINT16
int ppa;
if(strlen(ifname) > PATH_MAX) {
}
ppa = atoi(&ifname[strlen(ifname)-1]);
-@@ -729,9 +695,9 @@
+@@ -729,9 +695,9 @@ openInterface(char const *ifname, UINT16
if (( fd = open(base_dev, O_RDWR)) < 0) {
/* Give a more helpful message for the common error case */
if (errno == EPERM) {
}
/* rearranged order of DLPI code - delphys 20010803 */
-@@ -747,17 +713,18 @@
+@@ -747,17 +713,18 @@ openInterface(char const *ifname, UINT16
dl_abssaplen = ABS(dlp->info_ack.dl_sap_length);
dl_saplen = dlp->info_ack.dl_sap_length;
if (ETHERADDRL != (dlp->info_ack.dl_addr_length - dl_abssaplen))
return fd;
}
-@@ -780,7 +747,7 @@
+@@ -780,7 +747,7 @@ void dlpromisconreq(int fd, u_long level
flags = 0;
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
}
-@@ -799,7 +766,7 @@
+@@ -799,7 +766,7 @@ void dlinforeq(int fd)
flags = RS_HIPRI;
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
}
void dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri, u_long maxpri, u_char *datap, int datalen)
-@@ -827,7 +794,7 @@
+@@ -827,7 +794,7 @@ void dlunitdatareq(int fd, u_char *addrp
data.buf = (char *) datap;
if (putmsg(fd, &ctl, &data, 0) < 0)
}
void dlinfoack(int fd, char *bufp)
-@@ -847,18 +814,14 @@
+@@ -847,18 +814,14 @@ void dlinfoack(int fd, char *bufp)
expecting(DL_INFO_ACK, dlp);
if (ctl.len < sizeof (dl_info_ack_t)) {
}
}
-@@ -882,7 +845,7 @@
+@@ -882,7 +845,7 @@ void dlbindreq(int fd, u_long sap, u_lon
flags = 0;
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
}
void dlattachreq(int fd, u_long ppa)
-@@ -901,7 +864,7 @@
+@@ -901,7 +864,7 @@ void dlattachreq(int fd, u_long ppa)
flags = 0;
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
}
void dlokack(int fd, char *bufp)
-@@ -921,18 +884,14 @@
+@@ -921,18 +884,14 @@ void dlokack(int fd, char *bufp)
expecting(DL_OK_ACK, dlp);
if (ctl.len < sizeof (dl_ok_ack_t)) {
}
}
-@@ -953,12 +912,10 @@
+@@ -953,12 +912,10 @@ void dlbindack(int fd, char *bufp)
expecting(DL_BIND_ACK, dlp);
if (flags != RS_HIPRI)
}
}
-@@ -989,8 +946,7 @@
+@@ -989,8 +946,7 @@ void strgetmsg(int fd, struct strbuf *ct
*/
(void) signal(SIGALRM, sigalrm);
if (alarm(MAXWAIT) < 0) {
}
/*
-@@ -998,61 +954,48 @@
+@@ -998,61 +954,48 @@ void strgetmsg(int fd, struct strbuf *ct
*/
*flagsp = 0;
if ((rc = getmsg(fd, ctlp, datap, flagsp)) < 0) {
}
}
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux 2006-06-04 01:07:46.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux 2009-05-07 17:01:46.000000000 -0400
-@@ -28,8 +28,8 @@
+--- a/pppd/plugins/rp-pppoe/Makefile.linux
++++ b/pppd/plugins/rp-pppoe/Makefile.linux
+@@ -28,8 +28,8 @@ COPTS=-O2 -g
CFLAGS=$(COPTS) -I../../../include/linux
all: rp-pppoe.so pppoe-discovery
pppoe-discovery.o: pppoe-discovery.c
$(CC) $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe-discovery.o pppoe-discovery.c
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/plugin.c ppp-2.4.4/pppd/plugins/rp-pppoe/plugin.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/plugin.c 2006-05-29 19:29:16.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/plugin.c 2009-05-07 17:01:46.000000000 -0400
-@@ -35,7 +35,6 @@
+--- a/pppd/plugins/rp-pppoe/plugin.c
++++ b/pppd/plugins/rp-pppoe/plugin.c
+@@ -35,7 +35,6 @@ static char const RCSID[] =
#include "pppd/pathnames.h"
#include <linux/types.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
-@@ -173,10 +172,8 @@
+@@ -173,10 +172,8 @@ PPPOEConnectDevice(void)
(unsigned) conn->peerEth[5]);
if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
return conn->sessionSocket;
}
-@@ -320,11 +317,9 @@
+@@ -320,11 +317,9 @@ plugin_init(void)
}
add_options(Options);
/**********************************************************************
*%FUNCTION: fatalSys
*%ARGUMENTS:
-@@ -378,6 +373,7 @@
+@@ -378,6 +373,7 @@ sysErr(char const *str)
{
rp_fatal(str);
}
void pppoe_check_options(void)
{
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c ppp-2.4.4/pppd/plugins/rp-pppoe/pppoe-discovery.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c 2004-11-13 07:12:05.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/pppoe-discovery.c 2009-05-07 17:01:46.000000000 -0400
+--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -17,14 +17,8 @@
#include "pppoe.h"
int main(int argc, char *argv[])
{
int opt;
-@@ -32,17 +26,17 @@
+@@ -32,17 +26,17 @@ int main(int argc, char *argv[])
conn = malloc(sizeof(PPPoEConnection));
if (!conn)
break;
case 'U':
conn->useHostUniq = 1;
-@@ -57,7 +51,7 @@
+@@ -57,7 +51,7 @@ int main(int argc, char *argv[])
fprintf(conn->debugFile, "pppoe-discovery %s\n", VERSION);
break;
case 'I':
break;
case 'A':
/* this is the default */
-@@ -74,7 +68,7 @@
+@@ -74,7 +68,7 @@ int main(int argc, char *argv[])
/* default interface name */
if (!conn->ifName)
conn->discoverySocket = -1;
conn->sessionSocket = -1;
-@@ -84,39 +78,6 @@
+@@ -84,39 +78,6 @@ int main(int argc, char *argv[])
exit(0);
}
void usage(void)
{
fprintf(stderr, "Usage: pppoe-discovery [options]\n");
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/pppoe.h ppp-2.4.4/pppd/plugins/rp-pppoe/pppoe.h
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/pppoe.h 2004-11-04 05:07:37.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/pppoe.h 2009-05-07 17:01:46.000000000 -0400
-@@ -307,12 +307,18 @@
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -307,12 +307,18 @@ void discovery(PPPoEConnection *conn);
unsigned char *findTag(PPPoEPacket *packet, UINT16_t tagType,
PPPoETag *tag);
return; \
} \
} while(0)
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/utils.c ppp-2.4.4/pppd/plugins/rp-pppoe/utils.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/utils.c 1969-12-31 19:00:00.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/utils.c 2009-05-07 17:01:46.000000000 -0400
+--- /dev/null
++++ b/pppd/plugins/rp-pppoe/utils.c
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <stdlib.h>
-diff -Naur ppp-2.4.4.orig/pppd/ipcp.c ppp-2.4.4/pppd/ipcp.c
---- ppp-2.4.4.orig/pppd/ipcp.c 2009-05-09 02:55:46.000000000 -0400
-+++ ppp-2.4.4/pppd/ipcp.c 2009-05-09 02:58:31.000000000 -0400
-@@ -197,6 +197,14 @@
+--- a/pppd/ipcp.c
++++ b/pppd/ipcp.c
+@@ -197,6 +197,14 @@ static option_t ipcp_option_list[] = {
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
&ipcp_wantoptions[0].default_route },
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
{ "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
-@@ -263,7 +271,7 @@
+@@ -263,7 +271,7 @@ struct protent ipcp_protent = {
ip_active_pkt
};
static void ipcp_script __P((char *, int)); /* Run an up/down script */
static void ipcp_script_done __P((void *));
-@@ -1660,7 +1668,8 @@
+@@ -1660,7 +1668,8 @@ ip_demand_conf(u)
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
return 0;
if (wo->default_route)
default_route_set[u] = 1;
if (wo->proxy_arp)
if (sifproxyarp(u, wo->hisaddr))
-@@ -1742,7 +1751,8 @@
+@@ -1742,7 +1751,8 @@ ipcp_up(f)
*/
if (demand) {
if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
if (go->ouraddr != wo->ouraddr) {
warn("Local IP address changed to %I", go->ouraddr);
script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
-@@ -1767,7 +1777,8 @@
+@@ -1767,7 +1777,8 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
-@@ -1817,7 +1828,8 @@
+@@ -1817,7 +1828,8 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
-@@ -1894,7 +1906,7 @@
+@@ -1894,7 +1906,7 @@ ipcp_down(f)
sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
sifdown(f->unit);
ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
}
/* Execute the ip-down script */
-@@ -1910,16 +1922,25 @@
+@@ -1910,16 +1922,25 @@ ipcp_down(f)
* proxy arp entries, etc.
*/
static void
cifdefaultroute(unit, ouraddr, hisaddr);
default_route_set[unit] = 0;
}
-diff -Naur ppp-2.4.4.orig/pppd/ipcp.h ppp-2.4.4/pppd/ipcp.h
---- ppp-2.4.4.orig/pppd/ipcp.h 2009-05-09 02:54:59.000000000 -0400
-+++ ppp-2.4.4/pppd/ipcp.h 2009-05-09 02:58:31.000000000 -0400
-@@ -70,6 +70,7 @@
+--- a/pppd/ipcp.h
++++ b/pppd/ipcp.h
+@@ -70,6 +70,7 @@ typedef struct ipcp_options {
bool old_addrs; /* Use old (IP-Addresses) option? */
bool req_addr; /* Ask peer to send IP address? */
bool default_route; /* Assign default route through interface? */
bool proxy_arp; /* Make proxy ARP entry for peer? */
bool neg_vj; /* Van Jacobson Compression? */
bool old_vj; /* use old (short) form of VJ option? */
-diff -Naur ppp-2.4.4.orig/pppd/pppd.8 ppp-2.4.4/pppd/pppd.8
---- ppp-2.4.4.orig/pppd/pppd.8 2009-05-09 02:54:59.000000000 -0400
-+++ ppp-2.4.4/pppd/pppd.8 2009-05-09 02:58:31.000000000 -0400
-@@ -121,6 +121,11 @@
+--- 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.
.TP
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
-@@ -706,7 +711,12 @@
+@@ -706,7 +711,12 @@ disable both forms of hardware flow cont
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
can do so by placing this option in the /etc/ppp/options file.
.TP
.B nodeflate
-diff -Naur ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
---- ppp-2.4.4.orig/pppd/pppd.h 2009-05-09 02:55:46.000000000 -0400
-+++ ppp-2.4.4/pppd/pppd.h 2009-05-09 02:58:31.000000000 -0400
-@@ -644,7 +644,7 @@
+--- a/pppd/pppd.h
++++ b/pppd/pppd.h
+@@ -644,7 +644,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
/* Create default route through i/f */
int cifdefaultroute __P((int, u_int32_t, u_int32_t));
/* Delete default route through i/f */
-diff -Naur ppp-2.4.4.orig/pppd/sys-linux.c ppp-2.4.4/pppd/sys-linux.c
---- ppp-2.4.4.orig/pppd/sys-linux.c 2009-05-09 02:55:46.000000000 -0400
-+++ ppp-2.4.4/pppd/sys-linux.c 2009-05-09 02:58:31.000000000 -0400
-@@ -206,6 +206,8 @@
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -206,6 +206,8 @@ static unsigned char inbuf[512]; /* buff
static int if_is_up; /* Interface has been marked up */
static int have_default_route; /* Gateway for default route added */
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 */
-@@ -1520,6 +1522,9 @@
+@@ -1520,6 +1522,9 @@ static int read_route_table(struct rtent
p = NULL;
}
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);
-@@ -1589,20 +1594,51 @@
+@@ -1589,20 +1594,51 @@ int have_route_to(u_int32_t addr)
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
}
memset (&rt, 0, sizeof (rt));
-@@ -1617,10 +1653,16 @@
+@@ -1617,10 +1653,16 @@ int sifdefaultroute (int unit, u_int32_t
rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
have_default_route = 1;
return 1;
-@@ -1649,11 +1691,21 @@
+@@ -1649,11 +1691,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()) {
return 1;
}
-diff -Naur ppp-2.4.4.orig/pppd/sys-solaris.c ppp-2.4.4/pppd/sys-solaris.c
---- ppp-2.4.4.orig/pppd/sys-solaris.c 2009-05-09 02:54:59.000000000 -0400
-+++ ppp-2.4.4/pppd/sys-solaris.c 2009-05-09 02:58:31.000000000 -0400
-@@ -2036,12 +2036,18 @@
+--- a/pppd/sys-solaris.c
++++ b/pppd/sys-solaris.c
+@@ -2036,12 +2036,18 @@ cifaddr(u, o, h)
* sifdefaultroute - assign a default route through the address given.
*/
int
-diff -Naur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
---- ppp-2.4.4.orig/pppd/Makefile.linux 2009-05-08 23:17:17.000000000 -0400
-+++ ppp-2.4.4/pppd/Makefile.linux 2009-05-08 23:18:37.000000000 -0400
-@@ -48,21 +48,21 @@
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -48,21 +48,21 @@ MPPE=y
# Uncomment the next line to include support for PPP packet filtering.
# This requires that the libpcap library and headers be installed
# and that the kernel driver support PPP packet filtering.
# Enable plugins
PLUGIN=y
-@@ -77,7 +77,7 @@
+@@ -77,7 +77,7 @@ MAXOCTETS=y
INCLUDE_DIRS= -I../include
CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
-@@ -117,10 +117,10 @@
+@@ -117,10 +117,10 @@ CFLAGS += -DHAS_SHADOW
#LIBS += -lshadow $(LIBS)
endif
-diff -Naur ppp-2.4.4.orig/include/linux/ppp-comp.h ppp-2.4.4/include/linux/ppp-comp.h
---- ppp-2.4.4.orig/include/linux/ppp-comp.h 2009-05-09 03:44:09.000000000 -0400
-+++ ppp-2.4.4/include/linux/ppp-comp.h 2009-05-09 03:45:52.000000000 -0400
+--- a/include/linux/ppp-comp.h
++++ b/include/linux/ppp-comp.h
@@ -36,7 +36,7 @@
*/
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
-@@ -86,7 +86,7 @@
+@@ -86,7 +86,7 @@ struct compressor {
/* Compress a packet */
int (*compress) (void *state, unsigned char *rptr,
/* Return compression statistics */
void (*comp_stat) (void *state, struct compstat *stats);
-@@ -107,7 +107,7 @@
+@@ -107,7 +107,7 @@ struct compressor {
/* Decompress a packet. */
int (*decompress) (void *state, unsigned char *ibuf, int isize,
/* Update state for an incompressible packet received */
void (*incomp) (void *state, unsigned char *ibuf, int icnt);
-@@ -288,6 +288,33 @@
+@@ -288,6 +288,33 @@ struct compressor {
opts |= MPPE_OPT_UNKNOWN; \
} while (/* CONSTCOND */ 0)
/*
* Definitions for other, as yet unsupported, compression methods.
*/
-diff -Naur ppp-2.4.4.orig/include/net/ppp-comp.h ppp-2.4.4/include/net/ppp-comp.h
---- ppp-2.4.4.orig/include/net/ppp-comp.h 2009-05-09 03:44:09.000000000 -0400
-+++ ppp-2.4.4/include/net/ppp-comp.h 2009-05-09 03:45:52.000000000 -0400
-@@ -255,6 +255,33 @@
+--- a/include/net/ppp-comp.h
++++ b/include/net/ppp-comp.h
+@@ -255,6 +255,33 @@ struct compressor {
opts |= MPPE_OPT_UNKNOWN; \
} while (/* CONSTCOND */ 0)
/*
* Definitions for other, as yet unsupported, compression methods.
*/
-diff -Naur ppp-2.4.4.orig/pppd/ccp.c ppp-2.4.4/pppd/ccp.c
---- ppp-2.4.4.orig/pppd/ccp.c 2009-05-09 03:44:09.000000000 -0400
-+++ ppp-2.4.4/pppd/ccp.c 2009-05-09 03:45:52.000000000 -0400
-@@ -62,12 +62,10 @@
+--- a/pppd/ccp.c
++++ b/pppd/ccp.c
+@@ -62,12 +62,10 @@ static int setdeflate __P((char **));
static char bsd_value[8];
static char deflate_value[8];
static option_t ccp_option_list[] = {
{ "noccp", o_bool, &ccp_protent.enabled_flag,
-@@ -108,54 +106,36 @@
+@@ -108,54 +106,36 @@ static option_t ccp_option_list[] = {
"don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
&ccp_allowoptions[0].predictor_1 },
#endif /* MPPE */
{ NULL }
-@@ -241,7 +221,7 @@
+@@ -241,7 +221,7 @@ static fsm_callbacks ccp_callbacks = {
*/
#define ANY_COMPRESS(opt) ((opt).deflate || (opt).bsd_compress \
|| (opt).predictor_1 || (opt).predictor_2 \
/*
* Local state (mainly for handling reset-reqs and reset-acks).
-@@ -344,6 +324,100 @@
+@@ -344,6 +324,100 @@ setdeflate(argv)
return 1;
}
/*
* ccp_init - initialize CCP.
*/
-@@ -378,6 +452,30 @@
+@@ -378,6 +452,30 @@ ccp_init(unit)
ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
ccp_allowoptions[0].predictor_1 = 1;
}
/*
-@@ -455,11 +553,11 @@
+@@ -455,11 +553,11 @@ ccp_input(unit, p, len)
if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
notice("Compression disabled by peer.");
#ifdef MPPE
}
/*
-@@ -487,6 +585,15 @@
+@@ -487,6 +585,15 @@ ccp_extcode(f, code, id, p, len)
break;
/* send a reset-ack, which the transmitter will see and
reset its compression state. */
fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
break;
-@@ -515,12 +622,11 @@
+@@ -515,12 +622,11 @@ ccp_protrej(unit)
fsm_lowerdown(&ccp_fsm[unit]);
#ifdef MPPE
}
/*
-@@ -537,7 +643,7 @@
+@@ -537,7 +643,7 @@ ccp_resetci(f)
all_rejected[f->unit] = 0;
#ifdef MPPE
ccp_options *ao = &ccp_allowoptions[f->unit];
int auth_mschap_bits = auth_done[f->unit];
int numbits;
-@@ -551,80 +657,109 @@
+@@ -551,80 +657,109 @@ ccp_resetci(f)
* NB: If MPPE is required, all other compression opts are invalid.
* So, we return right away if we can't do it.
*/
if (go->bsd_compress) {
opt_buf[0] = CI_BSD_COMPRESS;
opt_buf[1] = CILEN_BSD_COMPRESS;
-@@ -679,7 +814,8 @@
+@@ -679,7 +814,8 @@ ccp_cilen(f)
+ (go->deflate? CILEN_DEFLATE: 0)
+ (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ (go->predictor_2? CILEN_PREDICTOR_2: 0)
}
/*
-@@ -693,6 +829,8 @@
+@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp)
{
int res;
ccp_options *go = &ccp_gotoptions[f->unit];
u_char *p0 = p;
/*
-@@ -701,22 +839,43 @@
+@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp)
* in case it gets Acked.
*/
#ifdef MPPE
if (go->deflate) {
p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
p[1] = CILEN_DEFLATE;
-@@ -802,7 +961,7 @@
+@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp)
/*
* ccp_ackci - process a received configure-ack, and return
*/
static int
ccp_ackci(f, p, len)
-@@ -811,24 +970,44 @@
+@@ -811,24 +970,44 @@ ccp_ackci(f, p, len)
int len;
{
ccp_options *go = &ccp_gotoptions[f->unit];
if (go->deflate) {
if (len < CILEN_DEFLATE
|| p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
-@@ -891,7 +1070,7 @@
+@@ -891,7 +1070,7 @@ ccp_ackci(f, p, len)
/*
* ccp_nakci - process received configure-nak.
*/
static int
ccp_nakci(f, p, len, treat_as_reject)
-@@ -901,6 +1080,8 @@
+@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject)
int treat_as_reject;
{
ccp_options *go = &ccp_gotoptions[f->unit];
ccp_options no; /* options we've seen already */
ccp_options try; /* options to ask for next time */
-@@ -908,28 +1089,100 @@
+@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject)
try = *go;
#ifdef MPPE
if (go->deflate && len >= CILEN_DEFLATE
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
&& p[1] == CILEN_DEFLATE) {
-@@ -1002,14 +1255,50 @@
+@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len)
return -1;
#ifdef MPPE
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 @@
+@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak)
int dont_nak;
{
int ret, newret, res;
ret = CONFACK;
retp = p0 = p;
-@@ -1103,106 +1393,302 @@
+@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak)
switch (type) {
#ifdef MPPE
case CI_MPPE:
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (!ao->deflate || clen != CILEN_DEFLATE
-@@ -1344,12 +1830,6 @@
+@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak)
else
*lenp = retp - p0;
}
return ret;
}
-@@ -1371,24 +1851,35 @@
+@@ -1371,24 +1851,35 @@ method_name(opt, opt2)
char *p = result;
char *q = result + sizeof(result); /* 1 past result */
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
-@@ -1444,12 +1935,12 @@
+@@ -1444,12 +1935,12 @@ ccp_up(f)
} else if (ANY_COMPRESS(*ho))
notice("%s transmit compression enabled", method_name(ho, NULL));
#ifdef MPPE
}
/*
-@@ -1472,7 +1963,7 @@
+@@ -1472,7 +1963,7 @@ ccp_down(f)
lcp_close(f->unit, "MPPE disabled");
}
}
}
/*
-@@ -1532,24 +2023,28 @@
+@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg)
#ifdef MPPE
case CI_MPPE:
if (optlen >= CILEN_MPPE) {
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (optlen >= CILEN_DEFLATE) {
-@@ -1635,6 +2130,7 @@
+@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len)
error("Lost compression sync: disabling compression");
ccp_close(unit, "Lost compression sync");
#ifdef MPPE
/*
* If we were doing MPPE, we must also take the link down.
*/
-@@ -1642,9 +2138,18 @@
+@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len)
error("Too many MPPE errors, closing LCP");
lcp_close(unit, "Too many MPPE errors");
}
* Send a reset-request to reset the peer's compressor.
* We don't do that if we are still waiting for an
* acknowledgement to a previous reset-request.
-@@ -1675,4 +2180,3 @@
+@@ -1675,4 +2180,3 @@ ccp_rack_timeout(arg)
} else
ccp_localstate[f->unit] &= ~RACK_PENDING;
}
-
-diff -Naur ppp-2.4.4.orig/pppd/ccp.h ppp-2.4.4/pppd/ccp.h
---- ppp-2.4.4.orig/pppd/ccp.h 2009-05-09 03:44:09.000000000 -0400
-+++ ppp-2.4.4/pppd/ccp.h 2009-05-09 03:45:52.000000000 -0400
-@@ -37,9 +37,17 @@
+--- a/pppd/ccp.h
++++ b/pppd/ccp.h
+@@ -37,9 +37,17 @@ typedef struct ccp_options {
bool predictor_2; /* do Predictor-2? */
bool deflate_correct; /* use correct code for deflate? */
bool deflate_draft; /* use draft RFC code for deflate? */
short method; /* code for chosen compression method */
} ccp_options;
-diff -Naur ppp-2.4.4.orig/pppd/chap_ms.c ppp-2.4.4/pppd/chap_ms.c
---- ppp-2.4.4.orig/pppd/chap_ms.c 2009-05-09 03:45:07.000000000 -0400
-+++ ppp-2.4.4/pppd/chap_ms.c 2009-05-09 03:45:52.000000000 -0400
-@@ -897,13 +897,17 @@
+--- a/pppd/chap_ms.c
++++ b/pppd/chap_ms.c
+@@ -897,13 +897,17 @@ set_mppe_enc_types(int policy, int types
/*
* Disable undesirable encryption types. Note that we don't ENABLE
* any encryption types, to avoid overriding manual configuration.
-diff -Naur ppp-2.4.4.orig/chat/Makefile.linux ppp-2.4.4/chat/Makefile.linux
---- ppp-2.4.4.orig/chat/Makefile.linux 2006-06-04 01:07:46.000000000 -0400
-+++ ppp-2.4.4/chat/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -25,7 +25,7 @@
+--- a/chat/Makefile.linux
++++ b/chat/Makefile.linux
+@@ -25,7 +25,7 @@ chat.o: chat.c
install: chat
mkdir -p $(BINDIR) $(MANDIR)
$(INSTALL) -c -m 644 chat.8 $(MANDIR)
clean:
-diff -Naur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
---- ppp-2.4.4.orig/pppd/Makefile.linux 2009-05-07 17:04:21.000000000 -0400
-+++ ppp-2.4.4/pppd/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -99,7 +99,7 @@
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -99,7 +99,7 @@ ifdef USE_SRP
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
TARGETS += srp-entry
MANPAGES += srp-entry.8
EXTRACLEAN += srp-entry.o
NEEDDES=y
-@@ -200,7 +200,7 @@
+@@ -200,7 +200,7 @@ all: $(TARGETS)
install: pppd
mkdir -p $(BINDIR) $(MANDIR)
$(EXTRAINSTALL)
if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
chmod o-rx,u+s $(BINDIR)/pppd; fi
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
-diff -Naur ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux ppp-2.4.4/pppd/plugins/radius/Makefile.linux
---- ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux 2006-06-04 01:04:14.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/radius/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -36,9 +36,9 @@
+--- a/pppd/plugins/radius/Makefile.linux
++++ b/pppd/plugins/radius/Makefile.linux
+@@ -36,9 +36,9 @@ all: $(PLUGIN)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux 2009-05-07 17:02:45.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -39,9 +39,9 @@
+--- a/pppd/plugins/rp-pppoe/Makefile.linux
++++ b/pppd/plugins/rp-pppoe/Makefile.linux
+@@ -39,9 +39,9 @@ rp-pppoe.so: libplugin.a plugin.o
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
clean:
rm -f *.o *.so
-diff -Naur ppp-2.4.4.orig/pppdump/Makefile.linux ppp-2.4.4/pppdump/Makefile.linux
---- ppp-2.4.4.orig/pppdump/Makefile.linux 2006-06-04 01:04:14.000000000 -0400
-+++ ppp-2.4.4/pppdump/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -17,5 +17,5 @@
+--- a/pppdump/Makefile.linux
++++ b/pppdump/Makefile.linux
+@@ -17,5 +17,5 @@ clean:
install:
mkdir -p $(BINDIR) $(MANDIR)
- $(INSTALL) -s -c pppdump $(BINDIR)
+ $(INSTALL) -c pppdump $(BINDIR)
$(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
-diff -Naur ppp-2.4.4.orig/pppstats/Makefile.linux ppp-2.4.4/pppstats/Makefile.linux
---- ppp-2.4.4.orig/pppstats/Makefile.linux 2006-06-04 01:07:46.000000000 -0400
-+++ ppp-2.4.4/pppstats/Makefile.linux 2009-05-07 18:04:23.000000000 -0400
-@@ -22,7 +22,7 @@
+--- a/pppstats/Makefile.linux
++++ b/pppstats/Makefile.linux
+@@ -22,7 +22,7 @@ all: pppstats
install: pppstats
-mkdir -p $(MANDIR)
-diff -Naur ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux ppp-2.4.4/pppd/plugins/radius/Makefile.linux
---- ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux 2009-05-07 18:05:57.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/radius/Makefile.linux 2009-05-07 18:06:23.000000000 -0400
-@@ -12,7 +12,8 @@
+--- a/pppd/plugins/radius/Makefile.linux
++++ b/pppd/plugins/radius/Makefile.linux
+@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/
INSTALL = install
PLUGIN=radius.so radattr.so radrealms.so
# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol.
-diff -Naur ppp-2.4.4.orig/pppdump/Makefile.linux ppp-2.4.4/pppdump/Makefile.linux
---- ppp-2.4.4.orig/pppdump/Makefile.linux 2009-05-07 18:05:57.000000000 -0400
-+++ ppp-2.4.4/pppdump/Makefile.linux 2009-05-07 18:06:23.000000000 -0400
-@@ -2,7 +2,8 @@
+--- a/pppdump/Makefile.linux
++++ b/pppdump/Makefile.linux
+@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
-diff -Naur ppp-2.4.4.orig/pppd/plugins/radius/config.c ppp-2.4.4/pppd/plugins/radius/config.c
---- ppp-2.4.4.orig/pppd/plugins/radius/config.c 2004-11-14 02:26:26.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/radius/config.c 2009-05-07 19:31:14.000000000 -0400
-@@ -369,31 +369,37 @@
+--- a/pppd/plugins/radius/config.c
++++ b/pppd/plugins/radius/config.c
+@@ -369,31 +369,37 @@ static int test_config(char *filename)
}
#endif
return 0;
}
-diff -Naur ppp-2.4.4.orig/pppd/plugins/radius/options.h ppp-2.4.4/pppd/plugins/radius/options.h
---- ppp-2.4.4.orig/pppd/plugins/radius/options.h 2004-11-14 02:26:26.000000000 -0500
-+++ ppp-2.4.4/pppd/plugins/radius/options.h 2009-05-07 19:31:14.000000000 -0400
-@@ -31,24 +31,21 @@
+--- a/pppd/plugins/radius/options.h
++++ b/pppd/plugins/radius/options.h
+@@ -31,24 +31,21 @@ typedef struct _option {
static SERVER acctserver = {0};
static SERVER authserver = {0};
-diff -Naur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/discovery.c ppp-2.4.4/pppd/plugins/rp-pppoe/discovery.c
---- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/discovery.c 2009-05-07 19:47:30.000000000 -0400
-+++ ppp-2.4.4/pppd/plugins/rp-pppoe/discovery.c 2009-05-07 20:23:04.000000000 -0400
-@@ -593,12 +593,14 @@
+--- a/pppd/plugins/rp-pppoe/discovery.c
++++ b/pppd/plugins/rp-pppoe/discovery.c
+@@ -593,12 +593,14 @@ discovery(PPPoEConnection *conn)
conn->discoveryState = STATE_SENT_PADI;
waitForPADO(conn, timeout);
if (conn->printACNames && conn->numPADOs) {
break;
}
-@@ -621,7 +623,9 @@
+@@ -621,7 +623,9 @@ discovery(PPPoEConnection *conn)
sendPADR(conn);
conn->discoveryState = STATE_SENT_PADR;
waitForPADS(conn, timeout);
-diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
---- ppp-2.4.4.orig/pppd/main.c 2009-05-07 22:25:24.000000000 -0400
-+++ ppp-2.4.4/pppd/main.c 2009-05-07 22:22:40.000000000 -0400
+--- a/pppd/main.c
++++ b/pppd/main.c
@@ -90,6 +90,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include "pppd.h"
#include "magic.h"
-@@ -227,6 +228,7 @@
+@@ -227,6 +228,7 @@ static struct subprocess *children;
/* Prototypes for procedures local to this file. */
static void setup_signals __P((void));
static void create_pidfile __P((int pid));
static void create_linkpidfile __P((int pid));
-@@ -532,6 +534,7 @@
+@@ -532,6 +534,7 @@ main(argc, argv)
info("Starting link");
}
gettimeofday(&start_time, NULL);
script_unsetenv("CONNECT_TIME");
script_unsetenv("BYTES_SENT");
-@@ -1264,6 +1267,36 @@
+@@ -1264,6 +1267,36 @@ struct callout {
static struct callout *callout = NULL; /* Callout list */
static struct timeval timenow; /* Current time */
/*
* timeout - Schedule a timeout.
-@@ -1334,6 +1367,8 @@
+@@ -1334,6 +1367,8 @@ calltimeout()
{
struct callout *p;
while (callout != NULL) {
p = callout;
-@@ -1361,6 +1396,8 @@
+@@ -1361,6 +1396,8 @@ timeleft(tvp)
{
if (callout == NULL)
return NULL;
-diff -Naur ppp-2.4.4.orig/pppd/lcp.c ppp-2.4.4/pppd/lcp.c
---- ppp-2.4.4.orig/pppd/lcp.c 2009-05-07 22:24:09.000000000 -0400
-+++ ppp-2.4.4/pppd/lcp.c 2009-05-07 22:26:57.000000000 -0400
-@@ -1904,12 +1904,12 @@
+--- a/pppd/lcp.c
++++ b/pppd/lcp.c
+@@ -1904,12 +1904,12 @@ lcp_up(f)
* the interface MTU is set to the lowest of that, the
* MTU we want to use, and our link MRU.
*/
-diff -Naur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
---- ppp-2.4.4.orig/pppd/Makefile.linux 2009-05-07 22:25:24.000000000 -0400
-+++ ppp-2.4.4/pppd/Makefile.linux 2009-05-07 22:28:44.000000000 -0400
-@@ -170,8 +170,8 @@
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -170,8 +170,8 @@ endif
ifdef FILTER
ifneq ($(wildcard /usr/include/pcap-bpf.h),)
-diff -Naur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
---- ppp-2.4.4.orig/pppd/Makefile.linux 2009-05-07 22:31:54.000000000 -0400
-+++ ppp-2.4.4/pppd/Makefile.linux 2009-05-07 22:33:12.000000000 -0400
-@@ -50,6 +50,9 @@
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -50,6 +50,9 @@ MPPE=y
# and that the kernel driver support PPP packet filtering.
#FILTER=y
# Uncomment the next line to enable multilink PPP (enabled by default)
# Linux distributions: Please leave multilink ENABLED in your builds
# of pppd!
-@@ -175,6 +178,14 @@
+@@ -175,6 +178,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)
endif
endif
ifdef HAVE_INET6
PPPDSRCS += ipv6cp.c eui64.c
HEADERS += ipv6cp.h eui64.h
-diff -Naur ppp-2.4.4.orig/pppd/options.c ppp-2.4.4/pppd/options.c
---- ppp-2.4.4.orig/pppd/options.c 2009-05-07 22:25:24.000000000 -0400
-+++ ppp-2.4.4/pppd/options.c 2009-05-07 22:38:28.000000000 -0400
+--- a/pppd/options.c
++++ b/pppd/options.c
@@ -57,6 +57,7 @@
#ifdef PPP_FILTER
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on...
-@@ -160,6 +161,13 @@
+@@ -160,6 +161,13 @@ static int setlogfile __P((char **));
static int loadplugin __P((char **));
#endif
#ifdef PPP_FILTER
static int setpassfilter __P((char **));
static int setactivefilter __P((char **));
-@@ -317,6 +325,14 @@
+@@ -317,6 +325,14 @@ option_t general_options[] = {
"set filter for active pkts", OPT_PRIO },
#endif
#ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
-@@ -1456,6 +1472,29 @@
+@@ -1456,6 +1472,29 @@ callfile(argv)
return ok;
}
#ifdef PPP_FILTER
/*
* setpassfilter - Set the pass filter for packets
-diff -Naur ppp-2.4.4.orig/pppd/pcap_pcc.c ppp-2.4.4/pppd/pcap_pcc.c
---- ppp-2.4.4.orig/pppd/pcap_pcc.c 1969-12-31 19:00:00.000000000 -0500
-+++ ppp-2.4.4/pppd/pcap_pcc.c 2009-05-07 22:33:12.000000000 -0400
+--- /dev/null
++++ b/pppd/pcap_pcc.c
@@ -0,0 +1,74 @@
+#include <pcap.h>
+#include <pcap-bpf.h>
+ fclose (f);
+ return 0;
+}
-diff -Naur ppp-2.4.4.orig/pppd/pcap_pcc.h ppp-2.4.4/pppd/pcap_pcc.h
---- ppp-2.4.4.orig/pppd/pcap_pcc.h 1969-12-31 19:00:00.000000000 -0500
-+++ ppp-2.4.4/pppd/pcap_pcc.h 2009-05-07 22:33:12.000000000 -0400
+--- /dev/null
++++ b/pppd/pcap_pcc.h
@@ -0,0 +1,7 @@
+#ifndef PCAP_PCC_H
+#define PCAP_PCC_H