Make gcc-2.8.1 build ppp cleanly.

Support OpenBSD again.
This commit is contained in:
Brian Somers 1998-04-25 10:49:52 +00:00
parent 9592529e9d
commit e43ebac1c2
19 changed files with 107 additions and 64 deletions

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.36.2.9 1998/04/03 19:25:19 brian Exp $ # $Id: Makefile,v 1.36.2.10 1998/04/16 00:25:45 brian Exp $
PROG= ppp PROG= ppp
SRCS= arp.c async.c auth.c bundle.c ccp.c chap.c chat.c command.c \ SRCS= arp.c async.c auth.c bundle.c ccp.c chap.c chat.c command.c \
@ -7,13 +7,20 @@ SRCS= arp.c async.c auth.c bundle.c ccp.c chap.c chat.c command.c \
mp.c pap.c physical.c pred.c prompt.c route.c server.c sig.c \ mp.c pap.c physical.c pred.c prompt.c route.c server.c sig.c \
slcompress.c systems.c throughput.c timer.c tun.c vjcomp.c slcompress.c systems.c throughput.c timer.c tun.c vjcomp.c
CFLAGS+=-Wall -Wpointer-arith CFLAGS+=-Wall -Wpointer-arith
LDADD+= -lmd -lcrypt -lutil -lz LDADD+= -lutil -lz
DPADD+= ${LIBMD} ${LIBCRYPT} ${LIBUTIL} ${LIBZ} DPADD+= ${LIBMD} ${LIBCRYPT} ${LIBUTIL} ${LIBZ}
MAN8= ppp.8
BINMODE=4550 BINMODE=4550
BINOWN= root BINOWN= root
BINGRP= network BINGRP= network
OPSYS!= uname -s
.if (${OPSYS} == "OpenBSD")
MAN= ppp.8
.else
MAN8= ppp.8
LDADD+= -lmd -lcrypt
.endif
.if defined(RELEASE_CRUNCH) .if defined(RELEASE_CRUNCH)
CFLAGS+=-DRELEASE_CRUNCH CFLAGS+=-DRELEASE_CRUNCH
.endif .endif

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: bundle.c,v 1.1.2.60 1998/04/24 19:15:34 brian Exp $ * $Id: bundle.c,v 1.1.2.61 1998/04/24 19:15:57 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -35,6 +35,7 @@
#include <net/if_dl.h> #include <net/if_dl.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#include <net/if_tun.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -680,7 +681,7 @@ bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
cp = rtmes.m_space; cp = rtmes.m_space;
memcpy(cp, &rtdata, rtdata.sin_len); memcpy(cp, &rtdata, rtdata.sin_len);
cp += rtdata.sin_len; cp += rtdata.sin_len;
if (cmd == RTM_ADD) if (cmd == RTM_ADD) {
if (gateway.s_addr == INADDR_ANY) { if (gateway.s_addr == INADDR_ANY) {
/* Add a route through the interface */ /* Add a route through the interface */
struct sockaddr_dl dl; struct sockaddr_dl dl;
@ -706,6 +707,7 @@ bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
cp += rtdata.sin_len; cp += rtdata.sin_len;
rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
} }
}
if (dst.s_addr == INADDR_ANY) if (dst.s_addr == INADDR_ANY)
mask.s_addr = INADDR_ANY; mask.s_addr = INADDR_ANY;
@ -728,7 +730,7 @@ bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
LogPrintf(LogTCPIP, "bundle_SetRoute: Mask = %s\n", inet_ntoa(mask)); LogPrintf(LogTCPIP, "bundle_SetRoute: Mask = %s\n", inet_ntoa(mask));
failed: failed:
if (cmd == RTM_ADD && (rtmes.m_rtm.rtm_errno == EEXIST || if (cmd == RTM_ADD && (rtmes.m_rtm.rtm_errno == EEXIST ||
(rtmes.m_rtm.rtm_errno == 0 && errno == EEXIST))) (rtmes.m_rtm.rtm_errno == 0 && errno == EEXIST))) {
if (!bang) if (!bang)
LogPrintf(LogWARN, "Add route failed: %s already exists\n", LogPrintf(LogWARN, "Add route failed: %s already exists\n",
inet_ntoa(dst)); inet_ntoa(dst));
@ -737,7 +739,7 @@ failed:
if ((wb = ID0write(s, &rtmes, nb)) < 0) if ((wb = ID0write(s, &rtmes, nb)) < 0)
goto failed; goto failed;
} }
else if (cmd == RTM_DELETE && } else if (cmd == RTM_DELETE &&
(rtmes.m_rtm.rtm_errno == ESRCH || (rtmes.m_rtm.rtm_errno == ESRCH ||
(rtmes.m_rtm.rtm_errno == 0 && errno == ESRCH))) { (rtmes.m_rtm.rtm_errno == 0 && errno == ESRCH))) {
if (!bang) if (!bang)

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: ccp.c,v 1.30.2.37 1998/04/24 19:15:23 brian Exp $ * $Id: ccp.c,v 1.30.2.38 1998/04/24 19:15:36 brian Exp $
* *
* TODO: * TODO:
* o Support other compression protocols * o Support other compression protocols
@ -463,7 +463,7 @@ CcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
cp += cp[1]; cp += cp[1];
} }
if (mode_type != MODE_NOP) if (mode_type != MODE_NOP) {
if (dec->rejend != dec->rej) { if (dec->rejend != dec->rej) {
/* rejects are preferred */ /* rejects are preferred */
dec->ackend = dec->ack; dec->ackend = dec->ack;
@ -481,6 +481,7 @@ CcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
} }
} }
} }
}
void void
CcpInput(struct ccp *ccp, struct bundle *bundle, struct mbuf *bp) CcpInput(struct ccp *ccp, struct bundle *bundle, struct mbuf *bp)
@ -542,7 +543,7 @@ ccp_Decompress(struct ccp *ccp, u_short *proto, struct mbuf *bp)
* If proto isn't PROTO_[I]COMPD, we still want to pass it to the * If proto isn't PROTO_[I]COMPD, we still want to pass it to the
* decompression routines so that the dictionary's updated * decompression routines so that the dictionary's updated
*/ */
if (ccp->fsm.state == ST_OPENED) if (ccp->fsm.state == ST_OPENED) {
if (*proto == PROTO_COMPD || *proto == PROTO_ICOMPD) { if (*proto == PROTO_COMPD || *proto == PROTO_ICOMPD) {
/* Decompress incoming data */ /* Decompress incoming data */
if (ccp->reset_sent != -1) if (ccp->reset_sent != -1)
@ -557,6 +558,7 @@ ccp_Decompress(struct ccp *ccp, u_short *proto, struct mbuf *bp)
/* Add incoming Network Layer traffic to our dictionary */ /* Add incoming Network Layer traffic to our dictionary */
(*algorithm[ccp->in.algorithm]->i.DictSetup) (*algorithm[ccp->in.algorithm]->i.DictSetup)
(ccp->in.state, ccp, *proto, bp); (ccp->in.state, ccp, *proto, bp);
}
return bp; return bp;
} }

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: command.c,v 1.131.2.70 1998/04/24 19:15:37 brian Exp $ * $Id: command.c,v 1.131.2.71 1998/04/24 19:15:59 brian Exp $
* *
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -291,7 +291,7 @@ ShellCommand(struct cmdargs const *arg, int bg)
} }
#endif #endif
if (arg->argc == arg->argn) if (arg->argc == arg->argn) {
if (!arg->prompt) { if (!arg->prompt) {
LogPrintf(LogWARN, "Can't start an interactive shell from" LogPrintf(LogWARN, "Can't start an interactive shell from"
" a config file\n"); " a config file\n");
@ -305,6 +305,7 @@ ShellCommand(struct cmdargs const *arg, int bg)
" the foreground mode\n"); " the foreground mode\n");
return 1; return 1;
} }
}
if ((shpid = fork()) == 0) { if ((shpid = fork()) == 0) {
int dtablesize, i, fd; int dtablesize, i, fd;
@ -508,7 +509,7 @@ static int
ShowVersion(struct cmdargs const *arg) ShowVersion(struct cmdargs const *arg)
{ {
static char VarVersion[] = "PPP Version 2.0-beta"; static char VarVersion[] = "PPP Version 2.0-beta";
static char VarLocalVersion[] = "$Date: 1998/04/24 19:15:37 $"; static char VarLocalVersion[] = "$Date: 1998/04/24 19:15:59 $";
prompt_Printf(arg->prompt, "%s - %s \n", VarVersion, VarLocalVersion); prompt_Printf(arg->prompt, "%s - %s \n", VarVersion, VarLocalVersion);
return 0; return 0;
@ -1411,14 +1412,14 @@ AddCommand(struct cmdargs const *arg)
if (arg->argc != arg->argn+3 && arg->argc != arg->argn+2) if (arg->argc != arg->argn+3 && arg->argc != arg->argn+2)
return -1; return -1;
if (arg->argc == arg->argn+2) if (arg->argc == arg->argn+2) {
if (strcasecmp(arg->argv[arg->argn], "default")) if (strcasecmp(arg->argv[arg->argn], "default"))
return -1; return -1;
else { else {
dest.s_addr = netmask.s_addr = INADDR_ANY; dest.s_addr = netmask.s_addr = INADDR_ANY;
gw = 1; gw = 1;
} }
else { } else {
if (strcasecmp(arg->argv[arg->argn], "MYADDR") == 0) if (strcasecmp(arg->argv[arg->argn], "MYADDR") == 0)
dest = arg->bundle->ncp.ipcp.my_ip; dest = arg->bundle->ncp.ipcp.my_ip;
else if (strcasecmp(arg->argv[arg->argn], "HISADDR") == 0) else if (strcasecmp(arg->argv[arg->argn], "HISADDR") == 0)
@ -1444,7 +1445,7 @@ DeleteCommand(struct cmdargs const *arg)
{ {
struct in_addr dest, none; struct in_addr dest, none;
if (arg->argc == arg->argn+1) if (arg->argc == arg->argn+1) {
if(strcasecmp(arg->argv[arg->argn], "all") == 0) if(strcasecmp(arg->argv[arg->argn], "all") == 0)
DeleteIfRoutes(arg->bundle, 0); DeleteIfRoutes(arg->bundle, 0);
else { else {
@ -1458,7 +1459,7 @@ DeleteCommand(struct cmdargs const *arg)
bundle_SetRoute(arg->bundle, RTM_DELETE, dest, none, none, bundle_SetRoute(arg->bundle, RTM_DELETE, dest, none, none,
arg->cmd->args ? 1 : 0); arg->cmd->args ? 1 : 0);
} }
else } else
return -1; return -1;
return 0; return 0;
@ -1513,7 +1514,7 @@ AliasCommand(struct cmdargs const *arg)
static int static int
AliasEnable(struct cmdargs const *arg) AliasEnable(struct cmdargs const *arg)
{ {
if (arg->argc == arg->argn+1) if (arg->argc == arg->argn+1) {
if (strcasecmp(arg->argv[arg->argn], "yes") == 0) { if (strcasecmp(arg->argv[arg->argn], "yes") == 0) {
if (loadAliasHandlers() == 0) if (loadAliasHandlers() == 0)
return 0; return 0;
@ -1523,6 +1524,8 @@ AliasEnable(struct cmdargs const *arg)
unloadAliasHandlers(); unloadAliasHandlers();
return 0; return 0;
} }
}
return -1; return -1;
} }
@ -1531,7 +1534,7 @@ static int
AliasOption(struct cmdargs const *arg) AliasOption(struct cmdargs const *arg)
{ {
unsigned param = (unsigned)arg->cmd->args; unsigned param = (unsigned)arg->cmd->args;
if (arg->argc == arg->argn+1) if (arg->argc == arg->argn+1) {
if (strcasecmp(arg->argv[arg->argn], "yes") == 0) { if (strcasecmp(arg->argv[arg->argn], "yes") == 0) {
if (AliasEnabled()) { if (AliasEnabled()) {
(*PacketAlias.SetMode)(param, param); (*PacketAlias.SetMode)(param, param);
@ -1545,6 +1548,7 @@ AliasOption(struct cmdargs const *arg)
} }
LogPrintf(LogWARN, "alias not enabled\n"); LogPrintf(LogWARN, "alias not enabled\n");
} }
}
return -1; return -1;
} }
#endif /* #ifndef NOALIAS */ #endif /* #ifndef NOALIAS */

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: deflate.c,v 1.6.4.12 1998/04/24 19:15:24 brian Exp $ * $Id: deflate.c,v 1.6.4.13 1998/04/25 00:09:10 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -277,7 +277,7 @@ DeflateInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mi)
flush = Z_SYNC_FLUSH; flush = Z_SYNC_FLUSH;
} }
if (state->cx.avail_out == 0) if (state->cx.avail_out == 0) {
/* overflow */ /* overflow */
if (first) { if (first) {
if (!(wp[1] & 1)) { if (!(wp[1] & 1)) {
@ -296,6 +296,7 @@ DeflateInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mi)
state->cx.avail_out = DEFLATE_CHUNK_LEN; state->cx.avail_out = DEFLATE_CHUNK_LEN;
} }
} }
}
if (mi != NULL) if (mi != NULL)
pfree(mi); pfree(mi);

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: filter.c,v 1.22.2.15 1998/04/14 23:17:05 brian Exp $ * $Id: filter.c,v 1.22.2.16 1998/04/16 18:30:51 brian Exp $
* *
* TODO: Shoud send ICMP error message when we discard packets. * TODO: Shoud send ICMP error message when we discard packets.
*/ */
@ -228,7 +228,7 @@ ParseUdpOrTcp(int argc, char const *const *argv, int proto,
argv += 3; argv += 3;
} }
if (proto == P_TCP) if (proto == P_TCP) {
for (; argc > 0; argc--, argv++) for (; argc > 0; argc--, argv++)
if (!strcmp(*argv, "estab")) if (!strcmp(*argv, "estab"))
tgt->opt.estab = 1; tgt->opt.estab = 1;
@ -238,6 +238,7 @@ ParseUdpOrTcp(int argc, char const *const *argv, int proto,
tgt->opt.finrst = 1; tgt->opt.finrst = 1;
else else
break; break;
}
if (argc > 0) { if (argc > 0) {
LogPrintf(LogWARN, "ParseUdpOrTcp: bad src/dst port syntax: %s\n", *argv); LogPrintf(LogWARN, "ParseUdpOrTcp: bad src/dst port syntax: %s\n", *argv);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: id.c,v 1.6.4.5 1998/04/17 22:05:16 brian Exp $ * $Id: id.c,v 1.6.4.6 1998/04/19 23:08:19 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -37,6 +37,7 @@
#include <sysexits.h> #include <sysexits.h>
#include <unistd.h> #include <unistd.h>
#ifdef __OpenBSD__ #ifdef __OpenBSD__
#include <util.h>
#else #else
#include <libutil.h> #include <libutil.h>
#endif #endif

View File

@ -17,13 +17,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: ip.c,v 1.38.2.21 1998/04/07 23:45:52 brian Exp $ * $Id: ip.c,v 1.38.2.22 1998/04/16 18:30:53 brian Exp $
* *
* TODO: * TODO:
* o Return ICMP message for filterd packet * o Return ICMP message for filterd packet
* and optionaly record it into log. * and optionaly record it into log.
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/ip.h> #include <netinet/ip.h>
@ -31,6 +32,7 @@
#include <netinet/udp.h> #include <netinet/udp.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <net/if_tun.h>
#ifndef NOALIAS #ifndef NOALIAS
#include <alias.h> #include <alias.h>
@ -336,11 +338,12 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
return (-1); return (-1);
} else { } else {
/* Check Keep Alive filter */ /* Check Keep Alive filter */
if (logit) if (logit) {
if (FilterCheck(pip, &bundle->filter.alive) & A_DENY) if (FilterCheck(pip, &bundle->filter.alive) & A_DENY)
LogPrintf(LogTCPIP, "%s - NO KEEPALIVE\n", logbuf); LogPrintf(LogTCPIP, "%s - NO KEEPALIVE\n", logbuf);
else else
LogPrintf(LogTCPIP, "%s\n", logbuf); LogPrintf(LogTCPIP, "%s\n", logbuf);
}
return (pri); return (pri);
} }
} }
@ -398,12 +401,13 @@ IpInput(struct bundle *bundle, struct mbuf * bp)
nb = ntohs(((struct ip *) tun.data)->ip_len); nb = ntohs(((struct ip *) tun.data)->ip_len);
nb += sizeof tun - sizeof tun.data; nb += sizeof tun - sizeof tun.data;
nw = write(bundle->tun_fd, &tun, nb); nw = write(bundle->tun_fd, &tun, nb);
if (nw != nb) if (nw != nb) {
if (nw == -1) if (nw == -1)
LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb, LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb,
strerror(errno)); strerror(errno));
else else
LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw); LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw);
}
if (iresult == PKT_ALIAS_FOUND_HEADER_FRAGMENT) { if (iresult == PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
while ((fptr = (*PacketAlias.GetFragment)(tun.data)) != NULL) { while ((fptr = (*PacketAlias.GetFragment)(tun.data)) != NULL) {
@ -413,12 +417,13 @@ IpInput(struct bundle *bundle, struct mbuf * bp)
((char *)fptr - sizeof tun + sizeof tun.data); ((char *)fptr - sizeof tun + sizeof tun.data);
nb += sizeof tun - sizeof tun.data; nb += sizeof tun - sizeof tun.data;
nw = write(bundle->tun_fd, frag, nb); nw = write(bundle->tun_fd, frag, nb);
if (nw != nb) if (nw != nb) {
if (nw == -1) if (nw == -1)
LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb, LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb,
strerror(errno)); strerror(errno));
else else
LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw); LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw);
}
free(frag); free(frag);
} }
} }
@ -449,12 +454,13 @@ IpInput(struct bundle *bundle, struct mbuf * bp)
nb += sizeof tun - sizeof tun.data; nb += sizeof tun - sizeof tun.data;
nw = write(bundle->tun_fd, &tun, nb); nw = write(bundle->tun_fd, &tun, nb);
if (nw != nb) if (nw != nb) {
if (nw == -1) if (nw == -1)
LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb, strerror(errno)); LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb, strerror(errno));
else else
LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw); LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw);
} }
}
pfree(bp); pfree(bp);
} }

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: ipcp.c,v 1.50.2.44 1998/04/24 19:15:39 brian Exp $ * $Id: ipcp.c,v 1.50.2.45 1998/04/25 00:09:11 brian Exp $
* *
* TODO: * TODO:
* o More RFC1772 backwoard compatibility * o More RFC1772 backwoard compatibility
@ -562,7 +562,7 @@ IpcpSendConfigReq(struct fsm *fp)
INC_LCP_OPT(TY_IPADDR, 6, o); INC_LCP_OPT(TY_IPADDR, 6, o);
} }
if (ipcp->my_compproto && !REJECTED(ipcp, TY_COMPPROTO)) if (ipcp->my_compproto && !REJECTED(ipcp, TY_COMPPROTO)) {
if (ipcp->heis1172) { if (ipcp->heis1172) {
*(u_short *)o->data = htons(PROTO_VJCOMP); *(u_short *)o->data = htons(PROTO_VJCOMP);
INC_LCP_OPT(TY_COMPPROTO, 4, o); INC_LCP_OPT(TY_COMPPROTO, 4, o);
@ -570,6 +570,7 @@ IpcpSendConfigReq(struct fsm *fp)
*(u_long *)o->data = htonl(ipcp->my_compproto); *(u_long *)o->data = htonl(ipcp->my_compproto);
INC_LCP_OPT(TY_COMPPROTO, 6, o); INC_LCP_OPT(TY_COMPPROTO, 6, o);
} }
}
if (IsEnabled(ipcp->cfg.ns.dns_neg) && if (IsEnabled(ipcp->cfg.ns.dns_neg) &&
!REJECTED(ipcp, TY_PRIMARY_DNS - TY_ADJUST_NS) && !REJECTED(ipcp, TY_PRIMARY_DNS - TY_ADJUST_NS) &&
@ -669,13 +670,14 @@ IpcpLayerDown(struct fsm *fp)
* XXX this stuff should really live in the FSM. Our config should * XXX this stuff should really live in the FSM. Our config should
* associate executable sections in files with events. * associate executable sections in files with events.
*/ */
if (SelectSystem(fp->bundle, s, LINKDOWNFILE, NULL) < 0) if (SelectSystem(fp->bundle, s, LINKDOWNFILE, NULL) < 0) {
if (bundle_GetLabel(fp->bundle)) { if (bundle_GetLabel(fp->bundle)) {
if (SelectSystem(fp->bundle, bundle_GetLabel(fp->bundle), if (SelectSystem(fp->bundle, bundle_GetLabel(fp->bundle),
LINKDOWNFILE, NULL) < 0) LINKDOWNFILE, NULL) < 0)
SelectSystem(fp->bundle, "MYADDR", LINKDOWNFILE, NULL); SelectSystem(fp->bundle, "MYADDR", LINKDOWNFILE, NULL);
} else } else
SelectSystem(fp->bundle, "MYADDR", LINKDOWNFILE, NULL); SelectSystem(fp->bundle, "MYADDR", LINKDOWNFILE, NULL);
}
if (!(ipcp->fsm.bundle->phys_type & PHYS_DEMAND)) if (!(ipcp->fsm.bundle->phys_type & PHYS_DEMAND))
IpcpCleanInterface(ipcp); IpcpCleanInterface(ipcp);
@ -709,13 +711,15 @@ IpcpLayerUp(struct fsm *fp)
* XXX this stuff should really live in the FSM. Our config should * XXX this stuff should really live in the FSM. Our config should
* associate executable sections in files with events. * associate executable sections in files with events.
*/ */
if (SelectSystem(fp->bundle, inet_ntoa(ipcp->my_ifip), LINKUPFILE, NULL) < 0) if (SelectSystem(fp->bundle, inet_ntoa(ipcp->my_ifip), LINKUPFILE, NULL)
< 0) {
if (bundle_GetLabel(fp->bundle)) { if (bundle_GetLabel(fp->bundle)) {
if (SelectSystem(fp->bundle, bundle_GetLabel(fp->bundle), if (SelectSystem(fp->bundle, bundle_GetLabel(fp->bundle),
LINKUPFILE, NULL) < 0) LINKUPFILE, NULL) < 0)
SelectSystem(fp->bundle, "MYADDR", LINKUPFILE, NULL); SelectSystem(fp->bundle, "MYADDR", LINKUPFILE, NULL);
} else } else
SelectSystem(fp->bundle, "MYADDR", LINKUPFILE, NULL); SelectSystem(fp->bundle, "MYADDR", LINKUPFILE, NULL);
}
throughput_start(&ipcp->throughput, "IPCP throughput", throughput_start(&ipcp->throughput, "IPCP throughput",
Enabled(fp->bundle, OPT_THROUGHPUT)); Enabled(fp->bundle, OPT_THROUGHPUT));
@ -1029,7 +1033,7 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
ipcp->peer_reject |= (1 << (TY_SECONDARY_DNS - TY_ADJUST_NS)); ipcp->peer_reject |= (1 << (TY_SECONDARY_DNS - TY_ADJUST_NS));
} }
if (mode_type != MODE_NOP) if (mode_type != MODE_NOP) {
if (dec->rejend != dec->rej) { if (dec->rejend != dec->rej) {
/* rejects are preferred */ /* rejects are preferred */
dec->ackend = dec->ack; dec->ackend = dec->ack;
@ -1038,6 +1042,7 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
/* then NAKs */ /* then NAKs */
dec->ackend = dec->ack; dec->ackend = dec->ack;
} }
}
void void
IpcpInput(struct ipcp *ipcp, struct mbuf * bp) IpcpInput(struct ipcp *ipcp, struct mbuf * bp)

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: lcp.c,v 1.55.2.47 1998/04/24 19:16:05 brian Exp $ * $Id: lcp.c,v 1.55.2.48 1998/04/25 00:09:12 brian Exp $
* *
* TODO: * TODO:
* o Limit data field length by MRU * o Limit data field length by MRU
@ -637,7 +637,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
case TY_QUALPROTO: case TY_QUALPROTO:
req = (struct lqrreq *)cp; req = (struct lqrreq *)cp;
LogPrintf(LogLCP, "%s proto %x, interval %ldms\n", LogPrintf(LogLCP, "%s proto %x, interval %ldms\n",
request, ntohs(req->proto), ntohl(req->period) * 10); request, ntohs(req->proto), (long)ntohl(req->period) * 10);
switch (mode_type) { switch (mode_type) {
case MODE_REQ: case MODE_REQ:
if (ntohs(req->proto) != PROTO_LQR || !IsAccepted(lcp->cfg.lqr)) if (ntohs(req->proto) != PROTO_LQR || !IsAccepted(lcp->cfg.lqr))
@ -854,7 +854,7 @@ reqreject:
cp += length; cp += length;
} }
if (mode_type != MODE_NOP) if (mode_type != MODE_NOP) {
if (dec->rejend != dec->rej) { if (dec->rejend != dec->rej) {
/* rejects are preferred */ /* rejects are preferred */
dec->ackend = dec->ack; dec->ackend = dec->ack;
@ -863,6 +863,7 @@ reqreject:
/* then NAKs */ /* then NAKs */
dec->ackend = dec->ack; dec->ackend = dec->ack;
} }
}
void void
LcpInput(struct lcp *lcp, struct mbuf * bp) LcpInput(struct lcp *lcp, struct mbuf * bp)

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: loadalias.c,v 1.14.2.2 1998/04/07 00:53:57 brian Exp $ * $Id: loadalias.c,v 1.14.2.3 1998/04/18 01:01:23 brian Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -80,12 +80,13 @@ loadAliasHandlers()
path = _PATH_ALIAS_PREFIX; path = _PATH_ALIAS_PREFIX;
env = getenv("_PATH_ALIAS_PREFIX"); env = getenv("_PATH_ALIAS_PREFIX");
if (env) if (env) {
if (ID0realuid() == 0) if (ID0realuid() == 0)
path = env; path = env;
else else
LogPrintf(LogALERT, "Ignoring environment _PATH_ALIAS_PREFIX" LogPrintf(LogALERT, "Ignoring environment _PATH_ALIAS_PREFIX"
" value (%s)\n", env); " value (%s)\n", env);
}
PacketAlias.dl = dlopen(path, RTLD_NOW); PacketAlias.dl = dlopen(path, RTLD_NOW);
if (PacketAlias.dl == (void *) 0) { if (PacketAlias.dl == (void *) 0) {

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: log.c,v 1.25.2.9 1998/04/24 19:15:43 brian Exp $ * $Id: log.c,v 1.25.2.10 1998/04/24 19:16:05 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -341,22 +341,23 @@ log_SetLevel(struct cmdargs const *arg)
local = 1; local = 1;
} }
if (argc == 0 || (argv[0][0] != '+' && argv[0][0] != '-')) if (argc == 0 || (argv[0][0] != '+' && argv[0][0] != '-')) {
if (local) if (local)
LogDiscardAllLocal(&arg->prompt->logmask); LogDiscardAllLocal(&arg->prompt->logmask);
else else
LogDiscardAll(); LogDiscardAll();
}
while (argc--) { while (argc--) {
argp = **argv == '+' || **argv == '-' ? *argv + 1 : *argv; argp = **argv == '+' || **argv == '-' ? *argv + 1 : *argv;
for (i = LogMIN; i <= LogMAX; i++) for (i = LogMIN; i <= LogMAX; i++)
if (strcasecmp(argp, LogName(i)) == 0) { if (strcasecmp(argp, LogName(i)) == 0) {
if (**argv == '-') if (**argv == '-') {
if (local) if (local)
LogDiscardLocal(i, &arg->prompt->logmask); LogDiscardLocal(i, &arg->prompt->logmask);
else else
LogDiscard(i); LogDiscard(i);
else if (local) } else if (local)
LogKeepLocal(i, &arg->prompt->logmask); LogKeepLocal(i, &arg->prompt->logmask);
else else
LogKeep(i); LogKeep(i);

View File

@ -17,16 +17,18 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: main.c,v 1.121.2.49 1998/04/16 00:26:08 brian Exp $ * $Id: main.c,v 1.121.2.50 1998/04/23 03:22:58 brian Exp $
* *
* TODO: * TODO:
*/ */
#include <sys/param.h> #include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#include <sys/un.h> #include <sys/un.h>
#include <net/if_tun.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -581,7 +583,7 @@ DoLoop(struct bundle *bundle, struct prompt *prompt)
* Process on-demand dialup. Output packets are queued within tunnel * Process on-demand dialup. Output packets are queued within tunnel
* device until IPCP is opened. * device until IPCP is opened.
*/ */
if (bundle_Phase(bundle) == PHASE_DEAD) if (bundle_Phase(bundle) == PHASE_DEAD) {
/* /*
* Note, we must be in AUTO mode :-/ otherwise our interface should * Note, we must be in AUTO mode :-/ otherwise our interface should
* *not* be UP and we can't receive data * *not* be UP and we can't receive data
@ -597,6 +599,7 @@ DoLoop(struct bundle *bundle, struct prompt *prompt)
* device - breaking auto-dial. * device - breaking auto-dial.
*/ */
continue; continue;
}
pri = PacketCheck(bundle, tun.data, n, &bundle->filter.out); pri = PacketCheck(bundle, tun.data, n, &bundle->filter.out);
if (pri >= 0) { if (pri >= 0) {

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: modem.c,v 1.77.2.56 1998/04/24 19:16:07 brian Exp $ * $Id: modem.c,v 1.77.2.57 1998/04/25 00:09:28 brian Exp $
* *
* TODO: * TODO:
*/ */
@ -35,9 +35,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/ioctl.h>
#include <sys/tty.h> #include <sys/tty.h>
#include <unistd.h> #include <unistd.h>
#ifdef __OpenBSD__ #ifdef __OpenBSD__
#include <util.h>
#else #else
#include <libutil.h> #include <libutil.h>
#endif #endif
@ -572,8 +574,8 @@ modem_Open(struct physical *modem, struct bundle *bundle)
tcgetattr(modem->fd, &rstio); tcgetattr(modem->fd, &rstio);
modem->ios = rstio; modem->ios = rstio;
LogPrintf(LogDEBUG, "modem_Open: modem (get): fd = %d, iflag = %lx, " LogPrintf(LogDEBUG, "modem_Open: modem (get): fd = %d, iflag = %lx, "
"oflag = %lx, cflag = %lx\n", modem->fd, rstio.c_iflag, "oflag = %lx, cflag = %lx\n", modem->fd, (u_long)rstio.c_iflag,
rstio.c_oflag, rstio.c_cflag); (u_long)rstio.c_oflag, (u_long)rstio.c_cflag);
cfmakeraw(&rstio); cfmakeraw(&rstio);
if (modem->cfg.rts_cts) if (modem->cfg.rts_cts)
rstio.c_cflag |= CLOCAL | CCTS_OFLOW | CRTS_IFLOW; rstio.c_cflag |= CLOCAL | CCTS_OFLOW | CRTS_IFLOW;
@ -595,9 +597,10 @@ modem_Open(struct physical *modem, struct bundle *bundle)
} }
tcsetattr(modem->fd, TCSADRAIN, &rstio); tcsetattr(modem->fd, TCSADRAIN, &rstio);
LogPrintf(LogDEBUG, "modem (put): iflag = %lx, oflag = %lx, cflag = %lx\n", LogPrintf(LogDEBUG, "modem (put): iflag = %lx, oflag = %lx, cflag = %lx\n",
rstio.c_iflag, rstio.c_oflag, rstio.c_cflag); (u_long)rstio.c_iflag, (u_long)rstio.c_oflag,
(u_long)rstio.c_cflag);
if (ioctl(modem->fd, TIOCMGET, &modem->mbits) == -1) if (ioctl(modem->fd, TIOCMGET, &modem->mbits) == -1) {
if (modem->type != PHYS_STDIN) { if (modem->type != PHYS_STDIN) {
LogPrintf(LogERROR, "modem_Open: Cannot get modem status: %s\n", LogPrintf(LogERROR, "modem_Open: Cannot get modem status: %s\n",
strerror(errno)); strerror(errno));
@ -605,6 +608,7 @@ modem_Open(struct physical *modem, struct bundle *bundle)
return (-1); return (-1);
} else } else
modem->mbits = TIOCM_CD; modem->mbits = TIOCM_CD;
}
LogPrintf(LogDEBUG, "modem_Open: modem control = %o\n", modem->mbits); LogPrintf(LogDEBUG, "modem_Open: modem control = %o\n", modem->mbits);
oldflag = fcntl(modem->fd, F_GETFL, 0); oldflag = fcntl(modem->fd, F_GETFL, 0);
@ -798,13 +802,13 @@ modem_ShowStatus(struct cmdargs const *arg)
prompt_Printf(arg->prompt, "Name: %s\n", modem->link.name); prompt_Printf(arg->prompt, "Name: %s\n", modem->link.name);
prompt_Printf(arg->prompt, " State: "); prompt_Printf(arg->prompt, " State: ");
if (modem->fd >= 0) if (modem->fd >= 0) {
if (isatty(modem->fd)) if (isatty(modem->fd))
prompt_Printf(arg->prompt, "open, %s carrier\n", prompt_Printf(arg->prompt, "open, %s carrier\n",
Online(modem) ? "with" : "no"); Online(modem) ? "with" : "no");
else else
prompt_Printf(arg->prompt, "open\n"); prompt_Printf(arg->prompt, "open\n");
else } else
prompt_Printf(arg->prompt, "closed\n"); prompt_Printf(arg->prompt, "closed\n");
prompt_Printf(arg->prompt, " Device: %s\n", prompt_Printf(arg->prompt, " Device: %s\n",
*modem->name.full ? modem->name.full : *modem->name.full ? modem->name.full :

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: mp.c,v 1.1.2.14 1998/04/24 19:16:20 brian Exp $ * $Id: mp.c,v 1.1.2.15 1998/04/25 00:09:21 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -678,7 +678,7 @@ mp_SetEnddisc(struct cmdargs const *arg)
mp->cfg.enddisc.class = 0; mp->cfg.enddisc.class = 0;
*mp->cfg.enddisc.address = '\0'; *mp->cfg.enddisc.address = '\0';
mp->cfg.enddisc.len = 0; mp->cfg.enddisc.len = 0;
} else if (arg->argc > arg->argn) } else if (arg->argc > arg->argn) {
if (!strcasecmp(arg->argv[arg->argn], "label")) { if (!strcasecmp(arg->argv[arg->argn], "label")) {
mp->cfg.enddisc.class = ENDDISC_LOCAL; mp->cfg.enddisc.class = ENDDISC_LOCAL;
strcpy(mp->cfg.enddisc.address, arg->bundle->cfg.label); strcpy(mp->cfg.enddisc.address, arg->bundle->cfg.label);
@ -739,6 +739,7 @@ mp_SetEnddisc(struct cmdargs const *arg)
arg->argv[arg->argn]); arg->argv[arg->argn]);
return 6; return 6;
} }
}
return 0; return 0;
} }

View File

@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: physical.c,v 1.1.2.24 1998/04/10 23:51:32 brian Exp $ * $Id: physical.c,v 1.1.2.25 1998/04/16 00:26:13 brian Exp $
* *
*/ */
@ -176,7 +176,7 @@ Physical_IsSet(struct descriptor *d, const fd_set *fdset)
void void
Physical_Login(struct physical *phys, const char *name) Physical_Login(struct physical *phys, const char *name)
{ {
if (phys->type == PHYS_STDIN && Physical_IsATTY(phys)) if (phys->type == PHYS_STDIN && Physical_IsATTY(phys)) {
if (phys->Utmp) if (phys->Utmp)
LogPrintf(LogERROR, "Oops, already logged in on %s\n", phys->name.base); LogPrintf(LogERROR, "Oops, already logged in on %s\n", phys->name.base);
else { else {
@ -190,6 +190,7 @@ Physical_Login(struct physical *phys, const char *name)
phys->Utmp = 1; phys->Utmp = 1;
} }
} }
}
void void
Physical_Logout(struct physical *phys) Physical_Logout(struct physical *phys)

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: route.c,v 1.42.2.17 1998/04/07 00:54:16 brian Exp $ * $Id: route.c,v 1.42.2.18 1998/04/19 03:41:01 brian Exp $
* *
*/ */
@ -109,8 +109,8 @@ p_sockaddr(struct prompt *prompt, struct sockaddr *phost,
case AF_LINK: case AF_LINK:
if (dl->sdl_nlen) if (dl->sdl_nlen)
snprintf(buf, sizeof buf, "%.*s", dl->sdl_nlen, dl->sdl_data); snprintf(buf, sizeof buf, "%.*s", dl->sdl_nlen, dl->sdl_data);
else if (dl->sdl_alen) else if (dl->sdl_alen) {
if (dl->sdl_type == IFT_ETHER) if (dl->sdl_type == IFT_ETHER) {
if (dl->sdl_alen < sizeof buf / 3) { if (dl->sdl_alen < sizeof buf / 3) {
int f; int f;
u_char *MAC; u_char *MAC;
@ -121,9 +121,9 @@ p_sockaddr(struct prompt *prompt, struct sockaddr *phost,
buf[f*3-1] = '\0'; buf[f*3-1] = '\0';
} else } else
strcpy(buf, "??:??:??:??:??:??"); strcpy(buf, "??:??:??:??:??:??");
else } else
sprintf(buf, "<IFT type %d>", dl->sdl_type); sprintf(buf, "<IFT type %d>", dl->sdl_type);
else if (dl->sdl_slen) } else if (dl->sdl_slen)
sprintf(buf, "<slen %d?>", dl->sdl_slen); sprintf(buf, "<slen %d?>", dl->sdl_slen);
else else
sprintf(buf, "link#%d", dl->sdl_index); sprintf(buf, "link#%d", dl->sdl_index);

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: slcompress.c,v 1.15.2.7 1998/04/07 00:54:19 brian Exp $ * $Id: slcompress.c,v 1.15.2.8 1998/04/19 23:08:58 brian Exp $
* *
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
* - Initial distribution. * - Initial distribution.
@ -519,7 +519,7 @@ sl_uncompress_tcp(u_char ** bufp, int len, u_int type,
cs->cs_ip.ip_id = htons(ntohs(cs->cs_ip.ip_id) + 1); cs->cs_ip.ip_id = htons(ntohs(cs->cs_ip.ip_id) + 1);
LogPrintf(LogDEBUG, "Uncompress: id = %04x, seq = %08lx\n", LogPrintf(LogDEBUG, "Uncompress: id = %04x, seq = %08lx\n",
cs->cs_ip.ip_id, ntohl(th->th_seq)); cs->cs_ip.ip_id, (u_long)ntohl(th->th_seq));
/* /*
* At this point, cp points to the first byte of data in the packet. If * At this point, cp points to the first byte of data in the packet. If

View File

@ -23,10 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: tun.c,v 1.6.4.12 1998/04/06 09:12:38 brian Exp $ * $Id: tun.c,v 1.6.4.13 1998/04/07 00:54:23 brian Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <net/if_tun.h> #include <net/if_tun.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>