]> git.ozlabs.org Git - ppp.git/blobdiff - pppdump/bsd-comp.c
For Linux, use the Linux / Glibc based defines instead of included headers
[ppp.git] / pppdump / bsd-comp.c
index 9d45f0bf610d8aa3a1da7e6f0c2f254bb1745578..7ad62892752fe79508666128337170293bd7f5a7 100644 (file)
@@ -46,7 +46,8 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include "ppp_defs.h"
+#include <net/ppp_defs.h>
+
 #include "ppp-comp.h"
 
 #if DO_BSD_COMPRESS
@@ -250,14 +251,15 @@ bsd_comp_stats(void *state, struct compstat *stats)
     stats->comp_packets = db->comp_count;
     stats->inc_bytes = db->incomp_bytes;
     stats->inc_packets = db->incomp_count;
-    stats->ratio = db->in_count;
+
+    u_int ratio = db->in_count;
     out = db->bytes_out;
-    if (stats->ratio <= 0x7fffff)
-       stats->ratio <<= 8;
+    if (ratio <= 0x7fffff)
+       ratio <<= 8;
     else
        out >>= 8;
     if (out != 0)
-       stats->ratio /= out;
+       stats->ratio = ratio / out;
 }
 
 /*