diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2012-03-28 16:42:24 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2012-03-28 17:03:19 +0200 |
commit | 6b64e4db2f3c9cfc0e0e240cf0bc58f3b3e90c1f (patch) | |
tree | e036b357f6664e54d10781b18b76d0c2ec1889ed /src/ppp-manager/nm-ppp-manager.c | |
parent | a4f450aa0bf087453a8d605db81a83368cbe3b0a (diff) |
ppp: don't use struct ifpppstatsreq that was removed from linux/ip_ppp.h
in recent kernels.
We can use ifreq and ppp_stats structures separately. They needn't have to
to be packed in a structure.
Diffstat (limited to 'src/ppp-manager/nm-ppp-manager.c')
-rw-r--r-- | src/ppp-manager/nm-ppp-manager.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 59698c3425..243d2e12f9 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -304,18 +304,20 @@ monitor_cb (gpointer user_data) { NMPPPManager *manager = NM_PPP_MANAGER (user_data); NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); - struct ifpppstatsreq req; + struct ifreq req; + struct ppp_stats stats; memset (&req, 0, sizeof (req)); - req.stats_ptr = (caddr_t) &req.stats; + memset (&stats, 0, sizeof (stats)); + req.ifr_data = (caddr_t) &stats; - strncpy (req.ifr__name, priv->ip_iface, sizeof (req.ifr__name)); + strncpy (req.ifr_name, priv->ip_iface, sizeof (req.ifr_name)); if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) { nm_log_warn (LOGD_PPP, "could not read ppp stats: %s", strerror (errno)); } else { g_signal_emit (manager, signals[STATS], 0, - req.stats.p.ppp_ibytes, - req.stats.p.ppp_obytes); + stats.p.ppp_ibytes, + stats.p.ppp_obytes); } return TRUE; |