X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=708b9b03cd0964d34c9dcae1d4278097cf7bead5;hp=872986a656cc2390be872528bd6f6704e23482dc;hb=41c8ffa6a890e3fa0f65ba266800d065d445c1ad;hpb=a3396b002507d72b3e1f1169bd02ae018539654b diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 872986a..708b9b0 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-bsd.c,v 1.13 1994/09/21 06:47:37 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.15 1994/10/23 11:45:47 paulus Exp $"; #endif /* @@ -27,6 +27,7 @@ static char rcsid[] = "$Id: sys-bsd.c,v 1.13 1994/09/21 06:47:37 paulus Exp $"; */ #include +#include #include #include #include @@ -326,8 +327,8 @@ read_packet(buf) int len; if ((len = read(fd, buf, PPP_MTU + PPP_HDRLEN)) < 0) { - if (errno == EWOULDBLOCK) { - MAINDEBUG((LOG_DEBUG, "read(fd): EWOULDBLOCK")); + if (errno == EWOULDBLOCK || errno == EINTR) { + MAINDEBUG((LOG_DEBUG, "read(fd): %m")); return -1; } syslog(LOG_ERR, "read(fd): %m"); @@ -501,6 +502,10 @@ sifvjcomp(u, vjcomp, cidcomp, maxcid) /* * sifup - Config the interface up and enable IP packets to pass. */ +#ifndef SC_ENABLE_IP +#define SC_ENABLE_IP 0x100 /* compat for old versions of kernel code */ +#endif + int sifup(u) int u; @@ -905,7 +910,8 @@ get_ether_addr(ipaddr, hwaddr) * address on the same subnet as `ipaddr'. */ ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ) { + for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) + ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { if (ifr->ifr_addr.sa_family == AF_INET) { ina = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); @@ -930,7 +936,6 @@ get_ether_addr(ipaddr, hwaddr) break; } - ifr = (struct ifreq *) ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len); } if (ifr >= ifend)