Minor bug-fixes to pppd; add -ccp option to disable CCP negotiation

if desired; delete interface addresses on exit.
This commit is contained in:
paulus 1996-03-28 02:50:57 +00:00
parent e8f5c6972e
commit e170d85c0d
8 changed files with 68 additions and 12 deletions

View File

@ -26,7 +26,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: ccp.c,v 1.4 1996/03/15 03:03:38 paulus Exp $";
static char rcsid[] = "$Id: ccp.c,v 1.5 1996/03/28 02:50:57 paulus Exp $";
#endif
#include <string.h>
@ -143,8 +143,15 @@ ccp_open(unit)
if (f->state != OPENED)
ccp_flags_set(unit, 1, 0);
if (!ANY_COMPRESS(ccp_wantoptions[unit]))
/*
* Find out which compressors the kernel supports before
* deciding whether to open in silent mode.
*/
ccp_resetci(f);
if (!ANY_COMPRESS(ccp_gotoptions[unit]))
f->flags |= OPT_SILENT;
fsm_open(f);
}

View File

@ -18,7 +18,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: options.c,v 1.12 1996/03/15 03:03:59 paulus Exp $";
static char rcsid[] = "$Id: options.c,v 1.13 1996/03/28 02:50:59 paulus Exp $";
#endif
#include <ctype.h>
@ -176,6 +176,7 @@ static int setipcpaccl __P((void));
static int setipcpaccr __P((void));
static int setlcpechointv __P((char **));
static int setlcpechofails __P((char **));
static int noccp __P((void));
static int setbsdcomp __P((char **));
static int setnobsdcomp __P((void));
static int setdeflate __P((char **));
@ -294,6 +295,7 @@ static struct cmd {
{"chap-interval", 1, setchapintv}, /* Set interval for rechallenge */
{"ipcp-accept-local", 0, setipcpaccl}, /* Accept peer's address for us */
{"ipcp-accept-remote", 0, setipcpaccr}, /* Accept peer's address for it */
{"-ccp", 0, noccp}, /* Disable CCP negotiation */
{"bsdcomp", 1, setbsdcomp}, /* request BSD-Compress */
{"-bsdcomp", 0, setnobsdcomp}, /* don't allow BSD-Compress */
{"deflate", 1, setdeflate}, /* request Deflate compression */
@ -1759,6 +1761,13 @@ setchapintv(argv)
return int_option(*argv, &chap[0].chal_interval);
}
static int
noccp()
{
ccp_protent.enabled_flag = 0;
return 1;
}
static int
setbsdcomp(argv)
char **argv;

View File

@ -1,5 +1,5 @@
.\" manual page [] for pppd 2.0
.\" $Id: pppd.8,v 1.11 1996/03/15 03:04:04 paulus Exp $
.\" $Id: pppd.8,v 1.12 1996/03/28 02:51:00 paulus Exp $
.\" SH section heading
.\" SS subsection heading
.\" LP paragraph
@ -208,6 +208,13 @@ compression in the corresponding direction.
Disables BSD-Compress compression; \fBpppd\fR will not request or
agree to compress packets using the BSD-Compress scheme.
.TP
.B -ccp
Disable CCP (Compression Control Protocol) negotiation. This option
should only be required if the peer is buggy and gets confused by
requests from
.I pppd
for CCP negotiation.
.TP
.B +chap
Require the peer to authenticate itself using CHAP [Cryptographic
Handshake Authentication Protocol] authentication.

View File

@ -26,7 +26,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: ccp.c,v 1.4 1996/03/15 03:03:38 paulus Exp $";
static char rcsid[] = "$Id: ccp.c,v 1.5 1996/03/28 02:50:57 paulus Exp $";
#endif
#include <string.h>
@ -143,8 +143,15 @@ ccp_open(unit)
if (f->state != OPENED)
ccp_flags_set(unit, 1, 0);
if (!ANY_COMPRESS(ccp_wantoptions[unit]))
/*
* Find out which compressors the kernel supports before
* deciding whether to open in silent mode.
*/
ccp_resetci(f);
if (!ANY_COMPRESS(ccp_gotoptions[unit]))
f->flags |= OPT_SILENT;
fsm_open(f);
}

View File

@ -18,7 +18,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: options.c,v 1.12 1996/03/15 03:03:59 paulus Exp $";
static char rcsid[] = "$Id: options.c,v 1.13 1996/03/28 02:50:59 paulus Exp $";
#endif
#include <ctype.h>
@ -176,6 +176,7 @@ static int setipcpaccl __P((void));
static int setipcpaccr __P((void));
static int setlcpechointv __P((char **));
static int setlcpechofails __P((char **));
static int noccp __P((void));
static int setbsdcomp __P((char **));
static int setnobsdcomp __P((void));
static int setdeflate __P((char **));
@ -294,6 +295,7 @@ static struct cmd {
{"chap-interval", 1, setchapintv}, /* Set interval for rechallenge */
{"ipcp-accept-local", 0, setipcpaccl}, /* Accept peer's address for us */
{"ipcp-accept-remote", 0, setipcpaccr}, /* Accept peer's address for it */
{"-ccp", 0, noccp}, /* Disable CCP negotiation */
{"bsdcomp", 1, setbsdcomp}, /* request BSD-Compress */
{"-bsdcomp", 0, setnobsdcomp}, /* don't allow BSD-Compress */
{"deflate", 1, setdeflate}, /* request Deflate compression */
@ -1759,6 +1761,13 @@ setchapintv(argv)
return int_option(*argv, &chap[0].chal_interval);
}
static int
noccp()
{
ccp_protent.enabled_flag = 0;
return 1;
}
static int
setbsdcomp(argv)
char **argv;

View File

@ -1,5 +1,5 @@
.\" manual page [] for pppd 2.0
.\" $Id: pppd.8,v 1.11 1996/03/15 03:04:04 paulus Exp $
.\" $Id: pppd.8,v 1.12 1996/03/28 02:51:00 paulus Exp $
.\" SH section heading
.\" SS subsection heading
.\" LP paragraph
@ -208,6 +208,13 @@ compression in the corresponding direction.
Disables BSD-Compress compression; \fBpppd\fR will not request or
agree to compress packets using the BSD-Compress scheme.
.TP
.B -ccp
Disable CCP (Compression Control Protocol) negotiation. This option
should only be required if the peer is buggy and gets confused by
requests from
.I pppd
for CCP negotiation.
.TP
.B +chap
Require the peer to authenticate itself using CHAP [Cryptographic
Handshake Authentication Protocol] authentication.

View File

@ -21,7 +21,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: sys-bsd.c,v 1.11 1996/03/15 03:04:07 paulus Exp $";
static char rcsid[] = "$Id: sys-bsd.c,v 1.12 1996/03/28 02:51:02 paulus Exp $";
#endif
/*
@ -76,6 +76,7 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
static int sockfd; /* socket for doing interface ioctls */
static int if_is_up; /* the interface is currently up */
static u_int32_t ifaddrs[2]; /* local and remote addresses we set */
static u_int32_t default_route_gateway; /* gateway addr for default route */
static u_int32_t proxy_arp_addr; /* remote addr for proxy arp */
@ -120,7 +121,8 @@ sys_cleanup()
ioctl(sockfd, SIOCSIFFLAGS, &ifr);
}
}
if (ifaddrs[0] != 0)
cifaddr(0, ifaddrs[0], ifaddrs[1]);
if (default_route_gateway)
cifdefaultroute(0, default_route_gateway);
if (proxy_arp_addr)
@ -981,6 +983,8 @@ sifaddr(u, o, h, m)
syslog(LOG_WARNING,
"Couldn't set interface address: Address already exists");
}
ifaddrs[0] = o;
ifaddrs[1] = h;
return 1;
}
@ -995,6 +999,7 @@ cifaddr(u, o, h)
{
struct ifaliasreq ifra;
ifaddrs[0] = 0;
strncpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name));
SET_SA_FAMILY(ifra.ifra_addr, AF_INET);
((struct sockaddr_in *) &ifra.ifra_addr)->sin_addr.s_addr = o;

View File

@ -21,7 +21,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: sys-bsd.c,v 1.11 1996/03/15 03:04:07 paulus Exp $";
static char rcsid[] = "$Id: sys-bsd.c,v 1.12 1996/03/28 02:51:02 paulus Exp $";
#endif
/*
@ -76,6 +76,7 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
static int sockfd; /* socket for doing interface ioctls */
static int if_is_up; /* the interface is currently up */
static u_int32_t ifaddrs[2]; /* local and remote addresses we set */
static u_int32_t default_route_gateway; /* gateway addr for default route */
static u_int32_t proxy_arp_addr; /* remote addr for proxy arp */
@ -120,7 +121,8 @@ sys_cleanup()
ioctl(sockfd, SIOCSIFFLAGS, &ifr);
}
}
if (ifaddrs[0] != 0)
cifaddr(0, ifaddrs[0], ifaddrs[1]);
if (default_route_gateway)
cifdefaultroute(0, default_route_gateway);
if (proxy_arp_addr)
@ -981,6 +983,8 @@ sifaddr(u, o, h, m)
syslog(LOG_WARNING,
"Couldn't set interface address: Address already exists");
}
ifaddrs[0] = o;
ifaddrs[1] = h;
return 1;
}
@ -995,6 +999,7 @@ cifaddr(u, o, h)
{
struct ifaliasreq ifra;
ifaddrs[0] = 0;
strncpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name));
SET_SA_FAMILY(ifra.ifra_addr, AF_INET);
((struct sockaddr_in *) &ifra.ifra_addr)->sin_addr.s_addr = o;