summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1998-06-28 09:41:46 +0000
committerbrian <brian@cvs.openbsd.org>1998-06-28 09:41:46 +0000
commit8450d1a683f097861d2675e8d8c28164c4bdac1c (patch)
tree95c3fe45271b174e98c82903b21d288f993b5bce /usr.sbin/ppp
parent26708466d70aa1cf138b44070b2dcc110f5d469a (diff)
Don't assume sizeof(long) == 4
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/ccp.h6
-rw-r--r--usr.sbin/ppp/command.c4
-rw-r--r--usr.sbin/ppp/fsm.c10
-rw-r--r--usr.sbin/ppp/iplist.h7
-rw-r--r--usr.sbin/ppp/lcp.c6
-rw-r--r--usr.sbin/ppp/lqr.c6
-rw-r--r--usr.sbin/ppp/main.c10
-rw-r--r--usr.sbin/ppp/os.c4
-rw-r--r--usr.sbin/ppp/timer.c4
9 files changed, 29 insertions, 28 deletions
diff --git a/usr.sbin/ppp/ccp.h b/usr.sbin/ppp/ccp.h
index a7bce9fa5f4..fea7f973c7d 100644
--- a/usr.sbin/ppp/ccp.h
+++ b/usr.sbin/ppp/ccp.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ccp.h,v 1.5 1998/01/11 17:54:45 brian Exp $
+ * $Id: ccp.h,v 1.6 1998/06/28 09:41:35 brian Exp $
*
* TODO:
*/
@@ -48,8 +48,8 @@ struct ccpstate {
int out_init; /* Init called for out algorithm */
int in_init; /* Init called for in algorithm */
- u_long uncompout, compout;
- u_long uncompin, compin;
+ u_long uncompout, compout; /* Outgoing bytes before/after compression */
+ u_long uncompin, compin; /* Incoming bytes after/before decompression */
};
extern struct ccpstate CcpInfo;
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 1402792ba9d..7f78149c1ac 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.30 1998/06/07 17:10:33 brian Exp $
+ * $Id: command.c,v 1.31 1998/06/28 09:41:37 brian Exp $
*
*/
#include <sys/param.h>
@@ -1330,7 +1330,7 @@ SetVariable(struct cmdargs const *arg)
{
u_long map;
const char *argp;
- int param = (int)arg->data;
+ long param = (long)arg->data;
if (arg->argc > 0)
argp = *arg->argv;
diff --git a/usr.sbin/ppp/fsm.c b/usr.sbin/ppp/fsm.c
index 4bc97622424..079fd718c56 100644
--- a/usr.sbin/ppp/fsm.c
+++ b/usr.sbin/ppp/fsm.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: fsm.c,v 1.6 1998/01/20 22:46:24 brian Exp $
+ * $Id: fsm.c,v 1.7 1998/06/28 09:41:38 brian Exp $
*
* TODO:
* o Refer loglevel for log output
@@ -685,10 +685,10 @@ static void
FsmRecvEchoReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
{
u_char *cp;
- u_long *lp, magic;
+ u_int32_t *lp, magic;
cp = MBUF_CTOP(bp);
- lp = (u_long *) cp;
+ lp = (u_int32_t *) cp;
magic = ntohl(*lp);
if (magic != LcpInfo.his_magic) {
LogPrintf(LogERROR, "RecvEchoReq: his magic is bad!!\n");
@@ -705,9 +705,9 @@ FsmRecvEchoReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
static void
FsmRecvEchoRep(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
{
- u_long *lp, magic;
+ u_int32_t *lp, magic;
- lp = (u_long *) MBUF_CTOP(bp);
+ lp = (u_int32_t *) MBUF_CTOP(bp);
magic = ntohl(*lp);
/*
* Tolerate echo replies with either magic number
diff --git a/usr.sbin/ppp/iplist.h b/usr.sbin/ppp/iplist.h
index acdb584d925..6d348034ad6 100644
--- a/usr.sbin/ppp/iplist.h
+++ b/usr.sbin/ppp/iplist.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iplist.h,v 1.2 1997/12/21 14:27:06 brian Exp $
+ * $Id: iplist.h,v 1.3 1998/06/28 09:41:39 brian Exp $
*/
struct iplist {
@@ -31,8 +31,9 @@ struct iplist {
struct in_addr ip;
int pos;
char *srcptr;
- int srcitem;
- u_long lstart, nItems;
+ u_long srcitem;
+ u_int32_t lstart;
+ u_long nItems;
} cur;
int nItems;
char src[LINE_LEN];
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index b0e4cea81cc..fe0e29d662c 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.10 1998/06/27 12:06:44 brian Exp $
+ * $Id: lcp.c,v 1.11 1998/06/28 09:41:40 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -261,7 +261,7 @@ do { \
do { \
o.id = ty; \
o.len = 6; \
- *(u_long *)o.data = htonl(arg); \
+ *(u_int32_t *)o.data = htonl(arg); \
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], "0x%08lx", (u_long)arg);\
} while (0)
@@ -281,7 +281,7 @@ do { \
o.id = TY_QUALPROTO; \
o.len = 8; \
*(u_short *)o.data = htons(PROTO_LQR); \
- *(u_long *)(o.data+2) = htonl(period); \
+ *(u_int32_t *)(o.data+2) = htonl(period); \
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], \
"period %ld", (u_long)period); \
} while (0)
diff --git a/usr.sbin/ppp/lqr.c b/usr.sbin/ppp/lqr.c
index 2d663cbcc02..2ccd99cf0be 100644
--- a/usr.sbin/ppp/lqr.c
+++ b/usr.sbin/ppp/lqr.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lqr.c,v 1.6 1998/06/26 19:07:14 brian Exp $
+ * $Id: lqr.c,v 1.7 1998/06/28 09:41:41 brian Exp $
*
* o LQR based on RFC1333
*
@@ -191,7 +191,7 @@ LqrInput(struct mbuf * bp)
*/
if (LqrTimer.load == 0 || lastpeerin == HisLqrData.PeerInLQRs ||
(LqrTimer.arg &&
- LqrTimer.rest * 100 / SECTICKS > (u_int32_t)LqrTimer.arg)) {
+ LqrTimer.rest * 100 / SECTICKS > (u_long)LqrTimer.arg)) {
lqmmethod |= LQM_LQR;
SendLqrReport(LqrTimer.arg);
}
@@ -229,7 +229,7 @@ StartLqm()
LqrTimer.state = TIMER_STOPPED;
LqrTimer.load = lcp->want_lqrperiod * SECTICKS / 100;
LqrTimer.func = SendLqrReport;
- LqrTimer.arg = (void *)lcp->his_lqrperiod;
+ LqrTimer.arg = (void *)(u_long)lcp->his_lqrperiod;
SendLqrReport(LqrTimer.arg);
} else {
LqrTimer.load = 0;
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index f815b10041e..bbbc33a16c7 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.19 1998/06/27 12:06:46 brian Exp $
+ * $Id: main.c,v 1.20 1998/06/28 09:41:43 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -750,7 +750,7 @@ DoLoop(void)
int pri, i, n, wfd, nfds;
char hisaddr[ADDRSZ];
struct sockaddr *sa = (struct sockaddr *)hisaddr;
- struct sockaddr_in *sin = (struct sockaddr_in *)hisaddr;
+ struct sockaddr_in *sockin = (struct sockaddr_in *)hisaddr;
struct timeval timeout, *tp;
int ssize = ADDRSZ;
const u_char *cp;
@@ -974,15 +974,15 @@ DoLoop(void)
LogPrintf(LogPHASE, "Connected to local client.\n");
break;
case AF_INET:
- if (ntohs(sin->sin_port) < 1024) {
+ if (ntohs(sockin->sin_port) < 1024) {
LogPrintf(LogALERT, "Rejected client connection from %s:%u"
"(invalid port number) !\n",
- inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
+ inet_ntoa(sockin->sin_addr), ntohs(sockin->sin_port));
close(wfd);
continue;
}
LogPrintf(LogPHASE, "Connected to client from %s:%u\n",
- inet_ntoa(sin->sin_addr), sin->sin_port);
+ inet_ntoa(sockin->sin_addr), sockin->sin_port);
break;
default:
write(wfd, "Unrecognised access !\n", 22);
diff --git a/usr.sbin/ppp/os.c b/usr.sbin/ppp/os.c
index d7c6b1fadab..752b5d23251 100644
--- a/usr.sbin/ppp/os.c
+++ b/usr.sbin/ppp/os.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: os.c,v 1.9 1998/05/19 21:56:12 brian Exp $
+ * $Id: os.c,v 1.10 1998/06/28 09:41:44 brian Exp $
*
*/
#include <sys/param.h>
@@ -69,7 +69,7 @@ SetIpDevice(struct in_addr myaddr,
{
struct sockaddr_in *sock_in;
int s;
- u_long mask, addr;
+ u_int32_t mask, addr;
s = ID0socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 173622a5a0e..fcaa240b39c 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: timer.c,v 1.4 1998/01/21 02:13:41 brian Exp $
+ * $Id: timer.c,v 1.5 1998/06/28 09:41:45 brian Exp $
*
* TODO:
*/
@@ -142,7 +142,7 @@ StopTimerNoBlock(struct pppTimer * tp)
}
static void
-TimerService()
+TimerService(void)
{
struct pppTimer *tp, *exp, *wt;