*/
#ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.14 1994/10/24 04:31:11 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.19 1995/06/01 01:30:38 paulus Exp $";
#endif
/*
case CI_ADDR:
if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR)
goto bad;
- try.neg_addr = 1;
try.old_addrs = 0;
GETLONG(l, p);
ciaddr1 = htonl(l);
if (ciaddr1 && go->accept_local)
try.ouraddr = ciaddr1;
+ if (try.ouraddr != 0)
+ try.neg_addr = 1;
no.neg_addr = 1;
break;
default:
&& (ciaddr1 == 0 || !wo->accept_remote)) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof (long), p);
+ DECPTR(sizeof(u_int32_t), p);
tl = ntohl(wo->hisaddr);
PUTLONG(tl, p);
}
+ } else if (ciaddr1 == 0 && wo->hisaddr == 0) {
+ /*
+ * If neither we nor he knows his address, reject the option.
+ */
+ orc = CONFREJ;
+ wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */
+ break;
}
/*
if (ciaddr2 == 0 || !wo->accept_local) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof (long), p);
+ DECPTR(sizeof(u_int32_t), p);
tl = ntohl(wo->ouraddr);
PUTLONG(tl, p);
}
&& (ciaddr1 == 0 || !wo->accept_remote)) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof (long), p);
+ DECPTR(sizeof(u_int32_t), p);
tl = ntohl(wo->hisaddr);
PUTLONG(tl, p);
}
+ } else if (ciaddr1 == 0 && wo->hisaddr == 0) {
+ /*
+ * Don't ACK an address of 0.0.0.0 - reject it instead.
+ */
+ orc = CONFREJ;
+ wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */
+ break;
}
ho->neg_addr = 1;
}
}
ho->maxslotindex = maxslotindex;
- ho->cflag = wo->cflag;
+ ho->cflag = cflag;
} else {
ho->old_vj = 1;
ho->maxslotindex = MAX_STATES - 1;
argv[3] = strspeed;
argv[4] = strlocal;
argv[5] = strremote;
- argv[6] = NULL;
+ argv[6] = ipparam;
+ argv[7] = NULL;
run_program(script, argv, 0);
}