* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: chap.c,v 1.23 1999/08/13 06:46:11 paulus Exp $"
+#define RCSID "$Id: chap.c,v 1.24 1999/11/15 01:51:50 paulus Exp $"
/*
* TODO:
{
int chal_len;
u_char *ptr = cstate->challenge;
- unsigned int i;
+ int i;
/* pick a random challenge length between MIN_CHALLENGE_LENGTH and
MAX_CHALLENGE_LENGTH */
cstate->chal_transmits = 0;
/* generate a random string */
- for (i = 0; i < chal_len; i++ )
+ for (i = 0; i < chal_len; i++)
*ptr++ = (char) (drand48() * 0xff);
}
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: fsm.h,v 1.7 1997/04/30 05:52:37 paulus Exp $
+ * $Id: fsm.h,v 1.8 1999/11/15 01:51:50 paulus Exp $
*/
/*
* Packet header = Code, id, length.
*/
-#define HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short))
+#define HEADERLEN 4
/*
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: ipcp.c,v 1.50 1999/08/24 05:31:09 paulus Exp $"
+#define RCSID "$Id: ipcp.c,v 1.51 1999/11/15 01:51:51 paulus Exp $"
/*
* TODO:
struct hostent *hp;
dns = inet_addr(*argv);
- if (dns == -1) {
+ if (dns == (u_int32_t) -1) {
if ((hp = gethostbyname(*argv)) == NULL) {
option_error("invalid address parameter '%s' for ms-dns option",
*argv);
struct hostent *hp;
wins = inet_addr(*argv);
- if (wins == -1) {
+ if (wins == (u_int32_t) -1) {
if ((hp = gethostbyname(*argv)) == NULL) {
option_error("invalid address parameter '%s' for ms-wins option",
*argv);
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: lcp.c,v 1.45 1999/09/11 12:08:56 paulus Exp $";
+#define RCSID "$Id: lcp.c,v 1.46 1999/11/15 01:51:51 paulus Exp $";
/*
* TODO:
lcp_options lcp_hisoptions[NUM_PPP]; /* Options that we ack'd */
u_int32_t xmit_accm[NUM_PPP][8]; /* extended transmit ACCM */
-static u_int32_t lcp_echos_pending = 0; /* Number of outstanding echo msgs */
-static u_int32_t lcp_echo_number = 0; /* ID number of next echo frame */
-static u_int32_t lcp_echo_timer_running = 0; /* set if a timer is running */
+static int lcp_echos_pending = 0; /* Number of outstanding echo msgs */
+static int lcp_echo_number = 0; /* ID number of next echo frame */
+static int lcp_echo_timer_running = 0; /* set if a timer is running */
static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */
struct protent *protp;
u_short prot;
- if (len < sizeof (u_short)) {
+ if (len < 2) {
LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!"));
return;
}
static void
lcp_received_echo_reply (f, id, inp, len)
fsm *f;
- int id; u_char *inp; int len;
+ int id;
+ u_char *inp;
+ int len;
{
u_int32_t magic;
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: options.c,v 1.66 1999/09/11 12:08:58 paulus Exp $"
+#define RCSID "$Id: options.c,v 1.67 1999/11/15 01:51:52 paulus Exp $"
#include <ctype.h>
#include <stdio.h>
*/
if (colon != arg) {
*colon = '\0';
- if ((local = inet_addr(arg)) == -1) {
+ if ((local = inet_addr(arg)) == (u_int32_t) -1) {
if ((hp = gethostbyname(arg)) == NULL) {
option_error("unknown host: %s", arg);
return -1;
* If colon last character, then no remote addr.
*/
if (*++colon != '\0') {
- if ((remote = inet_addr(colon)) == -1) {
+ if ((remote = inet_addr(colon)) == (u_int32_t) -1) {
if ((hp = gethostbyname(colon)) == NULL) {
option_error("unknown host: %s", colon);
return -1;
b = strtoul(p, &endp, 0);
if (endp == p)
break;
- if (b < 0 || b > 255) {
+ if (b > 255) {
if (n == 3) {
/* accept e.g. 0xffffff00 */
p = endp;
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: upap.c,v 1.21 1999/09/11 12:09:00 paulus Exp $"
+#define RCSID "$Id: upap.c,v 1.22 1999/11/15 01:51:53 paulus Exp $"
/*
* TODO:
/*
* Parse user/passwd.
*/
- if (len < sizeof (u_char)) {
+ if (len < 1) {
UPAPDEBUG(("pap_rauth: rcvd short packet."));
return;
}
/*
* Parse message.
*/
- if (len < sizeof (u_char)) {
+ if (len < 1) {
UPAPDEBUG(("pap_rauthack: ignoring missing msg-length."));
} else {
GETCHAR(msglen, inp);
/*
* Parse message.
*/
- if (len < sizeof (u_char)) {
+ if (len < 1) {
UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length."));
} else {
GETCHAR(msglen, inp);
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: upap.h,v 1.6 1996/07/01 01:21:45 paulus Exp $
+ * $Id: upap.h,v 1.7 1999/11/15 01:51:54 paulus Exp $
*/
/*
* Packet header = Code, id, length.
*/
-#define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short))
+#define UPAP_HEADERLEN 4
/*