X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=dda8772da3c753ccb492c7bcf8dd9dee9b726384;hb=509f04959ad891d7f981f035ed461d51bd1f74b0;hp=94e5a19ed4c67cc44f97b2257c3b0d57b4ed15a0;hpb=80b8744eb42c7493794f3e3fe0bf1ce14f53e6dd;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 94e5a19..dda8772 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -81,6 +81,7 @@ #include #include #include +#include #include #include @@ -125,8 +126,8 @@ #include #include -#include -#include +#include + #ifdef PPP_WITH_IPV6CP #include @@ -156,11 +157,12 @@ #include "pppd.h" #include "fsm.h" #include "ipcp.h" +#include "eui64.h" -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include #include -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ #ifdef LOCKLIB #include @@ -1425,7 +1427,7 @@ void ccp_flags_set (int unit, int isopen, int isup) modify_flags(ppp_dev_fd, SC_CCP_OPEN|SC_CCP_UP, x); } -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER /* * set_filters - set the active and pass filters in the kernel driver. */ @@ -1450,7 +1452,7 @@ int set_filters(struct bpf_program *pass, struct bpf_program *active) } return 1; } -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ /******************************************************************** * @@ -1475,20 +1477,21 @@ get_ppp_stats_ioctl(int u, struct pppd_stats *stats) static u_int32_t iwraps = 0; static u_int32_t owraps = 0; - struct ifpppstatsreq req; + struct ifreq req; + struct ppp_stats data; memset (&req, 0, sizeof (req)); - req.stats_ptr = (caddr_t) &req.stats; - strlcpy(req.ifr__name, ifname, sizeof(req.ifr__name)); + req.ifr_data = (caddr_t) &data; + strlcpy(req.ifr_name, ifname, sizeof(req.ifr_name)); if (ioctl(sock_fd, SIOCGPPPSTATS, &req) < 0) { error("Couldn't get PPP statistics: %m"); return 0; } - stats->bytes_in = req.stats.p.ppp_ibytes; - stats->bytes_out = req.stats.p.ppp_obytes; - stats->pkts_in = req.stats.p.ppp_ipackets; - stats->pkts_out = req.stats.p.ppp_opackets; + stats->bytes_in = data.p.ppp_ibytes; + stats->bytes_out = data.p.ppp_obytes; + stats->pkts_in = data.p.ppp_ipackets; + stats->pkts_out = data.p.ppp_opackets; if (stats->bytes_in < previbytes) ++iwraps;