X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=dda8772da3c753ccb492c7bcf8dd9dee9b726384;hb=509f04959ad891d7f981f035ed461d51bd1f74b0;hp=329a141d2940024b0efec25e416eb5d53a315a88;hpb=f7307b3f74f9a2fd64acc77b0c884ed1cc9afe56;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 329a141..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,6 +157,7 @@ #include "pppd.h" #include "fsm.h" #include "ipcp.h" +#include "eui64.h" #ifdef PPP_WITH_FILTER #include @@ -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;