X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=306ae4a8bca14468b89c64dc61a689e15545f1e6;hp=aa829aad9201abcbe914cddf415fef34071a2e96;hb=a115760c2c03a34dd5aa1ed7274ac49810d7dd45;hpb=9061e74eee6de8be3478fd23caa2ac9ceae586ec diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index aa829aa..306ae4a 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "pppd.h" #include "ppp.h" @@ -94,7 +94,12 @@ int set_kdebugflag (int requested_level) void establish_ppp (void) { int pppdisc = N_PPP; - int sig = SIGIO; + int sig = SIGIO; + + if (ioctl(fd, PPPIOCSINPSIG, &sig) == -1) { + syslog(LOG_ERR, "ioctl(PPPIOCSINPSIG): %m"); + die(1); + } if (ioctl(fd, TIOCEXCL, 0) < 0) { syslog (LOG_WARNING, "ioctl(TIOCEXCL): %m"); @@ -116,14 +121,6 @@ void establish_ppp (void) } set_kdebugflag (kdebugflag); - - /* - * Set the device to give us a SIGIO when data is available. - */ - if (ioctl(fd, PPPIOCSINPSIG, &sig) == -1) { - syslog(LOG_ERR, "ioctl(PPPIOCSINPSIG): %m"); - die(1); - } } /* @@ -778,16 +775,20 @@ int get_ether_addr (u_long ipaddr, struct sockaddr *hwaddr) } hwaddr->sa_family = ARPHRD_ETHER; - memcpy (&hwaddr->sa_data, &ifr->ifr_hwaddr, ETH_ALEN); +#ifndef old_ifr_hwaddr + memcpy (&hwaddr->sa_data, &ifreq.ifr_hwaddr, ETH_ALEN); +#else + memcpy (&hwaddr->sa_data, &ifreq.ifr_hwaddr.sa_data, ETH_ALEN); +#endif MAINDEBUG ((LOG_DEBUG, "proxy arp: found hwaddr %02x:%02x:%02x:%02x:%02x:%02x", - (int) ((unsigned char *) &ifr->ifr_hwaddr)[0], - (int) ((unsigned char *) &ifr->ifr_hwaddr)[1], - (int) ((unsigned char *) &ifr->ifr_hwaddr)[2], - (int) ((unsigned char *) &ifr->ifr_hwaddr)[3], - (int) ((unsigned char *) &ifr->ifr_hwaddr)[4], - (int) ((unsigned char *) &ifr->ifr_hwaddr)[5])); + (int) ((unsigned char *) &hwaddr->sa_data)[0], + (int) ((unsigned char *) &hwaddr->sa_data)[1], + (int) ((unsigned char *) &hwaddr->sa_data)[2], + (int) ((unsigned char *) &hwaddr->sa_data)[3], + (int) ((unsigned char *) &hwaddr->sa_data)[4], + (int) ((unsigned char *) &hwaddr->sa_data)[5])); return 1; }