debian/0000755000000000000000000000000012013152663007165 5ustar debian/docs0000644000000000000000000000020611413427567010051 0ustar CONTRIB README README.NEXT TODO TODO.old docs/CONFIG docs/alt.dcom.slip-emulators.FAQ docs/slirp.doc Changes-1.0.17 debian/HOWTO-TEST debian/watch0000644000000000000000000000017611413427636010232 0ustar version=3 opts=uversionmangle=s/_patch//;s/_/./g http://sf.net/slirp/slirp-?_?([\w+\d+\.]+|\d+)(?:\.tar|\.tgz)(?:\.gz|\.bz2|) debian/HOWTO-TEST0000644000000000000000000001136311413427567010604 0ustar HOW TO TEST SLIRP ----------------- root@local:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1 root@local:~# pppd nodefaultroute noauth nobsdcomp nodetach debug :10.1.2.1 pty "ssh -t user@remote.machine.org slirp ppp" (if ssh asks you for a password, type it, or better, set up ssh so it allows you connecting without password, see ssh-keygen and authorized_keys in ssh manpages) (you can omit later "nodetach debug" when it works so it leaves you free the terminal) the output should be some like this: using channel 42 Using interface ppp0 Connect: ppp0 <--> /dev/pts/4 sent [LCP ConfReq id=0x1 ] Executing slirp-amd64 in chroot: /org/pergolesi.debian.org/chroot/sid_amd64_pure Slirp v1.0.17 (BETA) Copyright (c) 1995,1996 Danny Gasparovski and others. All rights reserved. This program is copyrighted, free software. Please read the file COPYRIGHT that came with the Slirp package for the terms and conditions of the copyright. IP address of Slirp host: 192.168.92.92 IP address of your DNS(s): 192.168.93.98, 192.168.96.93, 192.168.93.91 Your address is 10.0.2.15 (or anything else you want) Type five zeroes (0) to exit. [talking PPP, 115200 baud] SLiRP Ready ... rcvd [LCP ConfReq id=0x1 ] sent [LCP ConfAck id=0x1 ] rcvd [LCP ConfAck id=0x1 ] sent [LCP EchoReq id=0x0 magic=0xf74615a7] sent [CCP ConfReq id=0x1 ] sent [IPCP ConfReq id=0x1 ] rcvd [LCP EchoRep id=0x0 magic=0xc78771c2] rcvd [IPCP ConfReq id=0x1 ] sent [IPCP ConfNak id=0x1 ] rcvd [CCP ConfReq id=0x1] sent [CCP ConfAck id=0x1] rcvd [CCP ConfRej id=0x1 ] sent [CCP ConfReq id=0x2] rcvd [IPCP ConfNak id=0x1 ] sent [IPCP ConfReq id=0x2 ] rcvd [IPCP ConfReq id=0x2 ] sent [IPCP ConfAck id=0x2 ] rcvd [CCP ConfAck id=0x2] rcvd [IPCP ConfAck id=0x2 ] Cannot determine ethernet address for proxy ARP local IP address 10.0.2.15 remote IP address 10.1.2.1 Script /etc/ppp/ip-up started (pid 10418) Script /etc/ppp/ip-up finished (pid 10418), status = 0x0 in another terminal: root@local:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.1.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1 root@local:~# route add -host www.google.com dev ppp0 root@local:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.1.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 216.239.59.99 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1 note that www.google.com has more than one IP and you have put only one in your routing table: root@local:~# host www.google.com www.google.com is an alias for www.l.google.com. www.l.google.com has address 216.239.59.103 www.l.google.com has address 216.239.59.104 www.l.google.com has address 216.239.59.147 www.l.google.com has address 216.239.59.99 root@tordo:~# telnet 216.239.59.99 80 Trying 216.239.59.99... Connected to 216.239.59.99. Escape character is '^]'. GET / HTTP/1.0 <---- type this, and one ENTER Host: www.google.com <---- type this, and two ENTER HTTP/1.0 302 Found Location: http://www.google.de/ Cache-Control: private Set-Cookie: PREF=ID=91babd388241b148:TM=1187103593:LM=1187103593:S=HnEmAd_s3Kkdf2pV; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com Content-Type: text/html Server: GWS/2.1 Content-Length: 218 Date: Tue, 14 Aug 2007 14:59:53 GMT Connection: Keep-Alive 302 Moved

302 Moved

The document has moved here. Connection closed by foreign host. root@local:~# To end the link: You can just press ^C in the terminal pppd is running (when using nodetach) or else run "poff" or "killall pppd" Enjoy! debian/manpages0000644000000000000000000000004611413427567010716 0ustar src/slirp.man debian/slirp-fullbolt.1 debian/slirp-fullbolt.10000644000000000000000000000106511413427567012236 0ustar .TH SLIRP-FULLBOLT 1 .SH NAME slirp-fullbolt \- fast slirp for non interactive sessions .SH SYNOPSIS See .BR slirp (1) .SH DESCRIPTION slirp-fullbolt is a slirp configured to write to the tty as fast as it can. It should only be used if you are using load-balancing, slirp does a pretty good job on single modems already, and slirp-fullbolt will make interactive sessions less responsive. .SH AUTHOR .PP This manual page was written by Roberto Lumbreras , for the Debian GNU/Linux system (but may be used by others). .SH "SEE ALSO" .BR slirp (1) debian/README.Debian0000644000000000000000000000040611413427567011241 0ustar slirp for Debian ---------------- Please note that maybe your ISP really doesn't like you using slirp, because they want to charge more for a ppp connection, so use it at your own risk. -- Roberto Lumbreras , Fri, 12 Jul 2002 16:46:24 +0200 debian/source/0000755000000000000000000000000011414152142010461 5ustar debian/source/format0000644000000000000000000000001411413427757011707 0ustar 3.0 (quilt) debian/patches/0000755000000000000000000000000012013141217010605 5ustar debian/patches/002-fix-arguements.patch0000644000000000000000000000226411414153067015101 0ustar Author: Roberto Lumbreras Description: fix arguements spelling error --- slirp-1.0.17.old/ChangeLog 2004-09-07 05:03:53.000000000 +0200 +++ slirp-1.0.17/ChangeLog 2010-07-04 18:36:26.302051365 +0200 @@ -128,7 +128,7 @@ so, or if given an argument, every S seconds. - When load-balancing over multiple modems, you can now specify the password in the environmental variable SLIRP_PASSWORD, then give Slirp the - arguements "-l x,host:port,-". This is for systems where the password is + arguments "-l x,host:port,-". This is for systems where the password is still seen in a "ps x" even though Slirp tries to hide it, like Solaris. - Add some performance enhancments to the load-balancing code, which includes the addition of the "towrite_max N" option, and updated the --- slirp-1.0.17.old/src/main.c 2006-05-18 21:22:46.000000000 +0200 +++ slirp-1.0.17/src/main.c 2010-07-04 18:36:36.826051981 +0200 @@ -237,7 +237,7 @@ /* It's an internet socket */ if (sscanf(*argv, "%d,%[^:]:%d,%s", &unit, hn, &port, pwd) != 4) { - lprint("Error: bad arguements to -l\n"); + lprint("Error: bad arguments to -l\n"); slirp_exit(1); } if (strcmp(pwd, "-") == 0) { debian/patches/003-socklen_t.patch0000644000000000000000000000521711414153111014114 0ustar Author: Roberto Lumbreras Description: Use addrlen as socklen_t instead of int --- slirp-1.0.17.old/src/main.c 2010-07-04 18:39:03.870052173 +0200 +++ slirp-1.0.17/src/main.c 2010-07-04 19:03:25.122052376 +0200 @@ -990,10 +990,10 @@ char *device = dev; #ifndef NO_UNIX_SOCKETS struct sockaddr_un sock_un; - int sock_len = sizeof(struct sockaddr_un); + socklen_t sock_len = sizeof(struct sockaddr_un); #endif struct sockaddr_in sock_in; - int sock_len2 = sizeof(struct sockaddr_in); + socklen_t sock_len2 = sizeof(struct sockaddr_in); fd = -1; if (slirp_socket_passwd) --- slirp-1.0.17.old/src/misc.c 2004-09-07 04:03:10.000000000 +0200 +++ slirp-1.0.17/src/misc.c 2010-07-04 19:03:25.122052376 +0200 @@ -298,7 +298,7 @@ { int s; struct sockaddr_in addr; - int addrlen = sizeof(addr); + socklen_t addrlen = sizeof(addr); int opt; int master; char *argv[256]; --- slirp-1.0.17.old/src/socket.c 2004-09-01 09:36:44.000000000 +0200 +++ slirp-1.0.17/src/socket.c 2010-07-04 19:03:25.122052376 +0200 @@ -377,7 +377,7 @@ struct socket *so; { struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); DEBUG_CALL("sorecvfrom"); DEBUG_ARG("so = %lx", (long)so); @@ -530,7 +530,8 @@ { struct sockaddr_in addr; struct socket *so; - int s, addrlen = sizeof(addr), opt = 1; + int s, opt = 1; + socklen_t addrlen = sizeof(addr); DEBUG_CALL("solisten"); DEBUG_ARG("port = %d", port); --- slirp-1.0.17.old/src/tcp_subr.c 2004-09-07 04:25:10.000000000 +0200 +++ slirp-1.0.17/src/tcp_subr.c 2010-07-04 19:03:25.122052376 +0200 @@ -463,7 +463,7 @@ { struct socket *so; struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); struct tcpcb *tp; int s, opt; @@ -658,7 +658,7 @@ { struct socket *tmpso; struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); struct sbuf *so_rcv = &so->so_rcv; memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); --- slirp-1.0.17.old/src/udp.c 2004-09-01 09:36:44.000000000 +0200 +++ slirp-1.0.17/src/udp.c 2010-07-04 19:04:12.130051788 +0200 @@ -371,7 +371,7 @@ struct mbuf *m; { struct sockaddr_in addr; - int addrlen = sizeof(addr); + socklen_t addrlen = sizeof(addr); #ifdef EMULATE_TALK CTL_MSG_OLD *omsg; CTL_MSG *nmsg; @@ -596,7 +596,8 @@ { struct sockaddr_in addr; struct socket *so; - int addrlen = sizeof(struct sockaddr_in), opt = 1; + int opt = 1; + socklen_t addrlen = sizeof(struct sockaddr_in); if ((so = socreate()) == NULL) { free(so); debian/patches/005-use-snprintf.patch0000644000000000000000000001006711414153202014572 0ustar Author: Roberto Lumbreras Description: Use snprintf instead of sprintf --- slirp-1.0.17.old/src/main.c 2010-07-04 19:06:12.450054039 +0200 +++ slirp-1.0.17/src/main.c 2010-07-04 20:14:45.386052502 +0200 @@ -1029,7 +1029,7 @@ sleep(1); if (read(fd, buff, 256) < 0) { /* Nuke both connections */ - sprintf(buff, "0 Connection timed out"); + snprintf(buff, sizeof(buff), "0 Connection timed out"); write(fd, buff, strlen(buff)+1); slirp_socket_wait = curtime; close(fd); @@ -1041,7 +1041,7 @@ if (sscanf(buff, "%d %d %256s", &unit, &pid, device) == 3) { if (unit >= MAX_INTERFACES || unit < 0) { - sprintf(buff, "0 Unit out of range (must be between 0 and %d, inclusive)", MAX_INTERFACES-1); + snprintf(buff, sizeof(buff), "0 Unit out of range (must be between 0 and %d, inclusive)", MAX_INTERFACES-1); write(fd, buff, strlen(buff)+1); slirp_socket_wait = curtime; close(fd); @@ -1052,7 +1052,7 @@ * (pid is invalid) */ if (slirp_socket_passwd) { if (strcmp(slirp_socket_passwd, device) != 0) { - sprintf(buff, "0 Incorrect password"); + snprintf(buff, sizeof(buff), "0 Incorrect password"); write(fd, buff, strlen(buff)+1); slirp_socket_wait = curtime; close(fd); @@ -1076,7 +1076,7 @@ * failure, 1 for exit, and message is printed */ if (ttyp) { - sprintf(buff, "0 Unit already attached"); + snprintf(buff, sizeof(buff), "0 Unit already attached"); write(fd, buff, strlen(buff)+1); slirp_socket_wait = curtime; close(fd); @@ -1090,7 +1090,7 @@ strcpy(buff2, "PPP"); else #endif - sprintf(buff2, "SLIP, MTU %d, MRU %d", if_mtu, if_mru); + snprintf(buff2, sizeof(buff2), "SLIP, MTU %d, MRU %d", if_mtu, if_mru); #ifndef FULL_BOLT snprintf(buff, sizeof(buff), "1 Attached as unit %d, device %s\r\n\r\n[talking %s, %d baud]\r\n\r\nSLiRP Ready ...", @@ -1111,7 +1111,7 @@ ttyp->fd = fd; } } else { - sprintf(buff, "0 %s", strerror(errno)); + snprintf(buff, sizeof(buff), "0 %s", strerror(errno)); write(fd, buff, strlen(buff)+1); slirp_socket_wait = curtime; close(fd); --- slirp-1.0.17.old/src/misc.c 2010-07-04 19:06:12.450054039 +0200 +++ slirp-1.0.17/src/misc.c 2010-07-04 20:16:16.570051667 +0200 @@ -403,7 +403,7 @@ { char buff[256]; - sprintf(buff, "Error: execvp of %s failed: %s\n", + snprintf(buff, sizeof(buff), "Error: execvp of %s failed: %s\n", argv[0], strerror(errno)); write(2, buff, strlen(buff)+1); } @@ -490,7 +490,7 @@ if (connect(s, (struct sockaddr *)&sock_un, sizeof(sock_un.sun_family) + sizeof(sock_un.sun_path)) != 0) slirp_exit(1); - sprintf(buff, "kill none:%d", slirp_socket_unit); + snprintf(buff, sizeof(buff), "kill none:%d", slirp_socket_unit); write(s, buff, strlen(buff)+1); } #endif @@ -917,7 +917,7 @@ /* Ooops, failed, let's tell the user why */ - sprintf(buff, "Error: execlp of %s failed: %s\n", + snprintf(buff, sizeof(buff), "Error: execlp of %s failed: %s\n", "rsh", strerror(errno)); write(2, buff, strlen(buff)+1); close(0); close(1); close(2); /* XXX */ --- slirp-1.0.17.old/src/options.c 2004-09-07 03:50:02.000000000 +0200 +++ slirp-1.0.17/src/options.c 2010-07-04 20:18:52.234051775 +0200 @@ -695,7 +695,7 @@ lprint("Valid commands:\r\n"); while (cfg[i].command) { if (count >= 2) { - sprintf(str, "\r\n"); + snprintf(str, sizeof(str), "\r\n"); count = 0; } else { count++; --- slirp-1.0.17.old/src/ttys.c 2010-07-04 20:06:27.334052741 +0200 +++ slirp-1.0.17/src/ttys.c 2010-07-04 20:17:30.550049218 +0200 @@ -94,9 +94,9 @@ /* Config the new tty */ if ((bptr = (char *)getenv("HOME"))) - sprintf(buff, "%s/.slirprc-%d", bptr, unit); + snprintf(buff, sizeof(buff), "%s/.slirprc-%d", bptr, unit); else - sprintf(buff, ".slirprc-%d", unit); + snprintf(buff, sizeof(buff), ".slirprc-%d", unit); config(buff, ttyp->unit); return ttyp; debian/patches/007-debian-changes.patch0000644000000000000000000000203211414153747014776 0ustar Author: Roberto Lumbreras Description: Debian building changes --- slirp-1.0.17.orig/src/Makefile.in +++ slirp-1.0.17/src/Makefile.in @@ -209,3 +209,4 @@ strtoul.o: ${srcdir}/strtoul.c .c.o: $(COMMON_H) $(CC) $(CFLAGS) -c $< -o $@ +nothing: --- slirp-1.0.17.orig/src/main.c +++ slirp-1.0.17/src/main.c @@ -73,7 +73,11 @@ main(argc, argv) lprint_ptr2 = (char *)stderr; lprint_arg = (char **)&lprint_ptr2; +#ifndef FULL_BOLT lprint("Slirp v%s (%s)\n\n", SLIRP_VERSION, SLIRP_STATUS); +#else + lprint("Slirp v%s (%s) FULL_BOLT\n\n", SLIRP_VERSION, SLIRP_STATUS); +#endif lprint("Copyright (c) 1995,1996 Danny Gasparovski and others.\n"); lprint("All rights reserved.\n"); --- slirp-1.0.17.orig/src/options.c +++ slirp-1.0.17/src/options.c @@ -1103,7 +1103,11 @@ cfg_version(buff, inso) char *buff; struct socket *inso; { +#ifndef FULL_BOLT lprint("Slirp v%s (%s)\r\n", SLIRP_VERSION, SLIRP_STATUS); +#else + lprint("Slirp v%s (%s) FULL_BOLT\r\n", SLIRP_VERSION, SLIRP_STATUS); +#endif return CFG_OK; } debian/patches/006-changelog-1.0.17.patch0000644000000000000000000000212011414153457014612 0ustar Author: Roberto Lumbreras Description: Add 1.0.17 upstream changelog --- /dev/null +++ slirp-1.0.17/Changes-1.0.17 @@ -0,0 +1,35 @@ +This patch updates slirp-1.0.16 +(Bug fixes) + +It includes (modified) patches from Tim Watt, which corrects issues with +the checking of TTYs, and compilation of the FULL_BOLT version. + +It also adds the "malloc heap corruption +patch" from Juergen Keil at the QEMU project (Kindly brought to my +attention by Gertjan Halkes) + +The version number is updated to 1.0.17 + + +References: + +http://sourceforge.net/mailarchive/message.php?msg_id=13646144 +http://sourceforge.net/mailarchive/message.php?msg_id=14381829 +http://lists.gnu.org/archive/html/qemu-devel/2005-05/msg00228.html + +Notes: + +Under Cygwin using gcc 3.4.4 it was found that slirp wouldn't work with +the -O2 option enabled. This was eventually tracked down to tcp_input.c +which has issues with strict aliasing. + +To work around this, I currently (manually) add a -fno-strict-aliasing +option to the COMMON_DEFS definition in the Makefile. + +Regards +Roger + +2006/01/08 + + + debian/patches/008-slirp-amd64-log-crash.patch0000644000000000000000000000267711414154430016073 0ustar Author: Alexander Block Description: Fix crash on amd64 when enabling file logging On amd64 architectures, slirp crashes immediately when file logging is enabled with "log start". It happens at the first call to lprint after the log file is opened and ready for logging. The reason is that the va_list object "args" is used twice in that case, once at lprint_ptr += (*lprint_print)(*lprint_arg, format, args); and once at vfprintf(lfd, bptr2, args); . After the first call, args gets invalid because all arguments have been read from the va_args structure. For some reason, this does not happen on i386 versions. Maybe a real copy of args is created when the function is called in i386. Bug-Debian: http://bugs.debian.org/587907 --- slirp-1.0.17/src/misc.c 2010-07-02 13:12:16.000000000 +0200 +++ slirp-1.0.17-changed/src/misc.c 2010-07-02 15:37:19.617074017 +0200 @@ -602,13 +602,17 @@ #endif { va_list args; + va_list args2; #ifdef __STDC__ va_start(args, format); + va_start(args2, format); #else char *format; va_start(args); + va_start(args2); format = va_arg(args, char *); + va_arg(args2, char *); // skip #endif /* If we're printing to an sbuf, make sure there's enough room */ /* XXX +100? */ @@ -651,10 +655,11 @@ else bptr1++; } - vfprintf(lfd, bptr2, args); + vfprintf(lfd, bptr2, args2); free(bptr2); } va_end(args); + va_end(args2); } void debian/patches/001-update-man-fix-hyphens-as-minus.patch0000644000000000000000000001357011413430570020165 0ustar Author: Roberto Lumbreras Description: fix hyphens used instead of minus signs and update manpage --- slirp-1.0.17.orig/src/slirp.man +++ slirp-1.0.17/src/slirp.man @@ -1,4 +1,4 @@ -.TH SLIRP 1 "9 Jan 1996" "Version 1.0b" +.TH SLIRP 1 "8 Jan 2006" "Version 1.0.17" .\" Start displayed text macro .de DS @@ -58,7 +58,7 @@ You can also "disconnect" Slirp by typin second gap between each. This will disconnect Slirp from your shell's terminal and put Slirp in the background. Later, you can type .DS - slirp -l 0 + slirp \-l 0 .DE to "reconnect" Slirp again. .PP @@ -93,29 +93,29 @@ you can achieve the same thing by runnin (Notice the quotes, they ARE significant). The reverse is also true. E.g., if you run slirp as: .DS - slirp -P -b 14400 + slirp \-P \-b 14400 .DE you can create your .slirprc file too look like the following: .DS - -P - -b 14400 + \-P + \-b 14400 .DE (Notice that only ONE command per line is allowed in configuration files). The 2 types of options can also be mixed. For example: .DS In .slirprc: - -P - -b 14400 + \-P + \-b 14400 redir 5022 21 Command line: - slirp -P -b 14400 "redir 5022 21" + slirp \-P \-b 14400 "redir 5022 21" .DE Note that on the command line, any command/option that does not begin with a '-' or '+', and has spaces in it, MUST be enclosed in quotes. E.g., The following are all legal: .DS - slirp -P "redir udp 5022 25" -vj -b 14400 + slirp \-P "redir udp 5022 25" \-vj \-b 14400 slirp "ppp" "baudrate 14400" slirp ppp "baudrate 14400" .DE @@ -125,9 +125,9 @@ does not need to be enclosed in quotes b The following are NOT legal: .DS slirp baudrate 14400 - slirp "-b 14400" + slirp "\-b 14400" .DE -(Because "-b" starts with a '-' you must NOT enclose it in quotes.) +(Because "\-b" starts with a '-' you must NOT enclose it in quotes.) Easy, eh? .PP Note: Whenever Slirp expects an IP address as an argument (E.g., in @@ -149,8 +149,8 @@ command: A few notes on configuration: .RS 2 .IP * 2 -You should have "ppp" or "-P" before any PPP options (because when -Slirp parses -P or ppp, it will initialize all related fields, hence +You should have "ppp" or "\-P" before any PPP options (because when +Slirp parses \-P or ppp, it will initialize all related fields, hence clearing anything that was parsed before it). .IP * 2 Upon startup, the configuration is done in this order: @@ -164,9 +164,9 @@ Command-line options .RE .IP \ 2 This is important because, for example, if you have "initiate-options" -(a PPP option) in ~/.slirprc-0, and you run slirp with -P, -"initiate-options" will not be valid, because -P will clear the fact -that you want options initiated by Slirp (remember, -P should always +(a PPP option) in ~/.slirprc-0, and you run slirp with \-P, +"initiate-options" will not be valid, because \-P will clear the fact +that you want options initiated by Slirp (remember, \-P should always come before any PPP options). .RE .SH "COMMANDS AND OPTIONS" @@ -202,7 +202,7 @@ Redirect a port for use with the X Windo .br Usable: anywhere .br -Command-line: -X +Command-line: \-X .br Options: .RS 2 @@ -287,7 +287,7 @@ settings for the host port or modem. .br Usable: anywhere .br -Command-line: -b +Command-line: \-b .PP Example: baudrate 14400 .PP @@ -433,8 +433,8 @@ Note: It is recommended you use "close N wipes out the session, whereas "close N" closes it properly, as a good little tcpip-emulator should :) .PP -"kill -1" shouldn't be used, it will kill the first session it finds -with -1, which usually is the command-line connection. +"kill \-1" shouldn't be used, it will kill the first session it finds +with \-1, which usually is the command-line connection. .RE .IP "close N" .RS 4 @@ -792,9 +792,9 @@ ASCII 0x7e which is used by PPP as the " If your PPP software is unable to escape these characters, or you're using (C)SLIP (which must have an 8bit clean link), your best bet is to try and make the link 8bit clean. For example, on some systems you can -give telnet the -8 flag to make the link 8bit, and -E to stop it from -interpreting the ^] character. Similarly for rlogin; -8 to make the -link 8bit, -E to stop rlogin from interpreting the ~ character. You +give telnet the \-8 flag to make the link 8bit, and \-E to stop it from +interpreting the ^] character. Similarly for rlogin; \-8 to make the +link 8bit, \-E to stop rlogin from interpreting the ~ character. You should look at the telnet and rlogin manual pages ("man telnet" and "man rlogin" respectively) to see if your telnet/rlogin has similar options. @@ -815,7 +815,7 @@ On startup, Slirp should print something Now, when you telnet to the host you wish to run the X programs from, you should do as Slirp suggest above; type either of the two commands, depending on which shell you are using. You could also run the X -program as "xprog -display IP.ADDRESS:X.Y" as printed above. +program as "xprog \-display IP.ADDRESS:X.Y" as printed above. .IP If you missed what Slirp displayed on startup, you can telnet to 10.0.2.0 and give Slirp the command "show X", and the above will be @@ -886,13 +886,13 @@ If all else fails, send me e-mail to dan with the following information: .RS 2 .IP * 2 -Output of the command "uname -a" on the remote system; +Output of the command "uname \-a" on the remote system; .IP * 2 Operating System name and version you run on your PC; .IP * 2 Version of Slirp you are using (IMPORTANT!!!); .IP * 2 -If you managed to get Slirp running, run Slirp as "slirp -S" then try +If you managed to get Slirp running, run Slirp as "slirp \-S" then try whatever failed. When you exit Slirp, you should have a file called "slirp_stats". Send me this file; and .IP * 2 debian/patches/series0000644000000000000000000000044412013136263012031 0ustar 001-update-man-fix-hyphens-as-minus.patch 002-fix-arguements.patch 003-socklen_t.patch 004-compilation-warnings.patch 005-use-snprintf.patch 006-changelog-1.0.17.patch 007-debian-changes.patch 008-slirp-amd64-log-crash.patch 009-i-hate-perl.patch 010-fullbolt-fix.patch 011-sizeof_ipv4.patch debian/patches/004-compilation-warnings.patch0000644000000000000000000000743511414153141016307 0ustar Author: Roberto Lumbreras Description: Fix compilation warnings --- slirp-1.0.17.old/src/config.h.in 2004-09-01 11:58:50.000000000 +0200 +++ slirp-1.0.17/src/config.h.in 2010-07-04 19:40:09.498052136 +0200 @@ -45,6 +45,8 @@ #define NO_PROTOTYPES #endif +#define _GNU_SOURCE + /*********************************************************/ /* * Autoconf defined configuration options --- slirp-1.0.17.old/src/main.h 2006-05-18 21:22:46.000000000 +0200 +++ slirp-1.0.17/src/main.h 2010-07-04 19:43:39.322051994 +0200 @@ -10,6 +10,7 @@ #include #include +#include #ifdef HAVE_SYS_SELECT_H #include --- slirp-1.0.17.old/src/mbuf.h 2004-09-01 09:36:45.000000000 +0200 +++ slirp-1.0.17/src/mbuf.h 2010-07-04 19:46:43.542051864 +0200 @@ -132,6 +132,6 @@ extern struct mbstat mbstat; extern int mbuf_alloced; extern struct mbuf m_freelist, m_usedlist; -extern mbuf_max; +extern int mbuf_max; #endif --- slirp-1.0.17.old/src/ppp/ccp.c 2004-09-01 09:36:51.000000000 +0200 +++ slirp-1.0.17/src/ppp/ccp.c 2010-07-04 19:53:56.266052492 +0200 @@ -464,7 +464,7 @@ if (newret == CONFNAK && dont_nak) newret = CONFREJ; - if (!(newret == CONFACK || newret == CONFNAK && ret == CONFREJ)) { + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { /* we're returning this option */ if (newret == CONFREJ && ret == CONFNAK) retp = p0; --- slirp-1.0.17.old/src/ppp/ipcp.c 2004-09-07 03:50:08.000000000 +0200 +++ slirp-1.0.17/src/ppp/ipcp.c 2010-07-04 19:54:59.854051807 +0200 @@ -568,7 +568,7 @@ no.neg_vj = 1; break; case CI_ADDRS: - if (go->neg_addr && go->old_addrs || no.old_addrs + if ((go->neg_addr && go->old_addrs) || no.old_addrs || cilen != CILEN_ADDRS) goto bad; try.neg_addr = 1; --- slirp-1.0.17.old/src/ppp/lcp.c 2004-09-01 09:36:52.000000000 +0200 +++ slirp-1.0.17/src/ppp/lcp.c 2010-07-04 19:55:23.146051859 +0200 @@ -39,6 +39,7 @@ #include "chap.h" #include "upap.h" #include "ipcp.h" +#include "ccp.h" /* global vars */ fsm lcp_fsm[NUM_PPP]; /* LCP fsm structure (global)*/ --- slirp-1.0.17.old/src/ppp/ppp.h 2004-09-01 09:36:52.000000000 +0200 +++ slirp-1.0.17/src/ppp/ppp.h 2010-07-04 19:52:06.634052434 +0200 @@ -54,4 +54,18 @@ void print_string _P((char *, int, void (*) _P((void *, char *, ...)), void *)); +int bad_ip_adrs(u_int32_t addr); +void novm __P((char *)); +void auth_peer_fail(int unit, int protocol); +void auth_withpeer_fail(int unit, int protocol); +void auth_peer_success(int unit, int protocol); +void auth_withpeer_success(int unit, int protocol); +int auth_ip_addr(int unit, u_int32_t addr); +void link_established(int unit); +void link_down(int unit); +void link_required(int unit); +void link_terminated(int unit); +void check_auth_options(); +void check_access(FILE *f, char *filename); + #endif /* __PPP_H__ */ --- slirp-1.0.17.old/src/ppp.c 2004-09-01 09:36:44.000000000 +0200 +++ slirp-1.0.17/src/ppp.c 2010-07-04 19:55:46.902052003 +0200 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include --- slirp-1.0.17.old/src/tcp_output.c 2004-09-01 09:36:44.000000000 +0200 +++ slirp-1.0.17/src/tcp_output.c 2010-07-04 19:59:17.070051654 +0200 @@ -592,7 +592,7 @@ tcp_setpersist(tp) register struct tcpcb *tp; { - register t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; + register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; /* if (tp->t_timer[TCPT_REXMT]) * panic("tcp_output REXMT"); --- slirp-1.0.17.old/src/ttys.c 2004-09-07 02:00:45.000000000 +0200 +++ slirp-1.0.17/src/ttys.c 2010-07-04 19:58:38.418051646 +0200 @@ -11,6 +11,8 @@ #endif #include +void lcp_lowerdown(int unit); + struct ttys *ttys_unit[MAX_INTERFACES]; int slirp_forked; debian/patches/009-i-hate-perl.patch0000644000000000000000000000154311573054637014271 0ustar Description: Do not run MAKEPRO anymore mkpro is a nice perl script that used to regenerate all slirp prototypes correctly in the past. It stopped working, maybe because a change in perl and/or because it has a bug. I'm not a perl guru, and after wasting hours of my time trying to decypher mkrpo and fixing that silly thing, I quit. Slirp hasn't changed for years, so I think mkpro isn't very usefull anyway. . Author: Roberto Lumbreras Bug-Debian: http://bugs.debian.org/628280 Index: slirp-1.0.17/src/Makefile.in =================================================================== --- slirp-1.0.17.orig/src/Makefile.in 2011-06-06 06:27:00.000000000 +0200 +++ slirp-1.0.17/src/Makefile.in 2011-06-06 06:37:19.627022610 +0200 @@ -96,7 +96,8 @@ # .c.p: - $(MAKEPRO) +# $(MAKEPRO) + touch $@ auth.o: $(COMMON_H) ${srcdir}/ppp/auth.c debian/patches/010-fullbolt-fix.patch0000644000000000000000000000216511725101353014545 0ustar Description: please apply "real full bolt" patch Even when compiled with "-DFULL_BOLT", slirp applies a small delay to TCP ACKs, which results in the upload speed being capped to circa 46Kb/s. Manfread Haertel published a tiny patch for this on the UML mailing list: http://article.gmane.org/gmane.linux.uml.user/13973 . Author: Manfred Haertel rz-online.de> Bug-Debian: http://bugs.debian.org/658359 Index: slirp-1.0.17/src/tcp_input.c =================================================================== --- slirp-1.0.17.orig/src/tcp_input.c 2004-09-01 09:36:44.000000000 +0200 +++ slirp-1.0.17/src/tcp_input.c 2012-03-05 10:02:15.813322621 +0100 @@ -598,6 +598,10 @@ * ((so->so_iptos & IPTOS_LOWDELAY) && * ((struct tcpiphdr_2 *)ti)->first_char == (char)27)) { */ +#ifdef FULL_BOLT + tp->t_flags |= TF_ACKNOW; + tcp_output(tp); +#else if ((unsigned)ti->ti_len == 1 && ((struct tcpiphdr_2 *)ti)->first_char == (char)27) { tp->t_flags |= TF_ACKNOW; @@ -605,6 +609,7 @@ } else { tp->t_flags |= TF_DELACK; } +#endif return; } } /* header prediction */ debian/patches/011-sizeof_ipv4.patch0000644000000000000000000000352312013141206014367 0ustar Description: IPCP negotiation fails for 64-bit hosts Due to incorrect use of "sizeof(long)" in src/ppp/ipcp.c, a 64-bit host may send back incorrect IPCP NAKs in response to a client sending an IPCP configure request that includes DNS/WINS options. The NAK response offers an incorrect IP address and no DNS IPs, which eventually causes negotiation to fail. Proposed solution is to change "sizeof (long)" to "sizeof (u_int32_t)" to correctly match the length of IPV4 addresses. . Author: Tueidj Traden hotmail.com> Bug-Debian: http://bugs.debian.org/685056 Index: slirp-1.0.17/src/ppp/ipcp.c =================================================================== --- slirp-1.0.17.orig/src/ppp/ipcp.c 2012-03-05 10:04:03.437397424 +0100 +++ slirp-1.0.17/src/ppp/ipcp.c 2012-08-16 11:29:19.529949712 +0200 @@ -881,7 +881,7 @@ } GETLONG(tl,p); if (htonl(tl) != wo->dnsaddr[0]) { - DECPTR(sizeof (long),p); + DECPTR(sizeof (u_int32_t),p); tl = ntohl(wo->dnsaddr[0]); PUTLONG(tl, p); orc = CONFNAK; @@ -899,7 +899,7 @@ } GETLONG(tl,p); if (htonl(tl) != wo->winsaddr[0]) { - DECPTR(sizeof (long),p); + DECPTR(sizeof (u_int32_t),p); tl = ntohl(wo->winsaddr[0]); PUTLONG(tl, p); orc = CONFNAK; @@ -917,7 +917,7 @@ } GETLONG(tl,p); if (htonl(tl) != wo->dnsaddr[1]) { /* and this is the 2nd one */ - DECPTR(sizeof (long),p); + DECPTR(sizeof (u_int32_t),p); tl = ntohl(wo->dnsaddr[1]); PUTLONG(tl, p); orc = CONFNAK; @@ -935,7 +935,7 @@ } GETLONG(tl,p); if (htonl(tl) != wo->winsaddr[1]) { /* and this is the 2nd one */ - DECPTR(sizeof (long),p); + DECPTR(sizeof (u_int32_t),p); tl = ntohl(wo->winsaddr[1]); PUTLONG(tl, p); orc = CONFNAK; debian/copyright0000644000000000000000000000613511413427567011140 0ustar This is the slirp debian package, debianized by Roberto Lumbreras I dowloaded the sources from http://prdownloads.sourceforge.net/slirp/ original COPYRIGHT file from the slirp source follows: Slirp was written by Danny Gasparovski. Copyright (c), 1995,1996 All Rights Reserved. Slirp is free software; "free" as in you don't have to pay for it, and you are free to do whatever you want with it. I do not accept any donations, monetary or otherwise, for Slirp. Instead, I would ask you to pass this potential donation to your favorite charity. In fact, I encourage *everyone* who finds Slirp useful to make a small donation to their favorite charity (for example, GreenPeace). This is not a requirement, but a suggestion from someone who highly values the service they provide. The copyright terms and conditions: ---BEGIN--- Copyright (c) 1995,1996 Danny Gasparovski. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Danny Gasparovski. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DANNY GASPAROVSKI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---END--- This basically means you can do anything you want with the software, except 1) call it your own, and 2) claim warranty on it. There is no warranty for this software. None. Nada. If you lose a million dollars while using Slirp, that's your loss not mine. So, ***USE AT YOUR OWN RISK!***. If these conditions cannot be met due to legal restrictions (E.g. where it is against the law to give out Software without warranty), you must cease using the software and delete all copies you have. Slirp uses code that is copyrighted by the following people/organizations: Juha Pirkola. Gregory M. Christy. The Regents of the University of California. Carnegie Mellon University. The Australian National University. RSA Data Security, Inc. Please read the top of each source file for the details on the various copyrights. debian/install0000644000000000000000000000005511413427567010571 0ustar src/slirp usr/bin src/slirp-fullbolt usr/bin debian/compat0000644000000000000000000000000212013141727010362 0ustar 9 debian/control0000644000000000000000000000130612013141737010570 0ustar Source: slirp Section: net Priority: optional Maintainer: Roberto Lumbreras Build-Depends: cdbs, debhelper (>= 9), autotools-dev Standards-Version: 3.9.3 Homepage: http://slirp.sourceforge.net Package: slirp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: SLIP/PPP emulator using a dial up shell account Slirp is a TCP/IP emulator which turns an ordinary shell account into a (C)SLIP/PPP account. This allows shell users to use all the funky Internet applications like Netscape, Mosaic, CUSeeMe, etc. . Please note that maybe your ISP really doesn't like you using slirp, because they want to charge more for a ppp connection, so use it at your own risk. debian/changelog0000644000000000000000000001021512013142075011032 0ustar slirp (1:1.0.17-7) unstable; urgency=low * Fix IPCP negotiation fails for 64-bit hosts (Closes: #685056) * Set debhelper compat to 9. -- Roberto Lumbreras Thu, 16 Aug 2012 11:19:57 +0200 slirp (1:1.0.17-6) unstable; urgency=low * Apply ``real full bolt'' patch. (Closes: #658359) * Updated standards. -- Roberto Lumbreras Mon, 05 Mar 2012 19:38:33 +0100 slirp (1:1.0.17-5) unstable; urgency=low * Don't delete *.p files and don't run 'mkpro' perl script anymore to automatically regenerate prototypes, as it stopped working somehow, resulting in FTBFS. (Closes: #628280) * Updated standards. * Add -Wl,--as-needed to LDFLAGS. -- Roberto Lumbreras Mon, 06 Jun 2011 06:18:08 +0200 slirp (1:1.0.17-4) unstable; urgency=low * Fix crash on amd64 when enabling file logging. (Closes: #587907) * Updated standards. * Switch to dpkg-source 3.0 (quilt) format. * Fix watch file. -- Roberto Lumbreras Sun, 04 Jul 2010 21:16:28 +0200 slirp (1:1.0.17-3) unstable; urgency=low * Updated standards. * Fix arguements spelling-error-in-binary (lintian). * debian/HOWTO-TEST: use "ssh -t" to force tty allocation. (Closes: #544124) -- Roberto Lumbreras Sat, 29 Aug 2009 14:17:24 +0200 slirp (1:1.0.17-2) unstable; urgency=low * Clean up compilation warnings and a few snprintf changes. Use addrlen as socklen_t instead of int. Tested on amd64 and it works. (Closes: #29245) * Switch to cdbs. -- Roberto Lumbreras Tue, 14 Aug 2007 17:22:55 +0200 slirp (1:1.0.17-1) unstable; urgency=low * New upstream version. (Closes: #175079) * Add slirp-fullbolt manpage. (Closes: #223920) * Updated standards (no changes). -- Roberto Lumbreras Thu, 18 May 2006 19:42:29 +0200 slirp (1:1.0.16-3) unstable; urgency=high * Add an epoch to fix hijacking of package by Debian JED group. (Closes: #339578) * Updated standards (no changes). -- Roberto Lumbreras Mon, 16 Jan 2006 14:10:48 +0100 slirp (1.0.16-2) unstable; urgency=high * Fix ttyname segfault. Added -fno-strict-aliasing to CFLAGS to avoid incorrect code generation with gcc >= 3.3. (closes:#295832) -- Roberto Lumbreras Tue, 01 Mar 2005 12:15:03 +0100 slirp (1.0.16-1) unstable; urgency=low * New upstream version. * Updated standards. -- Roberto Lumbreras Fri, 04 Feb 2005 03:53:09 +0100 slirp (1.0.14pre1-4) unstable; urgency=low * Provide a separate slirp-fullbolt binary built with FULL_BOLT. (closes:#175093) -- Roberto Lumbreras Tue, 06 May 2003 17:17:40 +0200 slirp (1.0.14pre1-3) unstable; urgency=low * src/debug.c: added ifndef so it compiles with FULL_BOLT. (closes:#175083) * Standards 3.5.9. -- Roberto Lumbreras Sat, 15 Mar 2003 19:37:13 +0100 slirp (1.0.14pre1-2) unstable; urgency=low * debian/rules: switched to debhelper. * debian/control: added slirp home page to description. -- Roberto Lumbreras Fri, 12 Jul 2002 18:32:34 +0200 slirp (1.0.14pre1-1) unstable; urgency=low * New upstream version. * Standards 3.5.2. -- Roberto Lumbreras Sun, 1 Apr 2001 19:57:28 +0200 slirp (1.0.9-1) unstable; urgency=low * New upstream version. * Standards 3.1.1. -- Roberto Lumbreras Sun, 26 Mar 2000 20:53:27 +0200 slirp (1.0g-2) frozen; urgency=high * Fixed important bug. (closes: bug#59608) -- Roberto Lumbreras Sat, 25 Mar 2000 20:34:48 +0100 slirp (1.0g-1) unstable; urgency=low * New upstream version. -- Roberto Lumbreras Wed, 18 Aug 1999 13:16:06 +0200 slirp (1.0f-1) unstable; urgency=low * New upstream version. -- Roberto Lumbreras Wed, 17 Mar 1999 19:02:28 +0100 slirp (1.0d-1) unstable; urgency=low * New upstream version. -- Roberto Lumbreras Sun, 11 Oct 1998 01:49:06 +0200 slirp (1.0c-1) unstable; urgency=low * initial release * added debian files -- Roberto Lumbreras Mon, 3 Aug 1998 01:03:35 +0200 debian/rules0000755000000000000000000000161412013152655010250 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall DEB_SRCDIR = src DEB_MAKE_CLEAN_TARGET = realclean DEB_MAKE_BUILD_TARGET = nothing DEB_MAKE_INSTALL_TARGET = DEB_INSTALL_CHANGELOGS_ALL = ChangeLog #CC = gcc CFLAGS += $(CPPFLAGS) -I. -DUSE_PPP -DUSE_MS_DNS -fno-strict-aliasing -Wno-unused PPPCFLAGS = $(CFLAGS) LDFLAGS += -Wl,--as-needed clean:: cd $(DEB_SRCDIR) && \ rm -f slirp-fullbolt slirp-normal build/slirp:: src/slirp-fullbolt src/slirp-normal src/slirp-fullbolt: cd $(DEB_SRCDIR); \ $(MAKE) CFLAGS="$(CFLAGS) -DFULL_BOLT" \ PPPCFLAGS="$(PPPCFLAGS)" clean all && \ mv slirp slirp-fullbolt src/slirp-normal: cd $(DEB_SRCDIR); \ $(MAKE) CFLAGS="$(CFLAGS)" \ PPPCFLAGS="$(PPPCFLAGS)" clean all && \ touch slirp-normal