Bump to the current version of PPP. A few of the patches are either in 2.4.5 or something functionally equivalent is, so those patches were removed. 1 patch was added to accommodate pppol2pv3_addr which is referenced in a linux kernel header file, but isn't defined in the kernel header files packaged with PPP. Redux: re-instate the commenting out of the exponential back-off as requested by Felix. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> SVN-Revision: 27818master
parent
e18ceb1dac
commit
4c4da37c09
@ -1,19 +0,0 @@ |
||||
--- 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);
|
||||
|
||||
+ closelog();
|
||||
+
|
||||
/* dup the in, out, err fds to 0, 1, 2 */
|
||||
if (infd != 0)
|
||||
dup2(infd, 0);
|
||||
@@ -1578,7 +1580,6 @@ safe_fork(int infd, int outfd, int errfd
|
||||
if (errfd != 2)
|
||||
dup2(errfd, 2);
|
||||
|
||||
- closelog();
|
||||
if (log_to_fd > 2)
|
||||
close(log_to_fd);
|
||||
if (the_channel->close)
|
@ -1,11 +0,0 @@ |
||||
--- 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;
|
||||
|
||||
- BZERO(response, sizeof(*response));
|
||||
+ BZERO(response, MS_CHAP2_RESPONSE_LEN);
|
||||
|
||||
/* Generate the Peer-Challenge if requested, or copy it if supplied. */
|
||||
if (!PeerChallenge)
|
@ -1,30 +0,0 @@ |
||||
--- 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;
|
||||
|
||||
- if (mtu > pppoatm_max_mtu)
|
||||
- error("Couldn't increase MTU to %d", mtu);
|
||||
+ if (pppoatm_max_mtu && mtu > pppoatm_max_mtu) {
|
||||
+ warn("Couldn't increase MTU to %d. Using %d",
|
||||
+ mtu, pppoatm_max_mtu);
|
||||
+ mtu = pppoatm_max_mtu;
|
||||
+ }
|
||||
|
||||
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sock < 0)
|
||||
@@ -198,8 +201,11 @@ static void recv_config_pppoa(int mru,
|
||||
int pcomp,
|
||||
int accomp)
|
||||
{
|
||||
- if (mru > pppoatm_max_mru)
|
||||
- error("Couldn't increase MRU to %d", mru);
|
||||
+ if (pppoatm_max_mru && mru > pppoatm_max_mru) {
|
||||
+ warn("Couldn't increase MRU to %d. Using %d",
|
||||
+ mru, pppoatm_max_mru);
|
||||
+ mru = pppoatm_max_mru;
|
||||
+ }
|
||||
}
|
||||
|
||||
void plugin_init(void)
|
File diff suppressed because it is too large
Load Diff
@ -1,109 +0,0 @@ |
||||
--- a/pppd/plugins/rp-pppoe/common.c
|
||||
+++ b/pppd/plugins/rp-pppoe/common.c
|
||||
@@ -75,7 +75,9 @@ parsePacket(PPPoEPacket *packet, ParseFu
|
||||
error("Invalid PPPoE tag length (%u)", tagLen);
|
||||
return -1;
|
||||
}
|
||||
- func(tagType, tagLen, curTag+TAG_HDR_SIZE, extra);
|
||||
+ if (func(tagType, tagLen, curTag+TAG_HDR_SIZE, extra)) {
|
||||
+ return -1;
|
||||
+ }
|
||||
curTag = curTag + TAG_HDR_SIZE + tagLen;
|
||||
}
|
||||
return 0;
|
||||
--- a/pppd/plugins/rp-pppoe/discovery.c
|
||||
+++ b/pppd/plugins/rp-pppoe/discovery.c
|
||||
@@ -48,7 +48,7 @@ static char const RCSID[] =
|
||||
*%DESCRIPTION:
|
||||
* If a HostUnique tag is found which matches our PID, sets *extra to 1.
|
||||
***********************************************************************/
|
||||
-void
|
||||
+int
|
||||
parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
|
||||
void *extra)
|
||||
{
|
||||
@@ -60,6 +60,7 @@ parseForHostUniq(UINT16_t type, UINT16_t
|
||||
*val = 1;
|
||||
}
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
@@ -102,7 +103,7 @@ packetIsForMe(PPPoEConnection *conn, PPP
|
||||
*%DESCRIPTION:
|
||||
* Picks interesting tags out of a PADO packet
|
||||
***********************************************************************/
|
||||
-void
|
||||
+int
|
||||
parsePADOTags(UINT16_t type, UINT16_t len, unsigned char *data,
|
||||
void *extra)
|
||||
{
|
||||
@@ -181,6 +182,7 @@ parsePADOTags(UINT16_t type, UINT16_t le
|
||||
}
|
||||
break;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
@@ -195,7 +197,7 @@ parsePADOTags(UINT16_t type, UINT16_t le
|
||||
*%DESCRIPTION:
|
||||
* Picks interesting tags out of a PADS packet
|
||||
***********************************************************************/
|
||||
-void
|
||||
+int
|
||||
parsePADSTags(UINT16_t type, UINT16_t len, unsigned char *data,
|
||||
void *extra)
|
||||
{
|
||||
@@ -205,17 +207,21 @@ parsePADSTags(UINT16_t type, UINT16_t le
|
||||
dbglog("PADS: Service-Name: '%.*s'", (int) len, data);
|
||||
break;
|
||||
case TAG_SERVICE_NAME_ERROR:
|
||||
- fatal("PADS: Service-Name-Error: %.*s", (int) len, data);
|
||||
+ error("PADS: Service-Name-Error: %.*s", (int) len, data);
|
||||
+ return -1;
|
||||
case TAG_AC_SYSTEM_ERROR:
|
||||
- fatal("PADS: System-Error: %.*s", (int) len, data);
|
||||
+ error("PADS: System-Error: %.*s", (int) len, data);
|
||||
+ return -1;
|
||||
case TAG_GENERIC_ERROR:
|
||||
- fatal("PADS: Generic-Error: %.*s", (int) len, data);
|
||||
+ error("PADS: Generic-Error: %.*s", (int) len, data);
|
||||
+ return -1;
|
||||
case TAG_RELAY_SESSION_ID:
|
||||
conn->relayId.type = htons(type);
|
||||
conn->relayId.length = htons(len);
|
||||
memcpy(conn->relayId.payload, data, len);
|
||||
break;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -532,9 +538,11 @@ waitForPADS(PPPoEConnection *conn, int t
|
||||
/* Is it PADS? */
|
||||
if (packet.code == CODE_PADS) {
|
||||
/* Parse for goodies */
|
||||
- parsePacket(&packet, parsePADSTags, conn);
|
||||
- conn->discoveryState = STATE_SESSION;
|
||||
- break;
|
||||
+ if (!parsePacket(&packet, parsePADSTags, conn))
|
||||
+ {
|
||||
+ conn->discoveryState = STATE_SESSION;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
} while (conn->discoveryState != STATE_SESSION);
|
||||
|
||||
--- a/pppd/plugins/rp-pppoe/pppoe.h
|
||||
+++ b/pppd/plugins/rp-pppoe/pppoe.h
|
||||
@@ -238,7 +238,7 @@ typedef struct PPPoETagStruct {
|
||||
#define READ_CHUNK 4096
|
||||
|
||||
/* Function passed to parsePacket */
|
||||
-typedef void ParseFunc(UINT16_t type,
|
||||
+typedef int ParseFunc(UINT16_t type,
|
||||
UINT16_t len,
|
||||
unsigned char *data,
|
||||
void *extra);
|
@ -0,0 +1,23 @@ |
||||
--- a/include/linux/if_pppol2tp.h
|
||||
+++ b/include/linux/if_pppol2tp.h
|
||||
@@ -32,6 +32,20 @@ struct pppol2tp_addr
|
||||
__u16 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
};
|
||||
|
||||
+/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
|
||||
+ * bits. So we need a different sockaddr structure.
|
||||
+ */
|
||||
+struct pppol2tpv3_addr {
|
||||
+ pid_t pid; /* pid that owns the fd.
|
||||
+ * 0 => current */
|
||||
+ int fd; /* FD of UDP or IP socket to use */
|
||||
+
|
||||
+ struct sockaddr_in addr; /* IP address and port to send to */
|
||||
+
|
||||
+ __u32 s_tunnel, s_session; /* For matching incoming packets */
|
||||
+ __u32 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
+};
|
||||
+
|
||||
/* Socket options:
|
||||
* DEBUG - bitmask of debug message categories
|
||||
* SENDSEQ - 0 => don't send packets with sequence numbers
|
Loading…
Reference in new issue