X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fipxcp.c;h=f0ee696854f9c63626a757af18059daf73306de6;hb=427e3d851c86e35655e14f1dfa9c831a8fab94d9;hp=8fc05393d618d205d588230d7d2ba44c3d92911b;hpb=f53a48eb9d74db3c71938e114b7f489c339bc003;p=ppp.git diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c index 8fc0539..f0ee696 100644 --- a/pppd/ipxcp.c +++ b/pppd/ipxcp.c @@ -42,7 +42,7 @@ #ifdef IPX_CHANGE -#define RCSID "$Id: ipxcp.c,v 1.21 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: ipxcp.c,v 1.24 2005/08/25 23:59:34 paulus Exp $" /* * TODO: @@ -82,7 +82,7 @@ static void ipxcp_resetci __P((fsm *)); /* Reset our CI */ static int ipxcp_cilen __P((fsm *)); /* Return length of our CI */ static void ipxcp_addci __P((fsm *, u_char *, int *)); /* Add our CI */ static int ipxcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int ipxcp_nakci __P((fsm *, u_char *, int)); /* Peer nak'd our CI */ +static int ipxcp_nakci __P((fsm *, u_char *, int, int));/* Peer nak'd our CI */ static int ipxcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ static int ipxcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv CI */ static void ipxcp_up __P((fsm *)); /* We're UP */ @@ -763,10 +763,11 @@ ipxcp_ackci(f, p, len) */ static int -ipxcp_nakci(f, p, len) +ipxcp_nakci(f, p, len, treat_as_reject) fsm *f; u_char *p; int len; + int treat_as_reject; { u_char citype, cilen, *next; u_short s; @@ -777,11 +778,11 @@ ipxcp_nakci(f, p, len) BZERO(&no, sizeof(no)); try = *go; - while (len > CILEN_VOID) { + while (len >= CILEN_VOID) { GETCHAR (citype, p); GETCHAR (cilen, p); len -= cilen; - if (len < 0) + if (cilen < CILEN_VOID || len < 0) goto bad; next = &p [cilen - CILEN_VOID]; @@ -792,7 +793,9 @@ ipxcp_nakci(f, p, len) no.neg_nn = 1; GETLONG(l, p); - if (l && ao->accept_network) + if (treat_as_reject) + try.neg_nn = 0; + else if (l && ao->accept_network) try.our_network = l; break; @@ -801,8 +804,10 @@ ipxcp_nakci(f, p, len) goto bad; no.neg_node = 1; - if (!zero_node (p) && ao->accept_local && - ! compare_node (p, ho->his_node)) + if (treat_as_reject) + try.neg_node = 0; + else if (!zero_node (p) && ao->accept_local && + ! compare_node (p, ho->his_node)) copy_node (p, try.our_node); break; @@ -1453,7 +1458,7 @@ ipxcp_script(f, script) argv[11] = ipparam; argv[12] = strpid; argv[13] = NULL; - run_program(script, argv, 0, NULL, NULL); + run_program(script, argv, 0, NULL, NULL, 0); } /*