]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-linux.c
pppd: Rework use of volatile in lcp-rtt code to eliminate warnings (#469)
[ppp.git] / pppd / sys-linux.c
index 561b150f2950a59777925303455a283dee174d27..a16ab1258ff7a4fc25cf60708f22628831017f72 100644 (file)
@@ -18,7 +18,7 @@
  * 3. Redistributions of any form whatsoever must retain the following
  *    acknowledgment:
  *    "This product includes software developed by Paul Mackerras
- *     <paulus@samba.org>".
+ *     <paulus@ozlabs.org>".
  *
  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 #include <linux/if_link.h>
-
-/* Attempt at retaining compile-support with older than 4.7 kernels, or kernels
- * where RTM_NEWSTATS isn't defined for whatever reason.
- */
-#ifndef RTM_NEWSTATS
-#define RTM_NEWSTATS 92
-#define RTM_GETSTATS 94
-#define IFLA_STATS_LINK_64 1
-#endif
-
 #include <linux/if_addr.h>
 
 /* glibc versions prior to 2.24 do not define SOL_NETLINK */
@@ -1776,6 +1766,7 @@ get_ppp_stats_ioctl(int u, struct pppd_stats *stats)
 static int
 get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats)
 {
+#ifdef RTM_NEWSTATS
     static int fd = -1;
 
     struct {
@@ -1825,6 +1816,7 @@ get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats)
 err:
     close(fd);
     fd = -1;
+#endif
     return 0;
 }