X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fdemand.c;h=0943e8a381ad5ce8ee2b12b3438708357f0c63d1;hb=HEAD;hp=3e320798355de806223d0dd11896e19892da0930;hpb=f7307b3f74f9a2fd64acc77b0c884ed1cc9afe56;p=ppp.git diff --git a/pppd/demand.c b/pppd/demand.c index 3e32079..d8c46fe 100644 --- a/pppd/demand.c +++ b/pppd/demand.c @@ -1,7 +1,7 @@ /* * demand.c - Support routines for demand-dialling. * - * Copyright (c) 1996-2002 Paul Mackerras. All rights reserved. + * Copyright (c) 1996-2024 Paul Mackerras. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +10,10 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. The name(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 3. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Paul Mackerras - * ". + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. * * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY @@ -28,8 +24,6 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: demand.c,v 1.20 2005/08/25 12:14:18 paulus Exp $" - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -51,7 +45,7 @@ #include #endif -#include "pppd.h" +#include "pppd-private.h" #include "fsm.h" #include "ipcp.h" #include "lcp.h" @@ -97,7 +91,7 @@ demand_conf(void) flush_flag = 0; fcs = PPP_INITFCS; - netif_set_mtu(0, MIN(lcp_allowoptions[0].mru, PPP_MRU)); + ppp_set_mtu(0, MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0 || ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0) fatal("Couldn't set up demand-dialled PPP interface: %m"); @@ -210,6 +204,7 @@ static u_short fcstab[256] = { 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; +#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff]) /* * loop_chars - process characters received from the loopback.