diff --git a/.cvsignore b/.cvsignore index 89a9aae..039070e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1 @@ -ppp-2.4.2.tar.gz -ppp-2.4.3.tar.gz -ppp-2.4.4.tar.gz +ppp-2.4.5.tar.gz diff --git a/ppp-2.4.1-pkgcheck.patch b/ppp-2.4.1-pkgcheck.patch deleted file mode 100644 index c2b185b..0000000 --- a/ppp-2.4.1-pkgcheck.patch +++ /dev/null @@ -1,142 +0,0 @@ ---- ppp-2.4.1/pppd/cbcp.c.pkgcheck 2004-11-02 14:19:23.000000000 +0100 -+++ ppp-2.4.1/pppd/cbcp.c 2004-11-02 15:04:06.000000000 +0100 -@@ -150,7 +150,8 @@ - inp = inpacket; - - if (pktlen < CBCP_MINLEN) { -- error("CBCP packet is too small"); -+ if (debug) -+ dbglog("CBCP packet is too small"); - return; - } - -@@ -158,12 +159,11 @@ - GETCHAR(id, inp); - GETSHORT(len, inp); - --#if 0 -- if (len > pktlen) { -- error("CBCP packet: invalid length"); -+ if (len > pktlen || len < CBCP_MINLEN) { -+ if (debug) -+ dbglog("CBCP packet: invalid length %d", len); - return; - } --#endif - - len -= CBCP_MINLEN; - -@@ -174,11 +174,12 @@ - break; - - case CBCP_RESP: -- dbglog("CBCP_RESP received"); -+ if (debug) -+ dbglog("CBCP_RESP received"); - break; - - case CBCP_ACK: -- if (id != us->us_id) -+ if (debug && id != us->us_id) - dbglog("id doesn't match: expected %d recv %d", - us->us_id, id); - -@@ -297,11 +298,13 @@ - - address[0] = 0; - -- while (len) { -+ while (len >= 2) { - dbglog("length: %d", len); - - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); -+ if (opt_len < 2 || opt_len > len) -+ break; - - if (opt_len > 2) - GETCHAR(delay, pckt); -@@ -333,6 +336,11 @@ - } - len -= opt_len; - } -+ if (len != 0) { -+ if (debug) -+ dbglog("cbcp_recvreq: malformed packet (%d bytes left)", len); -+ return; -+ } - - cbcp_resp(us); - } -@@ -345,6 +353,7 @@ - u_char buf[256]; - u_char *bufp = buf; - int len = 0; -+ int slen; - - cb_type = us->us_allowed & us->us_type; - dbglog("cbcp_resp cb_type=%d", cb_type); -@@ -356,12 +365,17 @@ - - if (cb_type & ( 1 << CB_CONF_USER ) ) { - dbglog("cbcp_resp CONF_USER"); -+ slen = strlen(us->us_number); -+ if (slen > 250) { -+ warn("callback number truncated to 250 characters"); -+ slen = 250; -+ } - PUTCHAR(CB_CONF_USER, bufp); -- len = 3 + 1 + strlen(us->us_number) + 1; -+ len = 3 + 1 + slen + 1; - PUTCHAR(len , bufp); - PUTCHAR(5, bufp); /* delay */ - PUTCHAR(1, bufp); -- BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); -+ BCOPY(us->us_number, bufp, slen + 1); - cbcp_send(us, CBCP_RESP, buf, len); - return; - } -@@ -424,25 +438,29 @@ - int opt_len; - char address[256]; - -- if (len) { -+ if (len >= 2) { - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); - -- if (opt_len > 2) -- GETCHAR(delay, pckt); -+ if (opt_len >= 2 && opt_len <= len) { -+ if (opt_len > 2) -+ GETCHAR(delay, pckt); - -- if (opt_len > 4) { -- GETCHAR(addr_type, pckt); -- memcpy(address, pckt, opt_len - 4); -- address[opt_len - 4] = 0; -- if (address[0]) -- dbglog("peer will call: %s", address); -- } -- if (type == CB_CONF_NO) -- return; -- } -+ if (opt_len > 4) { -+ GETCHAR(addr_type, pckt); -+ memcpy(address, pckt, opt_len - 4); -+ address[opt_len - 4] = 0; -+ if (address[0]) -+ dbglog("peer will call: %s", address); -+ } -+ if (type == CB_CONF_NO) -+ return; - -- cbcp_up(us); -+ cbcp_up(us); -+ -+ } else if (debug) -+ dbglog("cbcp_recvack: malformed packet"); -+ } - } - - /* ok peer will do callback */ diff --git a/ppp-2.4.2-bpf.patch b/ppp-2.4.2-bpf.patch deleted file mode 100644 index 859e72e..0000000 --- a/ppp-2.4.2-bpf.patch +++ /dev/null @@ -1,23 +0,0 @@ -I think this is the right fix, but ICBW. ---- ppp-2.4.2/pppd/demand.c 2004-03-10 19:12:16.000000000 -0500 -+++ ppp-2.4.2/pppd/demand.c 2004-03-10 19:12:12.000000000 -0500 -@@ -50,7 +50,7 @@ - #include - #ifdef PPP_FILTER - #include --#include -+#include - #include - #endif - ---- ppp-2.4.2/pppd/sys-linux.c 2004-03-10 19:11:56.000000000 -0500 -+++ ppp-2.4.2/pppd/sys-linux.c 2004-03-10 19:12:05.000000000 -0500 -@@ -141,7 +141,7 @@ - #endif /* IPX_CHANGE */ - - #ifdef PPP_FILTER --#include -+#include - #include - #endif /* PPP_FILTER */ - diff --git a/ppp-2.4.2-fix.patch b/ppp-2.4.2-fix.patch deleted file mode 100644 index 0d9a8da..0000000 --- a/ppp-2.4.2-fix.patch +++ /dev/null @@ -1,434 +0,0 @@ ---- ppp-2.4.2/pppd/plugins/rp-pppoe/discovery.c.fix 2004-06-17 16:43:43.191723185 +0200 -+++ ppp-2.4.2/pppd/plugins/rp-pppoe/discovery.c 2004-06-17 16:43:45.907350301 +0200 -@@ -13,6 +13,8 @@ - - #include "pppoe.h" - -+void warn __P((char *, ...)); /* log a warning message */ -+ - #ifdef HAVE_SYSLOG_H - #include - #endif ---- ppp-2.4.2/pppd/tty.c.fix 2004-01-13 05:17:59.000000000 +0100 -+++ ppp-2.4.2/pppd/tty.c 2004-06-17 16:13:28.955650804 +0200 -@@ -512,7 +512,9 @@ - { - char *connector; - int fdflags; -+#ifndef __linux__ - struct stat statbuf; -+#endif - char numbuf[16]; - - /* ---- ppp-2.4.2/pppd/ipv6cp.c.fix 2004-01-13 04:59:37.000000000 +0100 -+++ ppp-2.4.2/pppd/ipv6cp.c 2004-06-17 16:16:04.377345945 +0200 -@@ -151,6 +151,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -1061,7 +1062,9 @@ - return (rc); /* Return final code */ - } - -- -+#if defined(SOL2) || defined(__linux__) -+int ether_to_eui64(eui64_t *p_eui64); -+#endif - /* - * ipv6_check_options - check that any IP-related options are OK, - * and assign appropriate defaults. ---- ppp-2.4.2/include/linux/if_pppox.h.fix 2001-12-15 01:34:24.000000000 +0100 -+++ ppp-2.4.2/include/linux/if_pppox.h 2004-06-17 16:11:32.162659245 +0200 -@@ -18,7 +18,7 @@ - - - #include --#include -+#include - - #ifdef __KERNEL__ - #include -@@ -97,10 +97,10 @@ - #define PTT_GEN_ERR __constant_htons(0x0203) - - struct pppoe_hdr { --#if defined(__LITTLE_ENDIAN_BITFIELD) -+#if __BYTE_ORDER == __LITTLE_ENDIAN - __u8 ver : 4; - __u8 type : 4; --#elif defined(__BIG_ENDIAN_BITFIELD) -+#elif __BYTE_ORDER == __BIG_ENDIAN - __u8 type : 4; - __u8 ver : 4; - #else ---- ppp-2.4.2/pppdump/deflate.c.fix 2004-06-17 16:58:32.991307502 +0200 -+++ ppp-2.4.2/pppdump/deflate.c 2004-06-17 17:00:24.408979423 +0200 -@@ -38,7 +38,9 @@ - - #include - #include -+#include - #include -+#include - #include "ppp_defs.h" - #include "ppp-comp.h" - #include "zlib.h" -@@ -235,8 +237,8 @@ - { - struct deflate_state *state = (struct deflate_state *) arg; - u_char *rptr, *wptr; -- int rlen, olen, ospace; -- int seq, i, flush, r, decode_proto; -+ int rlen, olen; -+ int seq, r; - - rptr = mi; - if (*rptr == 0) ---- ppp-2.4.2/pppdump/bsd-comp.c.fix 2004-06-17 16:53:52.680872972 +0200 -+++ ppp-2.4.2/pppdump/bsd-comp.c 2004-06-17 16:58:07.013881369 +0200 -@@ -43,7 +43,9 @@ - - #include - #include -+#include - #include -+#include - #include "ppp_defs.h" - #include "ppp-comp.h" - -@@ -381,7 +383,7 @@ - || options[0] != CI_BSD_COMPRESS || options[1] != CILEN_BSD_COMPRESS - || BSD_VERSION(options[2]) != BSD_CURRENT_VERSION - || BSD_NBITS(options[2]) != db->maxbits -- || decomp && db->lens == NULL) -+ || (decomp && db->lens == NULL)) - return 0; - - if (decomp) { -@@ -554,11 +556,11 @@ - u_int n_bits = db->n_bits; - u_int tgtbitno = 32-n_bits; /* bitno when we have a code */ - struct bsd_dict *dictp; -- int explen, i, seq, len; -+ int explen, seq, len; - u_int incode, oldcode, finchar; - u_char *p, *rptr, *wptr; - int ilen; -- int dlen, space, codelen, extra; -+ int dlen=0, codelen, extra; - - rptr = cmsg; - if (*rptr == 0) -@@ -614,7 +616,7 @@ - } - - if (incode > max_ent + 2 || incode > db->maxmaxcode -- || incode > max_ent && oldcode == CLEAR) { -+ || (incode > max_ent && oldcode == CLEAR)) { - if (db->debug) { - printf("bsd_decomp%d: bad code 0x%x oldcode=0x%x ", - db->unit, incode, oldcode); ---- ppp-2.4.2/pppdump/pppdump.c.fix 2004-06-17 16:44:38.175172998 +0200 -+++ ppp-2.4.2/pppdump/pppdump.c 2004-06-17 16:52:51.795250137 +0200 -@@ -34,6 +34,7 @@ - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - #include -+#include - #include - #include - #include -@@ -53,6 +54,12 @@ - extern int optind; - extern char *optarg; - -+void dumplog(FILE *); -+void dumpppp(FILE *); -+void show_time(FILE *, int); -+ -+ -+int - main(ac, av) - int ac; - char **av; -@@ -105,7 +112,7 @@ - exit(0); - } - --dumplog(f) -+void dumplog(f) - FILE *f; - { - int c, n, k, col; -@@ -183,7 +190,7 @@ - show_time(f, c); - break; - default: -- printf("?%.2x\n"); -+ printf("?%.2x\n", c); - } - } - } -@@ -244,7 +251,9 @@ - - unsigned char dbuf[8192]; - --dumpppp(f) -+void handle_ccp(struct pkt *, u_char *, int); -+ -+void dumpppp(f) - FILE *f; - { - int c, n, k; -@@ -412,7 +421,7 @@ - show_time(f, c); - break; - default: -- printf("?%.2x\n"); -+ printf("?%.2x\n", c); - } - } - } -@@ -429,7 +438,7 @@ - NULL - }; - --handle_ccp(cp, dp, len) -+void handle_ccp(cp, dp, len) - struct pkt *cp; - u_char *dp; - int len; -@@ -485,7 +494,7 @@ - } - } - --show_time(f, c) -+void show_time(f, c) - FILE *f; - int c; - { ---- ppp-2.4.2/chat/chat.c.fix 2003-03-30 10:23:48.000000000 +0200 -+++ ppp-2.4.2/chat/chat.c 2004-06-17 16:33:22.455951861 +0200 -@@ -213,7 +213,7 @@ - void *copy_of __P((char *s)); - char *grow __P((char *s, char **p, size_t len)); - void usage __P((void)); --void logf __P((const char *fmt, ...)); -+void logfmt __P((const char *fmt, ...)); - void fatal __P((int code, const char *fmt, ...)); - SIGTYPE sigalrm __P((int signo)); - SIGTYPE sigint __P((int signo)); -@@ -495,7 +495,7 @@ - /* - * Send a message to syslog and/or stderr. - */ --void logf __V((const char *fmt, ...)) -+void logfmt __V((const char *fmt, ...)) - { - va_list args; - -@@ -558,7 +558,7 @@ - fatal(2, "Can't set file mode flags on stdin: %m"); - - if (verbose) -- logf("alarm"); -+ logfmt("alarm"); - } - - void unalarm() -@@ -1001,9 +1001,9 @@ - * The expectation did not occur. This is terminal. - */ - if (fail_reason) -- logf("Failed (%s)", fail_reason); -+ logfmt("Failed (%s)", fail_reason); - else -- logf("Failed"); -+ logfmt("Failed"); - terminate(exit_code); - } - -@@ -1079,7 +1079,7 @@ - abort_string[n_aborts++] = s1; - - if (verbose) -- logf("abort on (%v)", s); -+ logfmt("abort on (%v)", s); - return; - } - -@@ -1105,7 +1105,7 @@ - pack++; - n_aborts--; - if (verbose) -- logf("clear abort on (%v)", s); -+ logfmt("clear abort on (%v)", s); - } - } - free(s1); -@@ -1129,7 +1129,7 @@ - report_string[n_reports++] = s1; - - if (verbose) -- logf("report (%v)", s); -+ logfmt("report (%v)", s); - return; - } - -@@ -1155,7 +1155,7 @@ - pack++; - n_reports--; - if (verbose) -- logf("clear report (%v)", s); -+ logfmt("clear report (%v)", s); - } - } - free(s1); -@@ -1173,7 +1173,7 @@ - timeout = DEFAULT_CHAT_TIMEOUT; - - if (verbose) -- logf("timeout set to %d seconds", timeout); -+ logfmt("timeout set to %d seconds", timeout); - - return; - } -@@ -1236,7 +1236,7 @@ - return ((int)c & 0x7F); - - default: -- logf("warning: read() on stdin returned %d", status); -+ logfmt("warning: read() on stdin returned %d", status); - - case -1: - if ((status = fcntl(0, F_GETFL, 0)) == -1) -@@ -1264,7 +1264,7 @@ - return (0); - - default: -- logf("warning: write() on stdout returned %d", status); -+ logfmt("warning: write() on stdout returned %d", status); - - case -1: - if ((status = fcntl(0, F_GETFL, 0)) == -1) -@@ -1286,9 +1286,9 @@ - - if (verbose) { - if (errno == EINTR || errno == EWOULDBLOCK) -- logf(" -- write timed out"); -+ logfmt(" -- write timed out"); - else -- logf(" -- write failed: %m"); -+ logfmt(" -- write failed: %m"); - } - return (0); - } -@@ -1303,9 +1303,9 @@ - - if (verbose) { - if (quiet) -- logf("send (??????)"); -+ logfmt("send (?????\?)"); - else -- logf("send (%v)", s); -+ logfmt("send (%v)", s); - } - - alarm(timeout); alarmed = 0; -@@ -1392,17 +1392,17 @@ - minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1; - - if (verbose) -- logf("expect (%v)", string); -+ logfmt("expect (%v)", string); - - if (len > STR_LEN) { -- logf("expect string is too long"); -+ logfmt("expect string is too long"); - exit_code = 1; - return 0; - } - - if (len == 0) { - if (verbose) -- logf("got it"); -+ logfmt("got it"); - return (1); - } - -@@ -1416,16 +1416,16 @@ - echo_stderr(c); - if (verbose && c == '\n') { - if (s == logged) -- logf(""); /* blank line */ -+ logfmt(""); /* blank line */ - else -- logf("%0.*v", s - logged, logged); -+ logfmt("%0.*v", s - logged, logged); - logged = s + 1; - } - - *s++ = c; - - if (verbose && s >= logged + 80) { -- logf("%0.*v", s - logged, logged); -+ logfmt("%0.*v", s - logged, logged); - logged = s; - } - -@@ -1470,8 +1470,8 @@ - strncmp(s - len, string, len) == 0) { - if (verbose) { - if (s > logged) -- logf("%0.*v", s - logged, logged); -- logf(" -- got it\n"); -+ logfmt("%0.*v", s - logged, logged); -+ logfmt(" -- got it\n"); - } - - alarm(0); -@@ -1484,8 +1484,8 @@ - strncmp(s - abort_len, abort_string[n], abort_len) == 0) { - if (verbose) { - if (s > logged) -- logf("%0.*v", s - logged, logged); -- logf(" -- failed"); -+ logfmt("%0.*v", s - logged, logged); -+ logfmt(" -- failed"); - } - - alarm(0); -@@ -1499,7 +1499,7 @@ - if (s >= end) { - if (logged < s - minlen) { - if (verbose) -- logf("%0.*v", s - logged, logged); -+ logfmt("%0.*v", s - logged, logged); - logged = s; - } - s -= minlen; -@@ -1509,16 +1509,16 @@ - } - - if (alarmed && verbose) -- logf("warning: alarm synchronization problem"); -+ logfmt("warning: alarm synchronization problem"); - } - - alarm(0); - - if (verbose && printed) { - if (alarmed) -- logf(" -- read timed out"); -+ logfmt(" -- read timed out"); - else -- logf(" -- read failed: %m"); -+ logfmt(" -- read failed: %m"); - } - - exit_code = 3; diff --git a/ppp-2.4.2-fix64.patch b/ppp-2.4.2-fix64.patch deleted file mode 100644 index 5c2d804..0000000 --- a/ppp-2.4.2-fix64.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ppp-2.4.2/pppd/sha1.c.fix64 2002-04-02 15:54:59.000000000 +0200 -+++ ppp-2.4.2/pppd/sha1.c 2004-06-17 17:22:00.698817462 +0200 -@@ -18,6 +18,7 @@ - - #include - #include /* htonl() */ -+#include /* u_int32_t */ - #include "sha1.h" - - static void -@@ -44,10 +45,10 @@ - static void - SHA1_Transform(unsigned long state[5], const unsigned char buffer[64]) - { -- unsigned long a, b, c, d, e; -+ u_int32_t a, b, c, d, e; - typedef union { - unsigned char c[64]; -- unsigned long l[16]; -+ u_int32_t l[16]; - } CHAR64LONG16; - CHAR64LONG16 *block; - diff --git a/ppp-2.4.2-lib64.patch b/ppp-2.4.2-lib64.patch deleted file mode 100644 index 005ca77..0000000 --- a/ppp-2.4.2-lib64.patch +++ /dev/null @@ -1,51 +0,0 @@ -If CC supports the "-print-multi-os-directory" option, use it to determine -where to check for the existence libcrypt. If it doesn't, then we get /usr/lib. - ---- ppp-2.4.2/pppd/Makefile.linux 2003-11-27 16:55:19.000000000 -0500 -+++ ppp-2.4.2/pppd/Makefile.linux 2004-03-10 17:44:04.000000000 -0500 -@@ -7,6 +7,7 @@ - BINDIR = $(DESTDIR)/usr/sbin - MANDIR = $(DESTDIR)/usr/man - INCDIR = $(DESTDIR)/usr/include -+LIBDIR = $(DESTDIR)/usr/lib/$(shell gcc -print-multi-os-directory 2> /dev/null) - - TARGETS = pppd - -@@ -31,7 +32,7 @@ - - CC = gcc - # --COPTS = -Wall $(RPM_OPT_FLAGS) -+COPTS = -Wall $(RPM_OPT_FLAGS) -DLIBDIR=\""$(LIBDIR)"\" - LIBS = -lutil - - # Uncomment the next 2 lines to include support for Microsoft's -@@ -119,7 +120,7 @@ - ifneq ($(wildcard /usr/include/crypt.h),) - CFLAGS += -DHAVE_CRYPT_H=1 - endif --ifneq ($(wildcard /usr/lib/libcrypt.*),) -+ifneq ($(wildcard $(LIBDIR)/libcrypt.*),) - LIBS += -lcrypt - endif - ---- ppp-2.4.2/pppd/plugins/Makefile.linux 2004-03-10 18:40:27.000000000 -0500 -+++ ppp-2.4.2/pppd/plugins/Makefile.linux 2004-03-10 18:41:20.000000000 -0500 -@@ -21,7 +21,7 @@ - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ - - VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h) --LIBDIR = $(DESTDIR)/usr/lib/pppd/$(VERSION) -+LIBDIR = $(DESTDIR)/usr/lib/$(shell $(CC) -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) - - install: $(PLUGINS) - $(INSTALL) -d $(LIBDIR) ---- ppp-2.4.2/pppd/pathnames.h 2004-03-10 18:52:15.000000000 -0500 -+++ ppp-2.4.2/pppd/pathnames.h 2004-03-10 18:52:10.000000000 -0500 -@@ -55,5 +55,5 @@ - #endif /* __STDC__ */ - - #ifdef PLUGIN --#define _PATH_PLUGIN "/usr/lib/pppd/" VERSION -+#define _PATH_PLUGIN LIBDIR "/pppd/" VERSION - #endif /* PLUGIN */ diff --git a/ppp-2.4.2-make.patch b/ppp-2.4.2-make.patch deleted file mode 100644 index f12518c..0000000 --- a/ppp-2.4.2-make.patch +++ /dev/null @@ -1,89 +0,0 @@ -Obey RPM_OPT_FLAGS, link with pppd with libutil to get logwtmp(), and enable -PAM support. ---- ppp-2.4.2/chat/Makefile.linux 2004-01-12 22:57:55.000000000 -0500 -+++ ppp-2.4.2/chat/Makefile.linux 2004-03-10 18:32:39.000000000 -0500 -@@ -6,7 +6,7 @@ - CDEF4= -DFNDELAY=O_NDELAY # Old name value - CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) - --COPTS= -O2 -g -pipe $(CDEFS) -+COPTS= $(RPM_OPT_FLAGS) $(CDEFS) - CFLAGS= $(COPTS) $(CDEFS) - - INSTALL= install ---- ppp-2.4.2/pppd/Makefile.linux 2003-11-27 16:55:19.000000000 -0500 -+++ ppp-2.4.2/pppd/Makefile.linux 2004-03-10 18:32:46.000000000 -0500 -@@ -29,10 +29,10 @@ - include .depend - endif - --# CC = gcc -+CC = gcc - # --COPTS = -O2 -pipe -Wall -g --LIBS = -+COPTS = -Wall $(RPM_OPT_FLAGS) -+LIBS = -lutil - - # Uncomment the next 2 lines to include support for Microsoft's - # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. -@@ -60,7 +60,7 @@ - USE_TDB=y - - HAS_SHADOW=y --#USE_PAM=y -+USE_PAM=y --#HAVE_INET6=y -+HAVE_INET6=y - - # Enable plugins ---- ppp-2.4.2/pppdump/Makefile.linux 1999-07-26 07:09:29.000000000 -0400 -+++ ppp-2.4.2/pppdump/Makefile.linux 2004-03-10 18:32:47.000000000 -0500 -@@ -1,4 +1,4 @@ --CFLAGS= -O -I../include/net -+CFLAGS= $(RPM_OPT_FLAGS) -I../include/net - OBJS = pppdump.o bsd-comp.o deflate.o zlib.o - - INSTALL= install ---- ppp-2.4.2/pppstats/Makefile.linux 2002-11-09 06:24:43.000000000 -0500 -+++ ppp-2.4.2/pppstats/Makefile.linux 2004-03-10 18:32:55.000000000 -0500 -@@ -7,7 +7,7 @@ - PPPSTATOBJS = pppstats.o - - #CC = gcc --COPTS = -O -+COPTS = $(RPM_OPT_FLAGS) - COMPILE_FLAGS = -I../include - LIBS = - ---- ppp-2.4.2/pppd/plugins/Makefile.linux 2004-01-12 22:56:24.000000000 -0500 -+++ ppp-2.4.2/pppd/plugins/Makefile.linux 2004-03-10 18:41:20.000000000 -0500 -@@ -1,5 +1,5 @@ - CC = gcc --COPTS = -O2 -g -+COPTS = $(RPM_OPT_FLAGS) - CFLAGS = $(COPTS) -I.. -I../../include -fPIC - LDFLAGS = -shared - INSTALL = install -o root ---- ppp-2.4.2/pppd/plugins/radius/Makefile.linux 2004-03-10 18:46:36.000000000 -0500 -+++ ppp-2.4.2/pppd/plugins/radius/Makefile.linux 2004-03-10 18:46:44.000000000 -0500 -@@ -5,7 +5,7 @@ - - MANDIR=/usr/man - PLUGIN=radius.so radattr.so radrealms.so --CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2 -+CFLAGS=-I../.. -I../../../include -Iradiusclient/include $(RPM_OPT_FLAGS) - - # Uncomment the next line to include support for Microsoft's - # MS-CHAP authentication protocol. ---- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux 2004-03-10 18:46:52.000000000 -0500 -+++ ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux 2004-03-10 18:46:58.000000000 -0500 -@@ -16,7 +16,7 @@ - # Version is set ONLY IN THE MAKEFILE! Don't delete this! - VERSION=3.3 - --COPTS=-O2 -g -+COPTS=$(RPM_OPT_FLAGS) - CFLAGS=$(COPTS) -I../../../include/linux - all: rp-pppoe.so - diff --git a/ppp-2.4.2-no_strip.patch b/ppp-2.4.2-no_strip.patch deleted file mode 100644 index ee413de..0000000 --- a/ppp-2.4.2-no_strip.patch +++ /dev/null @@ -1,205 +0,0 @@ ---- ppp-2.4.2/pppd/Makefile.linux.make.no_strip 2003-11-27 22:55:19.000000000 +0100 -+++ ppp-2.4.2/pppd/Makefile.linux.make 2004-09-16 12:00:08.641944353 +0200 -@@ -98,7 +98,7 @@ - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -199,7 +199,7 @@ - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppd/Makefile.linux.no_strip 2004-09-16 12:00:08.550956895 +0200 -+++ ppp-2.4.2/pppd/Makefile.linux 2004-09-16 12:00:08.651942974 +0200 -@@ -99,7 +99,7 @@ - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -200,7 +200,7 @@ - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppd/plugins/radius/Makefile.linux.make.no_strip 2002-11-09 12:24:42.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/radius/Makefile.linux.make 2004-09-16 12:00:08.642944215 +0200 -@@ -30,9 +30,9 @@ - install: all - $(MAKE) $(MFLAGS) -C radiusclient install - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radius.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR) - $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8 - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8 - ---- ppp-2.4.2/pppd/plugins/radius/Makefile.linux.no_strip 2004-09-16 12:00:08.518961306 +0200 -+++ ppp-2.4.2/pppd/plugins/radius/Makefile.linux 2004-09-16 12:00:08.643944077 +0200 -@@ -30,9 +30,9 @@ - install: all - $(MAKE) $(MFLAGS) -C radiusclient install - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radius.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR) - $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8 - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8 - ---- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux.make.no_strip 2004-01-13 04:57:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux.make 2004-09-16 12:00:08.650943112 +0200 -@@ -25,7 +25,7 @@ - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) -+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR) - - clean: - rm -f *.o *.so ---- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux.no_strip 2004-09-16 12:00:08.518961306 +0200 -+++ ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile.linux 2004-09-16 12:00:08.650943112 +0200 -@@ -25,7 +25,7 @@ - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) -+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR) - - clean: - rm -f *.o *.so ---- ppp-2.4.2/pppd/Makefile.linux.lib64.no_strip 2004-09-16 12:00:08.516961582 +0200 -+++ ppp-2.4.2/pppd/Makefile.linux.lib64 2004-09-16 12:00:08.641944353 +0200 -@@ -98,7 +98,7 @@ - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -199,7 +199,7 @@ - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppd/Makefile.linux.pie.no_strip 2004-09-16 12:00:08.536958825 +0200 -+++ ppp-2.4.2/pppd/Makefile.linux.pie 2004-09-16 12:00:08.651942974 +0200 -@@ -99,7 +99,7 @@ - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -200,7 +200,7 @@ - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppdump/Makefile.linux.make.no_strip 1999-07-26 13:09:29.000000000 +0200 -+++ ppp-2.4.2/pppdump/Makefile.linux.make 2004-09-16 12:00:08.652942836 +0200 -@@ -13,5 +13,5 @@ - - install: - mkdir -p $(BINDIR) $(MANDIR)/man8 -- $(INSTALL) -s -c pppdump $(BINDIR) -+ $(INSTALL) -c pppdump $(BINDIR) - $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppdump/Makefile.linux.no_strip 2004-09-16 12:00:08.516961582 +0200 -+++ ppp-2.4.2/pppdump/Makefile.linux 2004-09-16 12:00:08.653942699 +0200 -@@ -13,5 +13,5 @@ - - install: - mkdir -p $(BINDIR) $(MANDIR)/man8 -- $(INSTALL) -s -c pppdump $(BINDIR) -+ $(INSTALL) -c pppdump $(BINDIR) - $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)/man8 ---- ppp-2.4.2/pppstats/Makefile.linux.make.no_strip 2002-11-09 12:24:43.000000000 +0100 -+++ ppp-2.4.2/pppstats/Makefile.linux.make 2004-09-16 12:00:08.654942561 +0200 -@@ -19,7 +19,7 @@ - - install: pppstats - -mkdir -p $(MANDIR)/man8 -- $(INSTALL) -s -c pppstats $(BINDIR)/pppstats -+ $(INSTALL) -c pppstats $(BINDIR)/pppstats - $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)/man8/pppstats.8 - - pppstats: $(PPPSTATSRCS) ---- ppp-2.4.2/pppstats/Makefile.linux.no_strip 2004-09-16 12:00:08.517961444 +0200 -+++ ppp-2.4.2/pppstats/Makefile.linux 2004-09-16 12:00:08.654942561 +0200 -@@ -19,7 +19,7 @@ - - install: pppstats - -mkdir -p $(MANDIR)/man8 -- $(INSTALL) -s -c pppstats $(BINDIR)/pppstats -+ $(INSTALL) -c pppstats $(BINDIR)/pppstats - $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)/man8/pppstats.8 - - pppstats: $(PPPSTATSRCS) ---- ppp-2.4.2/chat/Makefile.linux.make.no_strip 2004-01-13 04:57:55.000000000 +0100 -+++ ppp-2.4.2/chat/Makefile.linux.make 2004-09-16 12:00:08.655942423 +0200 -@@ -21,7 +21,7 @@ - - install: chat - mkdir -p $(BINDIR) -- $(INSTALL) -s -c chat $(BINDIR) -+ $(INSTALL) -c chat $(BINDIR) - $(INSTALL) -c -m 644 chat.8 $(MANDIR)/man8 - - clean: ---- ppp-2.4.2/chat/Makefile.linux.no_strip 2004-09-16 12:00:08.551956757 +0200 -+++ ppp-2.4.2/chat/Makefile.linux 2004-09-16 12:00:08.655942423 +0200 -@@ -21,7 +21,7 @@ - - install: chat - mkdir -p $(BINDIR) -- $(INSTALL) -s -c chat $(BINDIR) -+ $(INSTALL) -c chat $(BINDIR) - $(INSTALL) -c -m 644 chat.8 $(MANDIR)/man8 - - clean: ---- ppp-2.4.2/chat/Makefile.linux.pie.no_strip 2004-09-16 12:00:08.515961719 +0200 -+++ ppp-2.4.2/chat/Makefile.linux.pie 2004-09-16 12:00:08.655942423 +0200 -@@ -21,7 +21,7 @@ - - install: chat - mkdir -p $(BINDIR) -- $(INSTALL) -s -c chat $(BINDIR) -+ $(INSTALL) -c chat $(BINDIR) - $(INSTALL) -c -m 644 chat.8 $(MANDIR)/man8 - - clean: diff --git a/ppp-2.4.2-pcap.patch b/ppp-2.4.2-pcap.patch deleted file mode 100644 index 6973902..0000000 --- a/ppp-2.4.2-pcap.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- ppp-2.4.2/pppd/options.c.pcap 2004-01-13 05:02:07.000000000 +0100 -+++ ppp-2.4.2/pppd/options.c 2004-09-15 11:39:34.832772935 +0200 -@@ -56,7 +56,6 @@ - #endif - #ifdef PPP_FILTER - #include --#include /* XXX: To get struct pcap */ - #endif - - #include "pppd.h" -@@ -122,7 +121,6 @@ - #ifdef PPP_FILTER - struct bpf_program pass_filter;/* Filter program for packets to pass */ - struct bpf_program active_filter; /* Filter program for link-active pkts */ --pcap_t pc; /* Fake struct pcap so we can compile expr */ - #endif - - char *current_option; /* the name of the option being parsed */ -@@ -1439,12 +1437,18 @@ - setpassfilter(argv) - char **argv; - { -- pc.linktype = DLT_PPP; -- pc.snapshot = PPP_HDRLEN; -+ pcap_t* pc = pcap_open_dead (DLT_PPP, PPP_HDRLEN); -+ if (!pc) { -+ option_error("error in pass-filter expression: pcap_open_dead failed\n"); -+ return 0; -+ } - -- if (pcap_compile(&pc, &pass_filter, *argv, 1, netmask) == 0) -+ if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == 0) { -+ pcap_close(pc); - return 1; -- option_error("error in pass-filter expression: %s\n", pcap_geterr(&pc)); -+ } -+ option_error("error in pass-filter expression: %s\n", pcap_geterr(pc)); -+ pcap_close(pc); - return 0; - } - -@@ -1455,12 +1459,18 @@ - setactivefilter(argv) - char **argv; - { -- pc.linktype = DLT_PPP; -- pc.snapshot = PPP_HDRLEN; -+ pcap_t* pc = pcap_open_dead (DLT_PPP, PPP_HDRLEN); -+ if (!pc) { -+ option_error("error in pass-filter expression: pcap_open_dead failed\n"); -+ return 0; -+ } - -- if (pcap_compile(&pc, &active_filter, *argv, 1, netmask) == 0) -+ if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == 0) { -+ pcap_close(pc); - return 1; -- option_error("error in active-filter expression: %s\n", pcap_geterr(&pc)); -+ } -+ option_error("error in active-filter expression: %s\n", pcap_geterr(pc)); -+ pcap_close(pc); - return 0; - } - #endif diff --git a/ppp-2.4.2-pppoatm-make.patch b/ppp-2.4.2-pppoatm-make.patch index af25ca4..897e4fd 100644 --- a/ppp-2.4.2-pppoatm-make.patch +++ b/ppp-2.4.2-pppoatm-make.patch @@ -2,7 +2,7 @@ diff -up ppp-2.4.4/pppd/plugins/pppoatm/Makefile.linux.atm-make ppp-2.4.4/pppd/p --- ppp-2.4.4/pppd/plugins/pppoatm/Makefile.linux.atm-make 2008-08-28 17:36:10.000000000 -0400 +++ ppp-2.4.4/pppd/plugins/pppoatm/Makefile.linux 2008-08-28 17:36:56.000000000 -0400 @@ -1,5 +1,5 @@ - CC = gcc + #CC = gcc -COPTS = -O2 -g +COPTS = $(RPM_OPT_FLAGS) CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC diff --git a/ppp-2.4.2-pppoatm-mtu.patch b/ppp-2.4.2-pppoatm-mtu.patch deleted file mode 100644 index 085f398..0000000 --- a/ppp-2.4.2-pppoatm-mtu.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ppp-2.4.2/pppd/plugins/pppoatm/pppoatm.c.mtu 2004-10-07 13:32:05.660910432 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/pppoatm.c 2004-10-07 13:58:20.096559832 +0100 -@@ -175,8 +175,10 @@ - { - 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) - fatal("Couldn't create IP socket: %m"); -@@ -192,8 +194,10 @@ - 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) diff --git a/ppp-2.4.2-pppoatm.patch b/ppp-2.4.2-pppoatm.patch deleted file mode 100644 index f2019a0..0000000 --- a/ppp-2.4.2-pppoatm.patch +++ /dev/null @@ -1,1245 +0,0 @@ ---- ppp-2.4.2/configure.atm1 2002-11-09 11:24:41.000000000 +0000 -+++ ppp-2.4.2/configure 2004-10-04 12:11:55.000000000 +0100 -@@ -141,7 +141,7 @@ if [ -d "$ksrc" ]; then - rm -f Makedefs.com - ln -s $ksrc/Makedefs$compiletype Makedefs.com - echo " $ksrc/Makedefs$compiletype -> Makedefs.com" -- for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe pppd/plugins/radius; do -+ for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe pppd/plugins/radius pppd/plugins/pppoatm; do - rm -f $dir/Makefile - if [ -f $dir/Makefile.$makext ]; then - ln -s Makefile.$makext $dir/Makefile ---- ppp-2.4.2/pppd/plugins/Makefile.linux.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/Makefile.linux 2004-10-04 12:11:55.000000000 +0100 -@@ -4,7 +4,7 @@ CFLAGS = $(COPTS) -I.. -I../../include - - LDFLAGS = -shared - INSTALL = install -o root - --SUBDIRS := rp-pppoe -+SUBDIRS := rp-pppoe pppoatm - # Uncomment the next line to include the radius authentication plugin - # SUBDIRS += radius - PLUGINS := minconn.so passprompt.so passwordfd.so ---- ppp-2.4.2/pppd/plugins/pppoatm/ans.c.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/ans.c 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,262 @@ -+/* ans.c - Interface for text2atm and atm2text to ANS */ -+ -+/* Written 1996-2000 by Werner Almesberger, EPFL-LRC/ICA */ -+ -+ -+/* -+ * This stuff is a temporary hack to avoid using gethostbyname_nsap and such -+ * without doing the "full upgrade" to getaddrinfo/getnameinfo. This also -+ * serves as an exercise for me to get all the details right before I propose -+ * a patch that would eventually end up in libc (and that should therefore be -+ * as stable as possible). -+ */ -+ -+#if HAVE_CONFIG_H -+#include -+#endif -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "atm.h" -+#include "atmres.h" -+ -+ -+#define MAX_ANSWER 2048 -+#define MAX_NAME 1024 -+ -+#define MAX_LINE 2048 /* in /etc/e164_cc */ -+#define E164_CC_DEFAULT_LEN 2 -+#define E164_CC_FILE "/etc/e164_cc" -+ -+#define GET16(pos) (((pos)[0] << 8) | (pos)[1]) -+ -+ -+static int ans(const char *text,int wanted,void *result,int res_len) -+{ -+ unsigned char answer[MAX_ANSWER]; -+ unsigned char name[MAX_NAME]; -+ unsigned char *pos,*data,*found; -+ int answer_len,name_len,data_len,found_len; -+ int questions,answers; -+ -+ found_len = 0; /* gcc wants it */ -+ if ((answer_len = res_search(text,C_IN,wanted,answer,MAX_ANSWER)) < 0) -+ return TRY_OTHER; -+ /* -+ * Response header: id, flags, #queries, #answers, #authority, -+ * #additional (all 16 bits) -+ */ -+ pos = answer+12; -+ if (answer[3] & 15) return TRY_OTHER; /* rcode != 0 */ -+ questions = GET16(answer+4); -+ if (questions != 1) return TRY_OTHER; /* trouble ... */ -+ answers = GET16(answer+6); -+ if (answers < 1) return TRY_OTHER; -+ /* -+ * Query: name, type (16), class (16) -+ */ -+ if ((name_len = dn_expand(answer,answer+answer_len,pos,name,MAX_NAME)) < 0) -+ return TRY_OTHER; -+ pos += name_len; -+ if (GET16(pos) != wanted || GET16(pos+2) != C_IN) return TRY_OTHER; -+ pos += 4; -+ /* -+ * Iterate over answers until we find something we like, giving priority -+ * to ATMA_AESA (until signaling is fixed to work with E.164 too) -+ */ -+ found = NULL; -+ while (answers--) { -+ /* -+ * RR: name, type (16), class (16), TTL (32), resource_len (16), -+ * resource_data ... -+ */ -+ if ((name_len = dn_expand(answer,answer+answer_len,pos,name,MAX_NAME)) -+ < 0) return TRY_OTHER; -+ pos += name_len; -+ data_len = GET16(pos+8); -+ data = pos+10; -+ pos = data+data_len; -+ if (GET16(data-10) != wanted || GET16(data-8) != C_IN || !--data_len) -+ continue; -+ switch (wanted) { -+ case T_NSAP: -+ data_len++; -+ if (data_len != ATM_ESA_LEN) continue; -+ memcpy(((struct sockaddr_atmsvc *) result)-> -+ sas_addr.prv,data,ATM_ESA_LEN); -+ return 0; -+ case T_ATMA: -+ switch (*data++) { -+ case ATMA_AESA: -+ if (data_len != ATM_ESA_LEN) continue; -+ memcpy(((struct sockaddr_atmsvc *) result)-> -+ sas_addr.prv,data,ATM_ESA_LEN); -+ return 0; -+ case ATMA_E164: -+ if (data_len > ATM_E164_LEN) continue; -+ if (!found) { -+ found = data; -+ found_len = data_len; -+ } -+ break; -+ default: -+ continue; -+ } -+ case T_PTR: -+ if (dn_expand(answer,answer+answer_len,data,result, -+ res_len) < 0) return FATAL; -+ return 0; -+ default: -+ continue; -+ } -+ } -+ if (!found) return TRY_OTHER; -+ memcpy(((struct sockaddr_atmsvc *) result)->sas_addr.pub,found, -+ found_len); -+ ((struct sockaddr_atmsvc *) result)->sas_addr.pub[found_len] = 0; -+ return 0; -+} -+ -+ -+int ans_byname(const char *text,struct sockaddr_atmsvc *addr,int length, -+ int flags) -+{ -+ if (!(flags & T2A_SVC) || length != sizeof(*addr)) return TRY_OTHER; -+ memset(addr,0,sizeof(*addr)); -+ addr->sas_family = AF_ATMSVC; -+ if (!ans(text,T_ATMA,addr,length)) return 0; -+ return ans(text,T_NSAP,addr,length); -+} -+ -+ -+static int encode_nsap(char *buf,const unsigned char *addr) -+{ -+ static int fmt_dcc[] = { 2,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -+ 4,2,0 }; -+ static int fmt_e164[] = { 2,12,1,1,1,1,1,1,1,1,16,2,0 }; -+ int *fmt; -+ int pos,i,j; -+ -+ switch (*addr) { -+ case ATM_AFI_DCC: -+ case ATM_AFI_ICD: -+ case ATM_AFI_LOCAL: -+ case ATM_AFI_DCC_GROUP: -+ case ATM_AFI_ICD_GROUP: -+ case ATM_AFI_LOCAL_GROUP: -+ fmt = fmt_dcc; -+ break; -+ case ATM_AFI_E164: -+ case ATM_AFI_E164_GROUP: -+ fmt = fmt_e164; -+ break; -+ default: -+ return TRY_OTHER; -+ } -+ pos = 2*ATM_ESA_LEN; -+ for (i = 0; fmt[i]; i++) { -+ pos -= fmt[i]; -+ for (j = 0; j < fmt[i]; j++) -+ sprintf(buf++,"%x", -+ (addr[(pos+j) >> 1] >> 4*(1-((pos+j) & 1))) & 0xf); -+ *buf++ = '.'; -+ } -+ strcpy(buf,"AESA.ATMA.INT."); -+ return 0; -+} -+ -+ -+static int encode_nsap_new(char *buf,const unsigned char *addr) -+{ -+ int i; -+ int digit; -+ -+ for (i = 20; i; ) { -+ i--; -+ digit = addr[i] & 0x0F; -+ *(buf++) = digit + (digit >= 10 ? '7' : '0'); -+ *(buf++) = '.'; -+ digit = ((unsigned char) (addr[i])) >> 4; -+ *(buf++) = digit + (digit >= 10 ? '7' : '0'); -+ *(buf++) = '.'; -+ } -+ strcpy (buf, "NSAP.INT."); -+ return 0; -+} -+ -+ -+static int cc_len(int p0,int p1) -+{ -+ static char *cc_table = NULL; -+ FILE *file; -+ char buffer[MAX_LINE]; -+ char *here; -+ int cc; -+ -+ if (!cc_table) { -+ if (!(cc_table = malloc(100))) { -+ perror("malloc"); -+ return E164_CC_DEFAULT_LEN; -+ } -+ memset(cc_table,E164_CC_DEFAULT_LEN,100); -+ if (!(file = fopen(E164_CC_FILE,"r"))) -+ perror(E164_CC_FILE); -+ else { -+ while (fgets(buffer,MAX_LINE,file)) { -+ here = strchr(buffer,'#'); -+ if (here) *here = 0; -+ if (sscanf(buffer,"%d",&cc) == 1) { -+ if (cc < 10) cc_table[cc] = 1; -+ else if (cc < 100) cc_table[cc] = 2; -+ else cc_table[cc/10] = 3; -+ } -+ } -+ fclose(file); -+ } -+ } -+ if (cc_table[p0] == 1) return 1; -+ return cc_table[p0*10+p1]; -+} -+ -+ -+static int encode_e164(char *buf,const char *addr) -+{ -+ const char *prefix,*here; -+ -+ prefix = addr+cc_len(addr[0]-48,addr[1]-48); -+ here = strchr(addr,0); -+ while (here > prefix) { -+ *buf++ = *--here; -+ *buf++ = '.'; -+ } -+ while (here > addr) *buf++ = *addr++; -+ strcpy(buf,".E164.ATMA.INT."); -+ return 0; -+} -+ -+ -+int ans_byaddr(char *buffer,int length,const struct sockaddr_atmsvc *addr, -+ int flags) -+{ -+ char tmp[MAX_NAME]; /* could be smaller ... */ -+ int res; -+ -+ if (addr->sas_addr.prv) { -+ res = encode_nsap(tmp,addr->sas_addr.prv); -+ if (!res && !ans(tmp,T_PTR,buffer,length)) return 0; -+ res = encode_nsap_new(tmp,addr->sas_addr.prv); -+ if (res < 0) return res; -+ return ans(tmp,T_PTR,buffer,length); -+ } else { -+ res = encode_e164(tmp,addr->sas_addr.pub); -+ if (res < 0) return res; -+ return ans(tmp,T_PTR,buffer,length); -+ } -+} ---- ppp-2.4.2/pppd/plugins/pppoatm/Makefile.linux.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/Makefile.linux 2004-10-05 17:32:17.462042440 +0100 -@@ -0,0 +1,41 @@ -+CC = gcc -+COPTS = -O2 -g -+CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC -+LDFLAGS = -shared -+INSTALL = install -o root -+ -+#*********************************************************************** -+ -+PLUGIN := pppoatm.so -+PLUGIN_OBJS := pppoatm.o -+ -+#******* -+# Do we have the ATM libraries installed? Set HAVE_LIBATM to use them, -+# or leave it unset to build the few routines we actually _use_ into -+# the plugin directly. -+# -+#HAVE_LIBATM=yes -+ -+ifdef HAVE_LIBATM -+LIBS := -latm -+else -+CFLAGS += -I. -+PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o -+LIBS := -lresolv -+endif -+ -+#********* -+all: $(PLUGIN) -+ -+$(PLUGIN): $(PLUGIN_OBJS) -+ $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS) -+ -+install: all -+ $(INSTALL) -d -m 755 $(LIBDIR) -+ $(INSTALL) -c -m 4550 $(PLUGIN) $(LIBDIR) -+ -+clean: -+ rm -f *.o *.so -+ -+%.o: %.c -+ $(CC) $(CFLAGS) -c -o $@ $< ---- ppp-2.4.2/pppd/plugins/pppoatm/text2atm.c.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/text2atm.c 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,249 @@ -+/* text2atm.c - Converts textual representation of ATM address to binary -+ encoding */ -+ -+/* Written 1995-2000 by Werner Almesberger, EPFL-LRC/ICA */ -+ -+#if HAVE_CONFIG_H -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+ -+#include "atm.h" -+#include "atmsap.h" -+#include "atmres.h" -+ -+ -+static int try_pvc(const char *text,struct sockaddr_atmpvc *addr,int flags) -+{ -+ int part[3]; -+ int i; -+ -+ part[0] = part[1] = part[2] = 0; -+ i = 0; -+ while (1) { -+ if (!*text) return FATAL; /* empty or ends with a dot */ -+ if (i == 3) return TRY_OTHER; /* too long */ -+ if (isdigit(*text)) { -+ if (*text == '0' && isdigit(text[1])) return TRY_OTHER; -+ /* no leading zeroes */ -+ do { -+ if (part[i] > INT_MAX/10) return TRY_OTHER;/* number too big */ -+ part[i] = part[i]*10+*text++-'0'; -+ } -+ while (isdigit(*text)); -+ i++; -+ if (!*text) break; -+ if (*text++ != '.') return TRY_OTHER; /* non-PVC character */ -+ continue; -+ } -+ if (*text == '*') { -+ if (!(flags & T2A_WILDCARD)) return FATAL; /* not allowed */ -+ part[i++] = ATM_ITF_ANY; /* all *_ANY have the same value */ -+ } -+ else { -+ if (*text != '?') return TRY_OTHER; /* invalid character */ -+ if (!(flags & T2A_UNSPEC)) return FATAL; /* not allowed */ -+ part[i++] = ATM_VPI_UNSPEC; /* all *_UNSPEC have the same -+ value */ -+ } -+ if (!*++text) break; -+ if (*text++ != '.') return FATAL; /* dot required */ -+ } -+ if (i < 2) return TRY_OTHER; /* no dots */ -+ if (i == 2) { -+ part[2] = part[1]; -+ part[1] = part[0]; -+ part[0] = 0; /* default interface */ -+ } -+ if (part[0] > SHRT_MAX || part[2] > ATM_MAX_VCI) -+ return TRY_OTHER; /* too big */ -+ if (part[1] > (flags & T2A_NNI ? ATM_MAX_VPI_NNI : ATM_MAX_VPI)) -+ return TRY_OTHER; /* too big */ -+ if (part[0] == ATM_VPI_UNSPEC) return FATAL; /* bad */ -+ addr->sap_family = AF_ATMPVC; -+ addr->sap_addr.itf = part[0]; -+ addr->sap_addr.vpi = part[1]; -+ addr->sap_addr.vci = part[2]; -+ return 0; -+} -+ -+ -+static int do_try_nsap(const char *text,struct sockaddr_atmsvc *addr,int flags) -+{ -+ const char *walk; -+ int count,pos,dot; -+ int offset,len; -+ char value; -+ -+ count = dot = 0; -+ for (walk = text; *walk; walk++) -+ if (isdigit(*walk)) { -+ if (count++ == 15) break; -+ dot = 1; -+ } -+ else if (*text != '.') break; -+ else if (!dot) return FATAL; /* two dots in a row */ -+ else dot = 0; -+ if (*walk != ':') { -+ pos = 0; -+ offset = 0; -+ } -+ else { -+ if (!dot || *text == '0') return FATAL; -+ addr->sas_addr.prv[0] = ATM_AFI_E164; -+ addr->sas_addr.prv[1] = 0; -+ memset(addr->sas_addr.prv+1,0,8); -+ for (pos = 18-count-1; *text; text++) { -+ if (*text == '.') continue; -+ if (*text == ':') break; -+ else { -+ if (pos & 1) addr->sas_addr.prv[pos >> 1] |= *text-'0'; -+ else addr->sas_addr.prv[pos >> 1] = (*text-'0') << 4; -+ pos++; -+ } -+ } -+ addr->sas_addr.prv[8] |= 0xf; -+ text++; -+ pos++; -+ offset = 72; -+ } -+ for (dot = 0; *text; text++) -+ if (isxdigit(*text)) { -+ if (pos == ATM_ESA_LEN*2) return TRY_OTHER; /* too long */ -+ value = isdigit(*text) ? *text-'0' : (islower(*text) ? -+ toupper(*text) : *text)-'A'+10; -+ if (pos & 1) addr->sas_addr.prv[pos >> 1] |= value; -+ else addr->sas_addr.prv[pos >> 1] = value << 4; -+ pos++; -+ dot = 1; -+ } -+ else -+ if (*text == '/' && (flags & T2A_WILDCARD)) break; -+ else if (*text != '.') return TRY_OTHER; -+ else { -+ if (!dot) return FATAL; /* two dots in a row */ -+ dot = 0; -+ } -+ if (!dot) return FATAL; -+ if (pos > 1 && !*addr->sas_addr.prv) -+ return TRY_OTHER; /* no leading zeroes */ -+ if (!*text) -+ return pos != ATM_ESA_LEN*2 ? TRY_OTHER : ATM_ESA_LEN*2; -+ /* handle bad length */ -+ len = 0; -+ while (*++text) { -+ if (!isdigit(*text)) return -1; /* non-digit in length */ -+ if (len >= pos*4) return -1; /* too long */ -+ len = len*10+*text-'0'; -+ } -+ if (len > 7 && addr->sas_addr.prv[0] != ATM_AFI_E164) offset = 72; -+ if (len < offset) return FATAL; -+ return len > pos*4 ? TRY_OTHER : len; -+} -+ -+ -+static int try_nsap(const char *text,struct sockaddr_atmsvc *addr,int flags) -+{ -+ int result; -+ -+ result = do_try_nsap(text,addr,flags); -+ if (result < 0) return result; -+ addr->sas_family = AF_ATMSVC; -+ *addr->sas_addr.pub = 0; -+ return result; -+} -+ -+ -+static int try_e164(const char *text,struct sockaddr_atmsvc *addr,int flags) -+{ -+ int i,dot,result; -+ -+ if (*text == ':' || *text == '+') text++; -+ for (i = dot = 0; *text; text++) -+ if (isdigit(*text)) { -+ if (i == ATM_E164_LEN) return TRY_OTHER; /* too long */ -+ addr->sas_addr.pub[i++] = *text; -+ dot = 1; -+ } -+ else if (*text != '.') break; -+ else { -+ if (!dot) return TRY_OTHER; /* two dots in a row */ -+ dot = 0; -+ } -+ if (!dot) return TRY_OTHER; -+ addr->sas_addr.pub[i] = 0; -+ *addr->sas_addr.prv = 0; -+ result = 0; -+ if (*text) { -+ if (*text++ != '+') return TRY_OTHER; -+ else { -+ result = do_try_nsap(text,addr,flags); -+ if (result < 0) return FATAL; -+ } -+ } -+ addr->sas_family = AF_ATMSVC; -+ return result; -+} -+ -+ -+static int search(FILE *file,const char *text,struct sockaddr *addr,int length, -+ int flags) -+{ -+ char line[MAX_ATM_NAME_LEN+1]; -+ const char *here; -+ int result; -+ -+ while (fgets(line,MAX_ATM_NAME_LEN,file)) { -+ if (!strtok(line,"\t\n ")) continue; -+ while ((here = strtok(NULL,"\t\n "))) -+ if (!strcasecmp(here,text)) { -+ here = strtok(line,"\t\n "); -+ result = text2atm(here,addr,length,flags); -+ if (result >= 0) return result; -+ } -+ } -+ return TRY_OTHER; -+} -+ -+ -+static int try_name(const char *text,struct sockaddr *addr,int length, -+ int flags) -+{ -+ FILE *file; -+ int result; -+ -+ if (!(file = fopen(HOSTS_ATM,"r"))) return TRY_OTHER; -+ result = search(file,text,addr,length,flags); -+ (void) fclose(file); -+ return result; -+} -+ -+ -+int text2atm(const char *text,struct sockaddr *addr,int length,int flags) -+{ -+ int result; -+ -+ if (!*text) return -1; -+ if (!(flags & (T2A_PVC | T2A_SVC))) flags |= T2A_PVC | T2A_SVC; -+ if (length < sizeof(struct sockaddr_atmpvc)) return -1; -+ if (flags & T2A_PVC) { -+ result = try_pvc(text,(struct sockaddr_atmpvc *) addr,flags); -+ if (result != TRY_OTHER) return result; -+ } -+ if ((flags & T2A_SVC) && length >= sizeof(struct sockaddr_atmsvc)) { -+ result = try_nsap(text,(struct sockaddr_atmsvc *) addr,flags); -+ if (result != TRY_OTHER) return result; -+ result = try_e164(text,(struct sockaddr_atmsvc *) addr,flags); -+ if (result != TRY_OTHER) return result; -+ } -+ if (!(flags & T2A_NAME)) return -1; -+ result = try_name(text,addr,length,flags & ~T2A_NAME); -+ if (result == TRY_OTHER && !(flags & T2A_LOCAL)) -+ result = ans_byname(text,(struct sockaddr_atmsvc *) addr,length,flags); -+ if (result != TRY_OTHER) return result; -+ return -1; -+} ---- ppp-2.4.2/pppd/plugins/pppoatm/text2qos.c.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/text2qos.c 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,180 @@ -+/* text2qos.c - Converts textual representation of QOS parameters to binary -+ encoding */ -+ -+/* Written 1996-2000 by Werner Almesberger, EPFL-LRC/ICA */ -+ -+#if HAVE_CONFIG_H -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "atm.h" -+ -+ -+#define fetch __atmlib_fetch -+ -+ -+#define RATE_ERROR -2 -+ -+ -+int __t2q_get_rate(const char **text,int up) -+{ -+ const char mult[] = "kKmMgGg"; -+ const char *multiplier; -+ char *end; -+ unsigned int rate,fract; -+ int power; -+ -+ if (!strncmp(*text,"max",3)) { -+ *text += 3; -+ return ATM_MAX_PCR; -+ } -+ rate = strtoul(*text,&end,10); -+ power = fract = 0; -+ if (*end == '.') -+ for (end++; *end && isdigit(*end); end++) { -+ fract = fract*10+*end-48; -+ if (--power == -9) break; -+ } -+ multiplier = NULL; -+ if (*end && (multiplier = strchr(mult,*end))) { -+ while (multiplier >= mult) { -+ if (rate > UINT_MAX/1000) return RATE_ERROR; -+ rate *= 1000; -+ power += 3; -+ multiplier -= 2; -+ } -+ end++; -+ } -+ while (power && fract) -+ if (power < 0) { -+ fract /= 10; -+ power++; -+ } -+ else { -+ fract *= 10; -+ power--; -+ } -+ rate += fract; -+ if (strlen(end) < 3) { -+ if (multiplier) return RATE_ERROR; -+ } -+ else if (!strncmp(end,"cps",3)) end += 3; -+ else if (!strncmp(end,"bps",3)) { -+ rate = (rate+(up ? 8*ATM_CELL_PAYLOAD-1 : 0))/8/ -+ ATM_CELL_PAYLOAD; -+ end += 3; -+ } -+ else if (multiplier) return RATE_ERROR; -+ if (rate > INT_MAX) return RATE_ERROR; -+ *text = end; -+ return rate; -+} -+ -+ -+static int params(const char **text,struct atm_trafprm *a, -+ struct atm_trafprm *b) -+{ -+ int value; -+ char *end; -+ -+ if (*(*text)++ != ':') return -1; -+ while (1) { -+ if (!**text) return -1; -+ switch (fetch(text,"max_pcr=","pcr=","min_pcr=","max_sdu=","sdu=", -+ NULL)) { -+ case 0: -+ if ((value = __t2q_get_rate(text,0)) == RATE_ERROR) return -1; -+ if (a) a->max_pcr = value; -+ if (b) b->max_pcr = value; -+ break; -+ case 1: -+ if ((value = __t2q_get_rate(text,0)) == RATE_ERROR) return -1; -+ if (a) a->pcr = value; -+ if (b) b->pcr = value; -+ break; -+ case 2: -+ if ((value = __t2q_get_rate(text,1)) == RATE_ERROR) return -1; -+ if (value == ATM_MAX_PCR) return -1; -+ if (a) a->min_pcr = value; -+ if (b) b->min_pcr = value; -+ break; -+ case 3: -+ case 4: -+ value = strtol(*text,&end,10); -+ if (value < 0) return -1; -+ *text = end; -+ if (a) a->max_sdu = value; -+ if (b) b->max_sdu = value; -+ break; -+ default: -+ return 0; -+ } -+ if (!**text) break; -+ if (*(*text)++ != ',') return -1; -+ } -+ return 0; -+} -+ -+ -+int text2qos(const char *text,struct atm_qos *qos,int flags) -+{ -+ int traffic_class,aal; -+ -+ traffic_class = ATM_NONE; -+ aal = ATM_NO_AAL; -+ do { -+ static const unsigned char aal_number[] = { ATM_AAL0, ATM_AAL5 }; -+ int item; -+ -+ item = fetch(&text,"!none","ubr","cbr","vbr","abr","aal0","aal5",NULL); -+ switch (item) { -+ case 1: -+ case 2: -+ /* we don't support VBR yet */ -+ case 4: -+ traffic_class = item; -+ break; -+ case 5: -+ case 6: -+ aal = aal_number[item-5]; -+ break; -+ default: -+ return -1; -+ } -+ } -+ while (*text == ',' ? text++ : 0); -+ if (!traffic_class) return -1; -+ if (qos && !(flags & T2Q_DEFAULTS)) memset(qos,0,sizeof(*qos)); -+ if (qos) qos->txtp.traffic_class = qos->rxtp.traffic_class = traffic_class; -+ if (qos && aal) qos->aal = aal; -+ if (!*text) return 0; -+ if (params(&text,qos ? &qos->txtp : NULL,qos ? &qos->rxtp : NULL)) -+ return -1; -+ if (!*text) return 0; -+ switch (fetch(&text,"tx","rx",NULL)) { -+ case 0: -+ if (!fetch(&text,":none",NULL)) { -+ if (qos) qos->txtp.traffic_class = ATM_NONE; -+ if (*text == ',') text++; -+ break; -+ } -+ if (params(&text,qos ? &qos->txtp : NULL,NULL)) return -1; -+ break; -+ case 1: -+ text -= 2; -+ break; -+ default: -+ return -1; -+ } -+ if (!*text) return 0; -+ if (fetch(&text,"rx",NULL)) return -1; -+ if (!fetch(&text,":none",NULL) && qos) qos->rxtp.traffic_class = ATM_NONE; -+ else if (params(&text,qos ? &qos->rxtp : NULL,NULL)) return -1; -+ return *text ? -1 : 0; -+} ---- ppp-2.4.2/pppd/plugins/pppoatm/atm.h.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/atm.h 2004-10-05 17:25:10.825900992 +0100 -@@ -0,0 +1,108 @@ -+/* atm.h - Functions useful for ATM applications */ -+ -+/* Written 1995-2000 by Werner Almesberger, EPFL-LRC/ICA */ -+ -+ -+#ifndef _ATM_H -+#define _ATM_H -+ -+#include -+#include -+#include -+ -+ -+/* -+ * For versions of glibc < 2.1 -+ */ -+ -+#ifndef AF_ATMPVC -+#define AF_ATMPVC 8 -+#endif -+ -+#ifndef AF_ATMSVC -+#define AF_ATMSVC 20 -+#endif -+ -+#ifndef PF_ATMPVC -+#define PF_ATMPVC AF_ATMPVC -+#endif -+ -+#ifndef PF_ATMSVC -+#define PF_ATMSVC AF_ATMSVC -+#endif -+ -+#ifndef SOL_ATM -+#define SOL_ATM 264 -+#endif -+ -+#ifndef SOL_AAL -+#define SOL_AAL 265 -+#endif -+ -+ -+#define HOSTS_ATM "/etc/hosts.atm" -+ -+/* text2atm flags */ -+#define T2A_PVC 1 /* address is PVC */ -+#define T2A_SVC 2 /* address is SVC */ -+#define T2A_UNSPEC 4 /* allow unspecified parts in PVC address */ -+#define T2A_WILDCARD 8 /* allow wildcards in PVC or SVC address */ -+#define T2A_NNI 16 /* allow NNI VPI range (PVC) */ -+#define T2A_NAME 32 /* allow name resolution */ -+#define T2A_REMOTE 64 /* OBSOLETE */ -+#define T2A_LOCAL 128 /* don't use ANS */ -+ -+/* atm2text flags */ -+#define A2T_PRETTY 1 /* add syntactic sugar */ -+#define A2T_NAME 2 /* attempt name lookup */ -+#define A2T_REMOTE 4 /* OBSOLETE */ -+#define A2T_LOCAL 8 /* don't use ANS */ -+ -+/* atm_equal flags */ -+#define AXE_WILDCARD 1 /* allow wildcard match */ -+#define AXE_PRVOPT 2 /* private part of SVC address is optional */ -+ -+/* text2qos flags */ -+#define T2Q_DEFAULTS 1 /* structure contains default values */ -+ -+/* text2sap flags */ -+#define T2S_NAME 1 /* attempt name lookup */ -+#define T2S_LOCAL 2 /* we may support NIS or such in the future */ -+ -+/* sap2text flags */ -+#define S2T_NAME 1 /* attempt name lookup */ -+#define S2T_LOCAL 2 /* we may support NIS or such in the future */ -+ -+/* sap_equal flags */ -+#define SXE_COMPATIBLE 1 /* check for compatibility instead of identity*/ -+#define SXE_NEGOTIATION 2 /* allow negotiation; requires SXE_COMPATIBLE; -+ assumes "a" defines the available -+ capabilities */ -+#define SXE_RESULT 4 /* return selected SAP */ -+ -+#define MAX_ATM_ADDR_LEN (2*ATM_ESA_LEN+ATM_E164_LEN+5) -+ /* 4 dots, 1 plus */ -+#define MAX_ATM_NAME_LEN 256 /* wild guess */ -+#define MAX_ATM_QOS_LEN 116 /* 5+4+2*(3+3*(7+9)+2)+1 */ -+#define MAX_ATM_SAP_LEN 255 /* BHLI(27)+1+3*BLLI(L2=33,L3=41,+1)+2 */ -+ -+ -+int text2atm(const char *text,struct sockaddr *addr,int length,int flags); -+int atm2text(char *buffer,int length,const struct sockaddr *addr,int flags); -+int atm_equal(const struct sockaddr *a,const struct sockaddr *b,int len, -+ int flags); -+ -+int sdu2cell(int s,int sizes,const int *sdu_size,int *num_sdu); -+ -+int text2qos(const char *text,struct atm_qos *qos,int flags); -+int qos2text(char *buffer,int length,const struct atm_qos *qos,int flags); -+int qos_equal(const struct atm_qos *a,const struct atm_qos *b); -+ -+int text2sap(const char *text,struct atm_sap *sap,int flags); -+int sap2text(char *buffer,int length,const struct atm_sap *sap,int flags); -+int sap_equal(const struct atm_sap *a,const struct atm_sap *b,int flags,...); -+ -+int __t2q_get_rate(const char **text,int up); -+int __atmlib_fetch(const char **pos,...); /* internal use only */ -+ -+#endif ---- ppp-2.4.2/pppd/plugins/pppoatm/pppoatm.c.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/pppoatm.c 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,224 @@ -+/* pppoatm.c - pppd plugin to implement PPPoATM protocol. -+ * -+ * Copyright 2000 Mitchell Blank Jr. -+ * Based in part on work from Jens Axboe and Paul Mackerras. -+ * Updated to ppp-2.4.1 by Bernhard Kaindl -+ * -+ * Updated to ppp-2.4.2 by David Woodhouse 2004. -+ * - disconnect method added -+ * - remove_options() abuse removed. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+#include -+#include -+#include -+#include "pppd.h" -+#include "pathnames.h" -+#include "fsm.h" /* Needed for lcp.h to include cleanly */ -+#include "lcp.h" -+#include -+#include -+#include -+#include -+#include -+#include -+ -+const char pppd_version[] = VERSION; -+ -+static struct sockaddr_atmpvc pvcaddr; -+static char *qosstr = NULL; -+static bool llc_encaps = 0; -+static bool vc_encaps = 0; -+static int device_got_set = 0; -+static int pppoatm_max_mtu, pppoatm_max_mru; -+static int setdevname_pppoatm(const char *cp, const char **argv, int doit); -+struct channel pppoa_channel; -+static int pppoa_fd = -1; -+ -+static option_t pppoa_options[] = { -+ { "device name", o_wild, (void *) &setdevname_pppoatm, -+ "ATM service provider IDs: VPI.VCI", -+ OPT_DEVNAM | OPT_PRIVFIX | OPT_NOARG | OPT_A2STRVAL | OPT_STATIC, -+ devnam}, -+ { "llc-encaps", o_bool, &llc_encaps, -+ "use LLC encapsulation for PPPoATM", 1}, -+ { "vc-encaps", o_bool, &vc_encaps, -+ "use VC multiplexing for PPPoATM (default)", 1}, -+ { "qos", o_string, &qosstr, -+ "set QoS for PPPoATM connection", 1}, -+ { NULL } -+}; -+ -+/* returns: -+ * -1 if there's a problem with setting the device -+ * 0 if we can't parse "cp" as a valid name of a device -+ * 1 if "cp" is a reasonable thing to name a device -+ * Note that we don't actually open the device at this point -+ * We do need to fill in: -+ * devnam: a string representation of the device -+ * devstat: a stat structure of the device. In this case -+ * we're not opening a device, so we just make sure -+ * to set up S_ISCHR(devstat.st_mode) != 1, so we -+ * don't get confused that we're on stdin. -+ */ -+int (*old_setdevname_hook)(const char* cp) = NULL; -+static int setdevname_pppoatm(const char *cp, const char **argv, int doit) -+{ -+ struct sockaddr_atmpvc addr; -+ extern struct stat devstat; -+ if (device_got_set) -+ return 0; -+ //info("PPPoATM setdevname_pppoatm: '%s'", cp); -+ memset(&addr, 0, sizeof addr); -+ if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr), -+ T2A_PVC | T2A_NAME) < 0) { -+ if(doit) -+ info("atm does not recognize: %s", cp); -+ return 0; -+ } -+ if (!doit) return 1; -+ //if (!dev_set_ok()) return -1; -+ memcpy(&pvcaddr, &addr, sizeof pvcaddr); -+ strlcpy(devnam, cp, sizeof devnam); -+ devstat.st_mode = S_IFSOCK; -+ if (the_channel != &pppoa_channel) { -+ the_channel = &pppoa_channel; -+ lcp_wantoptions[0].neg_accompression = 0; -+ lcp_allowoptions[0].neg_accompression = 0; -+ lcp_wantoptions[0].neg_asyncmap = 0; -+ lcp_allowoptions[0].neg_asyncmap = 0; -+ lcp_wantoptions[0].neg_pcompression = 0; -+ } -+ info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp); -+ device_got_set = 1; -+ return 1; -+} -+ -+#define pppoatm_overhead() (llc_encaps ? 6 : 2) -+ -+static void no_device_given_pppoatm(void) -+{ -+ fatal("No vpi.vci specified"); -+} -+ -+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; -+ else if (!vc_encaps) -+ be.encaps = PPPOATM_ENCAPS_LLC; -+ else -+ be.encaps = PPPOATM_ENCAPS_AUTODETECT; -+ if (ioctl(fd, ATM_SETBACKEND, &be) < 0) -+ fatal("ioctl(ATM_SETBACKEND): %m"); -+} -+ -+#if 0 -+static void reset_line_discipline_pppoatm(int fd) -+{ -+ atm_backend_t be = ATM_BACKEND_RAW; -+ /* 2.4 doesn't support this yet */ -+ (void) ioctl(fd, ATM_SETBACKEND, &be); -+} -+#endif -+ -+static int connect_pppoatm(void) -+{ -+ int fd; -+ struct atm_qos qos; -+ -+ system ("/sbin/modprobe pppoatm"); -+ -+ if (!device_got_set) -+ no_device_given_pppoatm(); -+ fd = socket(AF_ATMPVC, SOCK_DGRAM, 0); -+ if (fd < 0) -+ fatal("failed to create socket: %m"); -+ memset(&qos, 0, sizeof qos); -+ qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_UBR; -+ /* TODO: support simplified QoS setting */ -+ if (qosstr != NULL) -+ if (text2qos(qosstr, &qos, 0)) -+ fatal("Can't parse QoS: \"%s\""); -+ qos.txtp.max_sdu = lcp_allowoptions[0].mru + pppoatm_overhead(); -+ qos.rxtp.max_sdu = lcp_wantoptions[0].mru + pppoatm_overhead(); -+ qos.aal = ATM_AAL5; -+ if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) -+ fatal("setsockopt(SO_ATMQOS): %m"); -+ /* TODO: accept on SVCs... */ -+ if (connect(fd, (struct sockaddr *) &pvcaddr, -+ sizeof(struct sockaddr_atmpvc))) -+ fatal("connect(%s): %m", devnam); -+ pppoatm_max_mtu = lcp_allowoptions[0].mru; -+ pppoatm_max_mru = lcp_wantoptions[0].mru; -+ set_line_discipline_pppoatm(fd); -+ strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); -+ pppoa_fd = fd; -+ return fd; -+} -+ -+static void disconnect_pppoatm(void) -+{ -+ close(pppoa_fd); -+} -+ -+static void send_config_pppoa(int mtu, -+ u_int32_t asyncmap, -+ int pcomp, -+ int accomp) -+{ -+ int sock; -+ struct ifreq ifr; -+ if (mtu > pppoatm_max_mtu) -+ error("Couldn't increase MTU to %d", mtu); -+ sock = socket(AF_INET, SOCK_DGRAM, 0); -+ if (sock < 0) -+ fatal("Couldn't create IP socket: %m"); -+ strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); -+ ifr.ifr_mtu = mtu; -+ if (ioctl(sock, SIOCSIFMTU, (caddr_t) &ifr) < 0) -+ fatal("ioctl(SIOCSIFMTU): %m"); -+ (void) close (sock); -+} -+ -+static void recv_config_pppoa(int mru, -+ u_int32_t asyncmap, -+ int pcomp, -+ int accomp) -+{ -+ if (mru > pppoatm_max_mru) -+ error("Couldn't increase MRU to %d", mru); -+} -+ -+void plugin_init(void) -+{ -+#if defined(__linux__) -+ extern int new_style_driver; /* From sys-linux.c */ -+ if (!ppp_available() && !new_style_driver) -+ fatal("Kernel doesn't support ppp_generic - " -+ "needed for PPPoATM"); -+#else -+ fatal("No PPPoATM support on this OS"); -+#endif -+ info("PPPoATM plugin_init"); -+ add_options(pppoa_options); -+} -+struct channel pppoa_channel = { -+ options: pppoa_options, -+ process_extra_options: NULL, -+ check_options: NULL, -+ connect: &connect_pppoatm, -+ disconnect: &disconnect_pppoatm, -+ establish_ppp: &generic_establish_ppp, -+ disestablish_ppp: &generic_disestablish_ppp, -+ send_config: &send_config_pppoa, -+ recv_config: &recv_config_pppoa, -+ close: NULL, -+ cleanup: NULL -+}; ---- ppp-2.4.2/pppd/plugins/pppoatm/atmsap.h.atm1 2004-10-05 17:35:56.772702152 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/atmsap.h 2004-10-05 17:25:10.826900840 +0100 -@@ -0,0 +1,45 @@ -+/* atmsap.h - ATM Service Access Point addressing definitions */ -+ -+/* Written 1996-1998 by Werner Almesberger, EPFL LRC/ICA */ -+ -+ -+#ifndef _ATMSAP_H -+#define _ATMSAP_H -+ -+#include -+#include -+ -+ -+/* -+ * Selected ISO/IEC TR 9577 Network Layer Protocol Identifiers (NLPID) -+ */ -+ -+#define NLPID_IEEE802_1_SNAP 0x80 /* IEEE 802.1 SNAP */ -+ -+/* -+ * Selected Organizationally Unique Identifiers (OUIs) -+ */ -+ -+#define ATM_FORUM_OUI "\x00\xA0\x3E" /* ATM Forum */ -+#define EPFL_OUI "\x00\x60\xD7" /* EPF Lausanne, CH */ -+ -+/* -+ * Selected vendor-specific application identifiers (for B-HLI). Such an -+ * identifier consists of three bytes containing the OUI, followed by four -+ * bytes assigned by the organization owning the OUI. -+ */ -+ -+#define ANS_HLT_VS_ID ATM_FORUM_OUI "\x00\x00\x00\x01" -+ /* ATM Name System, af-saa-0069.000 */ -+#define VOD_HLT_VS_ID ATM_FORUM_OUI "\x00\x00\x00\x02" -+ /* VoD, af-saa-0049.001 */ -+#define AREQUIPA_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x01" /* Arequipa */ -+#define TTCP_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x03" /* ttcp_atm */ -+ -+ -+/* Mapping of "well-known" TCP, UDP, etc. port numbers to ATM BHLIs. -+ btd-saa-api-bhli-01.02 */ -+ -+void atm_tcpip_port_mapping(char *vs_id,uint8_t protocol,uint16_t port); -+ -+#endif ---- ppp-2.4.2/pppd/plugins/pppoatm/atmres.h.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/atmres.h 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,36 @@ -+/* atmres.h - Common definitions and prototypes for resolver functions */ -+ -+/* Written 1996,1998 by Werner Almesberger, EPFL-LRC/ICA */ -+ -+ -+#ifndef _ATMRES_H -+#define _ATMRES_H -+ -+#include -+#include -+ -+ -+/* Some #defines that may be needed if ANS isn't installed on that system */ -+ -+#ifndef T_ATMA -+#define T_ATMA 34 -+#endif -+#ifndef ATMA_AESA -+#define ATMA_AESA 0 -+#endif -+#ifndef ATMA_E164 -+#define ATMA_E164 1 -+#endif -+ -+/* Return codes for text2atm and atm2text */ -+ -+#define TRY_OTHER -2 -+#define FATAL -1 /* must be -1 */ -+ -+ -+int ans_byname(const char *text,struct sockaddr_atmsvc *addr,int length, -+ int flags); -+int ans_byaddr(char *buffer,int length,const struct sockaddr_atmsvc *addr, -+ int flags); -+ -+#endif ---- ppp-2.4.2/pppd/plugins/pppoatm/misc.c.atm1 2004-10-04 12:11:55.000000000 +0100 -+++ ppp-2.4.2/pppd/plugins/pppoatm/misc.c 2004-10-04 12:11:55.000000000 +0100 -@@ -0,0 +1,51 @@ -+/* misc.c - Miscellaneous library functions */ -+ -+/* Written 1997-2000 by Werner Almesberger, EPFL-ICA/ICA */ -+ -+#if HAVE_CONFIG_H -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+#include /* for htons */ -+ -+#include -+#include -+ -+ -+int __atmlib_fetch(const char **pos,...) -+{ -+ const char *value; -+ int ref_len,best_len,len; -+ int i,best; -+ va_list ap; -+ -+ va_start(ap,pos); -+ ref_len = strlen(*pos); -+ best_len = 0; -+ best = -1; -+ for (i = 0; (value = va_arg(ap,const char *)); i++) { -+ len = strlen(value); -+ if (*value != '!' && len <= ref_len && len > best_len && -+ !strncasecmp(*pos,value,len)) { -+ best = i; -+ best_len = len; -+ } -+ } -+ va_end(ap); -+ if (best > -1) (*pos) += best_len; -+ return best; -+} -+ -+ -+void atm_tcpip_port_mapping(char *vs_id,uint8_t protocol,uint16_t port) -+{ -+ memcpy(vs_id,ATM_FORUM_OUI "\x01",4); -+ vs_id[4] = protocol; /* e.g. IP_TCP or IP_UDP; from netinet/protocols.h */ -+ vs_id[5] = (htons(port) >> 8) & 255; -+ vs_id[6] = htons(port) & 255; -+} diff --git a/ppp-2.4.2-signal.patch b/ppp-2.4.2-signal.patch deleted file mode 100644 index c6d79f8..0000000 --- a/ppp-2.4.2-signal.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ppp-2.4.2/pppd/main.c.signal 2004-01-13 05:00:34.000000000 +0100 -+++ ppp-2.4.2/pppd/main.c 2004-08-06 11:35:59.968454227 +0200 -@@ -1338,8 +1338,8 @@ - - act.sa_handler = SIG_IGN; - act.sa_flags = 0; -- sigaction(sig, &act, &oldact); - kill(0, sig); -+ sigaction(sig, &act, &oldact); - sigaction(sig, &oldact, NULL); - } - diff --git a/ppp-2.4.3-fix.patch b/ppp-2.4.3-fix.patch index 85a946c..3df6db1 100644 --- a/ppp-2.4.3-fix.patch +++ b/ppp-2.4.3-fix.patch @@ -1,14 +1,14 @@ --- ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c.fix 2004-11-04 11:07:37.000000000 +0100 +++ ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c 2004-11-22 16:00:24.522462124 +0100 @@ -13,6 +13,8 @@ - #include "pppoe.h" + #include "pppd/pppd.h" +void warn __P((char *, ...)); /* log a warning message */ + - #ifdef HAVE_SYSLOG_H - #include - #endif + #include + #include + #include --- ppp-2.4.3/pppd/ipv6cp.c.fix 2004-11-13 03:28:15.000000000 +0100 +++ ppp-2.4.3/pppd/ipv6cp.c 2004-11-22 16:00:27.049114044 +0100 @@ -151,6 +151,7 @@ @@ -30,30 +30,6 @@ /* * ipv6_check_options - check that any IP-related options are OK, * and assign appropriate defaults. ---- ppp-2.4.3/include/linux/if_pppox.h.fix 2001-12-15 01:34:24.000000000 +0100 -+++ ppp-2.4.3/include/linux/if_pppox.h 2004-11-22 16:00:27.049114044 +0100 -@@ -18,7 +18,7 @@ - - - #include --#include -+#include - - #ifdef __KERNEL__ - #include -@@ -97,10 +97,10 @@ - #define PTT_GEN_ERR __constant_htons(0x0203) - - struct pppoe_hdr { --#if defined(__LITTLE_ENDIAN_BITFIELD) -+#if __BYTE_ORDER == __LITTLE_ENDIAN - __u8 ver : 4; - __u8 type : 4; --#elif defined(__BIG_ENDIAN_BITFIELD) -+#elif __BYTE_ORDER == __BIG_ENDIAN - __u8 type : 4; - __u8 ver : 4; - #else --- ppp-2.4.3/pppdump/deflate.c.fix 2004-02-02 04:36:46.000000000 +0100 +++ ppp-2.4.3/pppdump/deflate.c 2004-11-22 16:02:18.071820020 +0100 @@ -39,6 +39,7 @@ diff --git a/ppp-2.4.3-fix64.patch b/ppp-2.4.3-fix64.patch index 96aee82..8a2c794 100644 --- a/ppp-2.4.3-fix64.patch +++ b/ppp-2.4.3-fix64.patch @@ -5,6 +5,6 @@ #include #include /* htonl() */ +#include /* u_int32_t */ + #include #include "sha1.h" - static void diff --git a/ppp-2.4.3-make.patch b/ppp-2.4.3-make.patch index 737956a..4716ac1 100644 --- a/ppp-2.4.3-make.patch +++ b/ppp-2.4.3-make.patch @@ -28,7 +28,7 @@ --- ppp-2.4.3/pppd/plugins/Makefile.linux.make 2004-11-14 08:57:35.000000000 +0100 +++ ppp-2.4.3/pppd/plugins/Makefile.linux 2004-11-22 15:46:49.873309203 +0100 @@ -1,5 +1,5 @@ - CC = gcc + #CC = gcc -COPTS = -O2 -g +COPTS = $(RPM_OPT_FLAGS) CFLAGS = $(COPTS) -I.. -I../../include -fPIC @@ -47,13 +47,13 @@ # MS-CHAP authentication protocol. --- ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux.make 2004-11-14 08:58:37.000000000 +0100 +++ ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux 2004-11-22 15:46:49.875308929 +0100 -@@ -24,7 +24,7 @@ +@@ -25,7 +25,7 @@ # Version is set ONLY IN THE MAKEFILE! Don't delete this! - VERSION=3.3 + RP_VERSION=3.8p -COPTS=-O2 -g +COPTS=$(RPM_OPT_FLAGS) - CFLAGS=$(COPTS) -I../../../include/linux + CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"' all: rp-pppoe.so pppoe-discovery --- ppp-2.4.3/pppdump/Makefile.linux.make 2004-10-31 02:36:52.000000000 +0200 diff --git a/ppp-2.4.4-bogus_dns_addr.patch b/ppp-2.4.4-bogus_dns_addr.patch deleted file mode 100644 index 4af8d7e..0000000 --- a/ppp-2.4.4-bogus_dns_addr.patch +++ /dev/null @@ -1,104 +0,0 @@ -diff -up ppp-2.4.4/pppd/ipcp.c.bogus_dns_addr ppp-2.4.4/pppd/ipcp.c ---- ppp-2.4.4/pppd/ipcp.c.bogus_dns_addr 2005-08-26 01:59:34.000000000 +0200 -+++ ppp-2.4.4/pppd/ipcp.c 2008-12-11 12:39:05.000000000 +0100 -@@ -715,7 +715,8 @@ ipcp_cilen(f) - #define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) - #define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) - #define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) --#define LENCIDNS(neg) (neg ? (CILEN_ADDR) : 0) -+#define LENCIDNS(neg) LENCIADDR(neg) -+#define LENCIWINS(neg) LENCIADDR(neg) - - /* - * First see if we want to change our options to the old -@@ -737,7 +738,9 @@ ipcp_cilen(f) - LENCIVJ(go->neg_vj, go->old_vj) + - LENCIADDR(go->neg_addr) + - LENCIDNS(go->req_dns1) + -- LENCIDNS(go->req_dns2)) ; -+ LENCIDNS(go->req_dns2) + -+ LENCIWINS(go->winsaddr[0]) + -+ LENCIWINS(go->winsaddr[1])) ; - } - - -@@ -810,6 +813,19 @@ ipcp_addci(f, ucp, lenp) - } else \ - neg = 0; \ - } -+ -+#define ADDCIWINS(opt, addr) \ -+ if (addr) { \ -+ if (len >= CILEN_ADDR) { \ -+ u_int32_t l; \ -+ PUTCHAR(opt, ucp); \ -+ PUTCHAR(CILEN_ADDR, ucp); \ -+ l = ntohl(addr); \ -+ PUTLONG(l, ucp); \ -+ len -= CILEN_ADDR; \ -+ } else \ -+ addr = 0; \ -+ } - - ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); -@@ -823,6 +839,10 @@ ipcp_addci(f, ucp, lenp) - - ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); - -+ ADDCIWINS(CI_MS_WINS1, go->winsaddr[0]); -+ -+ ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); -+ - *lenp -= len; - } - -@@ -1159,6 +1179,15 @@ ipcp_nakci(f, p, len, treat_as_reject) - try.neg_addr = 1; - no.neg_addr = 1; - break; -+ case CI_MS_WINS1: -+ case CI_MS_WINS2: -+ if (cilen != CILEN_ADDR) -+ goto bad; -+ GETLONG(l, p); -+ ciaddr1 = htonl(l); -+ if (ciaddr1) -+ try.winsaddr[citype == CI_MS_WINS2] = ciaddr1; -+ break; - } - p = next; - } -@@ -1275,6 +1304,21 @@ ipcp_rejci(f, p, len) - try.neg = 0; \ - } - -+#define REJCIWINS(opt, addr) \ -+ if (addr && \ -+ ((cilen = p[1]) == CILEN_ADDR) && \ -+ len >= cilen && \ -+ p[0] == opt) { \ -+ u_int32_t l; \ -+ len -= cilen; \ -+ INCPTR(2, p); \ -+ GETLONG(l, p); \ -+ cilong = htonl(l); \ -+ /* Check rejected value. */ \ -+ if (cilong != addr) \ -+ goto bad; \ -+ try.winsaddr[opt == CI_MS_WINS2] = 0; \ -+ } - - REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - go->ouraddr, go->hisaddr); -@@ -1288,6 +1332,10 @@ ipcp_rejci(f, p, len) - - REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); - -+ REJCIWINS(CI_MS_WINS1, go->winsaddr[0]); -+ -+ REJCIWINS(CI_MS_WINS2, go->winsaddr[1]); -+ - /* - * If there are any remaining CIs, then this packet is bad. - */ diff --git a/ppp-2.4.4-closelog.patch b/ppp-2.4.4-closelog.patch deleted file mode 100644 index 6866274..0000000 --- a/ppp-2.4.4-closelog.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up ppp-2.4.4/pppd/main.c.closelog ppp-2.4.4/pppd/main.c ---- ppp-2.4.4/pppd/main.c.closelog 2008-03-06 22:54:19.000000000 +0100 -+++ ppp-2.4.4/pppd/main.c 2008-03-06 22:54:31.000000000 +0100 -@@ -1567,6 +1567,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); -@@ -1575,7 +1577,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) diff --git a/ppp-2.4.4-lib64.patch b/ppp-2.4.4-lib64.patch index be154f1..a3a1cf6 100644 --- a/ppp-2.4.4-lib64.patch +++ b/ppp-2.4.4-lib64.patch @@ -26,7 +26,7 @@ #*********************************************************************** --DESTDIR = @DESTDIR@ +-DESTDIR = $(INSTROOT)@DESTDIR@ -LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) +DESTDIR = $(INSTROOT)@DESTDIR@ +LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) @@ -42,7 +42,7 @@ -LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) +LIBDIR = $(DESTDIR)/lib/$(shell $(CC) -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) - SUBDIRS := rp-pppoe pppoatm + SUBDIRS := rp-pppoe pppoatm pppol2tp # Uncomment the next line to include the radius authentication plugin --- ppp-2.4.4/pppd/Makefile.linux.lib64 2006-07-24 20:43:40.000000000 +0200 +++ ppp-2.4.4/pppd/Makefile.linux 2006-07-24 20:43:40.000000000 +0200 diff --git a/ppp-2.4.4-new_speeds.patch b/ppp-2.4.4-new_speeds.patch deleted file mode 100644 index 99816f7..0000000 --- a/ppp-2.4.4-new_speeds.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -up ppp-2.4.4/pppd/sys-linux.c.new_speeds ppp-2.4.4/pppd/sys-linux.c ---- ppp-2.4.4/pppd/sys-linux.c.new_speeds 2008-05-12 17:44:11.000000000 -0400 -+++ ppp-2.4.4/pppd/sys-linux.c 2008-05-12 17:50:51.000000000 -0400 -@@ -849,6 +849,30 @@ struct speed { - #ifdef B921600 - { 921600, B921600 }, - #endif -+#ifdef B1000000 -+ { 1000000, B1000000 }, -+#endif -+#ifdef B1152000 -+ { 1152000, B1152000 }, -+#endif -+#ifdef B1500000 -+ { 1500000, B1500000 }, -+#endif -+#ifdef B2000000 -+ { 2000000, B2000000 }, -+#endif -+#ifdef B2500000 -+ { 2500000, B2500000 }, -+#endif -+#ifdef B3000000 -+ { 3000000, B3000000 }, -+#endif -+#ifdef B3500000 -+ { 3500000, B3500000 }, -+#endif -+#ifdef B4000000 -+ { 4000000, B4000000 }, -+#endif - { 0, 0 } - }; - diff --git a/ppp-2.4.4-no_strip.patch b/ppp-2.4.4-no_strip.patch index 84962aa..20e21df 100644 --- a/ppp-2.4.4-no_strip.patch +++ b/ppp-2.4.4-no_strip.patch @@ -68,23 +68,9 @@ $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR) $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) ---- ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux.make.no_strip 2006-06-04 07:07:46.000000000 +0200 -+++ ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux.make 2006-07-19 14:29:41.000000000 +0200 -@@ -39,9 +39,9 @@ - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) -+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR) - $(INSTALL) -d -m 755 $(BINDIR) -- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR) -+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR) - - clean: - rm -f *.o *.so --- ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux.no_strip 2006-07-19 14:29:41.000000000 +0200 +++ ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux 2006-07-19 14:29:41.000000000 +0200 -@@ -39,9 +39,9 @@ +@@ -43,9 +43,9 @@ install: all $(INSTALL) -d -m 755 $(LIBDIR) @@ -95,7 +81,7 @@ + $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR) clean: - rm -f *.o *.so + rm -f *.o *.so pppoe-discovery --- ppp-2.4.4/pppd/Makefile.linux.lib64.no_strip 2006-07-19 14:29:41.000000000 +0200 +++ ppp-2.4.4/pppd/Makefile.linux.lib64 2006-07-19 14:29:41.000000000 +0200 @@ -99,7 +99,7 @@ diff --git a/ppp-2.4.4-response_len.patch b/ppp-2.4.4-response_len.patch deleted file mode 100644 index 27e082b..0000000 --- a/ppp-2.4.4-response_len.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ppp-2.4.4/pppd/chap_ms.c.response_len ppp-2.4.4/pppd/chap_ms.c ---- ppp-2.4.4/pppd/chap_ms.c.response_len 2008-03-06 23:07:18.000000000 +0100 -+++ ppp-2.4.4/pppd/chap_ms.c 2008-03-06 23:07:49.000000000 +0100 -@@ -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) diff --git a/ppp.spec b/ppp.spec index c753e7a..2b42ca9 100644 --- a/ppp.spec +++ b/ppp.spec @@ -1,7 +1,7 @@ Summary: The PPP (Point-to-Point Protocol) daemon. Name: ppp -Version: 2.4.4 -Release: 13%{?dist} +Version: 2.4.5 +Release: 1%{?dist} License: BSD and LGPLv2+ and GPLv2+ and Public Domain Group: System Environment/Daemons Source0: ftp://ftp.samba.org/pub/ppp/ppp-%{version}.tar.gz @@ -17,17 +17,12 @@ Patch8: ppp-2.4.3-fix.patch Patch9: ppp-2.4.3-fix64.patch Patch11: ppp-2.4.2-change_resolv_conf.patch Patch13: ppp-2.4.4-no_strip.patch -Patch16: ppp-2.4.2-pppoatm-mtu.patch Patch17: ppp-2.4.2-pppoatm-make.patch Patch19: ppp-2.4.3-local.patch Patch20: ppp-2.4.3-ipv6-accept-remote.patch Patch21: ppp-2.4.3-usepeerdns-var_run_ppp_resolv.conf.patch Patch22: ppp-2.4.4-cbcp.patch Patch23: ppp-2.4.2-dontwriteetc.patch -Patch24: ppp-2.4.4-closelog.patch -Patch25: ppp-2.4.4-response_len.patch -Patch26: ppp-2.4.4-new_speeds.patch -Patch27: ppp-2.4.4-bogus_dns_addr.patch BuildRoot: %{_tmppath}/%{name}-root BuildPrereq: pam-devel, libpcap-devel @@ -61,17 +56,12 @@ This package contains the header files for building plugins for ppp. %patch9 -p1 -b .fix64 %patch11 -p1 -b .change_resolv_conf %patch13 -p1 -b .no_strip -%patch16 -p1 -b .atm-mtu %patch17 -p1 -b .atm-make %patch19 -p1 -b .local %patch20 -p1 -b .ipv6cp %patch21 -p1 -b .usepeerdns-var_run_ppp_resolv %patch22 -p1 -b .cbcp %patch23 -p1 -b .dontwriteetc -%patch24 -p1 -b .closelog -%patch25 -p1 -b .response_len -%patch26 -p1 -b .new_speeds -%patch27 -p1 -b .bogus_dns_addr rm -f scripts/*.local rm -f scripts/*.change_resolv_conf @@ -136,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT %doc PLUGINS %changelog +* Fri Dec 11 2009 Jiri Skala 2.4.5-1 +- re-base to latest upstream + * Wed Sep 16 2009 Tomas Mraz 2.4.4-13 - use password-auth common PAM configuration instead of system-auth diff --git a/sources b/sources index 649475a..86bf4d4 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -848f6c3cafeb6074ffeb293c3af79b7c ppp-2.4.3.tar.gz -183800762e266132218b204dfb428d29 ppp-2.4.4.tar.gz +4621bc56167b6953ec4071043fe0ec57 ppp-2.4.5.tar.gz