summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-08-03 14:32:32 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-08-03 14:32:32 +0400
commitbc071ac4349a96ec757ee418c08ffac509e6b6e4 (patch)
treed41b9ed72de3979aa5a0a3e45789b9030ad98abe /accel-pppd/extra
parent95586a13a28c93e60f8da6b728b0e7b57cdff5f1 (diff)
downloadaccel-ppp-bc071ac4349a96ec757ee418c08ffac509e6b6e4.tar.gz
accel-ppp-bc071ac4349a96ec757ee418c08ffac509e6b6e4.zip
fixed complilation for 3.4 kernel
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/pppd_compat.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index fcb83c25..71934ab8 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -18,6 +18,7 @@
#include "log.h"
#include "utils.h"
#include "sigchld.h"
+#include "iplink.h"
#ifdef RADIUS
#include "radius.h"
@@ -227,27 +228,19 @@ static void ev_ses_started(struct ap_session *ses)
static void ev_ses_finishing(struct ap_session *ses)
{
- struct ifpppstatsreq ifreq;
+ struct rtnl_link_stats stats;
struct pppd_compat_pd_t *pd = find_pd(ses);
if (!pd)
return;
- if (ses->ctrl->type == CTRL_TYPE_IPOE) {
-
- } else {
- memset(&ifreq, 0, sizeof(ifreq));
- ifreq.stats_ptr = (void *)&ifreq.stats;
- strcpy(ifreq.ifr__name, ses->ifname);
-
- if (ioctl(sock_fd, SIOCGPPPSTATS, &ifreq)) {
- log_ppp_error("pppd_compat: failed to get ppp statistics: %s\n", strerror(errno));
- return;
- }
-
- pd->bytes_sent = ifreq.stats.p.ppp_obytes;
- pd->bytes_rcvd = ifreq.stats.p.ppp_ibytes;
+ if (iplink_get_stats(ses->ifindex, &stats)) {
+ log_ppp_error("pppd_compat: failed to get interface statistics\n");
+ return;
}
+
+ pd->bytes_sent = stats.tx_bytes;
+ pd->bytes_rcvd = stats.rx_bytes;
}
static void ev_ses_finished(struct ap_session *ses)