]> git.ozlabs.org Git - ppp.git/commitdiff
For Linux, use the Linux / Glibc based defines instead of included headers
authorEivind Næss <eivnaes@yahoo.com>
Mon, 30 May 2022 05:14:08 +0000 (22:14 -0700)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:25:39 +0000 (15:25 -0700)
This is to ensure compatibility with the OS you are compiling against and that
headers are maintained in upstream projects.

- Moved PPP_EAP and PPP_ECP into respective header files in lieu of not currently
  existing in the linux/ppp_defs.h

- Unchained the top-level ${topsrc_dir}/include, this folder is included for
  prosterity and may continue to exist on github, but in the future eliminated from
  distribution

- Bogus upstream file in glibc for <net/if_ppp.h>, its content should be replaced
  with a simple include to <linux/ppp-ioctl.h>. The lack of an appropriate ifreq
  structure with ppp_stats or ppp_comp_stats, implementet that inline (and tested).

- Updated instances where PPP_FCS() macro would expand the fcstab, while PPP_GOODFCS
  and PPP_INITFCS is provided in <linux/ppp_defs.h>, the latter is tied to a lookup
  table. It's used in two places, so add the PPP_FCS macro where applicable.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
17 files changed:
pppd/Makefile.am
pppd/demand.c
pppd/eap.h
pppd/ecp.h
pppd/lcp.c
pppd/plugins/Makefile.am
pppd/plugins/pppoatm/Makefile.am
pppd/plugins/pppoe/Makefile.am
pppd/plugins/pppol2tp/Makefile.am
pppd/plugins/radius/Makefile.am
pppd/sys-linux.c
pppdump/Makefile.am
pppdump/bsd-comp.c
pppdump/deflate.c
pppdump/pppdump.c
pppstats/Makefile.am
pppstats/pppstats.c

index c316ea44d4b03c62c4891b986a6923a2b37e0f53..405671ae6f76a9887042c35b9b534ee58e191c4d 100644 (file)
@@ -7,7 +7,7 @@ utest_chap_CPPFLAGS = -DUNIT_TEST
 utest_chap_LDFLAGS =
 
 utest_peap_SOURCES = peap.c utils.c mppe.c
 utest_chap_LDFLAGS =
 
 utest_peap_SOURCES = peap.c utils.c mppe.c
-utest_peap_CPPFLAGS = -DUNIT_TEST -I${top_srcdir}/include
+utest_peap_CPPFLAGS = -DUNIT_TEST
 utest_peap_LDFLAGS =
 
 if WITH_SRP
 utest_peap_LDFLAGS =
 
 if WITH_SRP
@@ -68,7 +68,7 @@ pppd_SOURCES = \
     upap.c \
     utils.c
 
     upap.c \
     utils.c
 
-pppd_CPPFLAGS = -I${top_srcdir}/include -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
+pppd_CPPFLAGS = -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
 pppd_LDFLAGS =
 pppd_LIBS =
 
 pppd_LDFLAGS =
 pppd_LIBS =
 
index 3e320798355de806223d0dd11896e19892da0930..d610d69ac282ea83d9ca841bdea21b7c6663906a 100644 (file)
@@ -210,6 +210,7 @@ static u_short fcstab[256] = {
        0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
        0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
 };
        0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
        0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
 };
+#define PPP_FCS(fcs, c)        (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
 
 /*
  * loop_chars - process characters received from the loopback.
 
 /*
  * loop_chars - process characters received from the loopback.
index fbc72017da68a60ae74b2b425edf29db7ee2aeb9..96c5f691b301c26d7c1c2d09c83ebc3d6a596ddb 100644 (file)
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
+
+#ifndef PPP_EAP
+#define PPP_EAP 0xc227
+#endif
+
+
 /*
  * Packet header = Code, id, length.
  */
 /*
  * Packet header = Code, id, length.
  */
index 162dace7e07915c62cc39198eb56be2b146dfe03..807a100fd1e921d7329b5ff018229c40b9c8336f 100644 (file)
  */
 #include "pppdconf.h"
 
  */
 #include "pppdconf.h"
 
+#ifndef PPP_ECP_H
+#define PPP_ECP_H
+
+#ifndef PPP_ECP
+#define PPP_ECP 0x8053
+#endif
+
+
 typedef struct ecp_options {
     bool required;             /* Is ECP required? */
     unsigned enctype;          /* Encryption type */
 typedef struct ecp_options {
     bool required;             /* Is ECP required? */
     unsigned enctype;          /* Encryption type */
@@ -44,3 +52,5 @@ extern ecp_options ecp_allowoptions[];
 extern ecp_options ecp_hisoptions[];
 
 extern struct protent ecp_protent;
 extern ecp_options ecp_hisoptions[];
 
 extern struct protent ecp_protent;
+
+#endif
index 91e73e700bdeae386f02308fe1995d1dd7616f49..9dc883e47ce85a634df6c42b884a512379bd3559 100644 (file)
@@ -51,6 +51,7 @@
 #include "pppd.h"
 #include "fsm.h"
 #include "lcp.h"
 #include "pppd.h"
 #include "fsm.h"
 #include "lcp.h"
+#include "eap.h"
 #include "chap-new.h"
 #include "magic.h"
 
 #include "chap-new.h"
 #include "magic.h"
 
index 292daf222e80a7b946d4dc732867ef713afda87d..2826148c79ffb79f71711bf86e76b07b2c0e9c65 100644 (file)
@@ -1,7 +1,7 @@
 pppd_plugin_LTLIBRARIES = minconn.la passprompt.la passwordfd.la winbind.la
 pppd_plugindir = $(PPPD_PLUGIN_DIR)
 
 pppd_plugin_LTLIBRARIES = minconn.la passprompt.la passwordfd.la winbind.la
 pppd_plugindir = $(PPPD_PLUGIN_DIR)
 
-PLUGIN_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
+PLUGIN_CPPFLAGS = -I${top_srcdir}
 PLUGIN_LDFLAGS = -module -avoid-version
 
 minconn_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
 PLUGIN_LDFLAGS = -module -avoid-version
 
 minconn_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
index 478aa962e34886f32f736c5b097d4733f1465ea7..1bc77c19fee36b56d09453bc6392d7cf1c658948 100644 (file)
@@ -6,7 +6,7 @@ noinst_HEADERS = \
     atmres.h \
     atmsap.h
 
     atmres.h \
     atmsap.h
 
-pppoatm_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
+pppoatm_la_CPPFLAGS = -I${top_srcdir}
 pppoatm_la_LDFLAGS = -module -avoid-version
 pppoatm_la_SOURCES = pppoatm.c
 
 pppoatm_la_LDFLAGS = -module -avoid-version
 pppoatm_la_SOURCES = pppoatm.c
 
index ce25cd653777f170cbca4d71555b3c2f7cd8b855..6cea70aae967c96fd17b9e9a3749febdeeae3cbf 100644 (file)
@@ -6,9 +6,9 @@ dist_man8_MANS = pppoe-discovery.8
 noinst_HEADERS = \
     pppoe.h
 
 noinst_HEADERS = \
     pppoe.h
 
-pppoe_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
+pppoe_la_CPPFLAGS = -I${top_srcdir}
 pppoe_la_LDFLAGS = -module -avoid-version
 pppoe_la_SOURCES = plugin.c discovery.c if.c common.c
 
 pppoe_la_LDFLAGS = -module -avoid-version
 pppoe_la_SOURCES = plugin.c discovery.c if.c common.c
 
-pppoe_discovery_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/include
+pppoe_discovery_CPPFLAGS = -I${top_srcdir}
 pppoe_discovery_SOURCES = pppoe-discovery.c discovery.c if.c common.c
 pppoe_discovery_SOURCES = pppoe-discovery.c discovery.c if.c common.c
index c109d22e52f59217908aa0b20f750b36a857c162..1018981f0b4a0f19f734bbf9284559ba3a5790ff 100644 (file)
@@ -4,10 +4,10 @@ pppd_plugindir = $(PPPD_PLUGIN_DIR)
 noinst_HEADERS = \
     l2tp_event.h
 
 noinst_HEADERS = \
     l2tp_event.h
 
-pppol2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
+pppol2tp_la_CPPFLAGS = -I${top_srcdir}
 pppol2tp_la_LDFLAGS = -module -avoid-version
 pppol2tp_la_SOURCES = pppol2tp.c
 
 pppol2tp_la_LDFLAGS = -module -avoid-version
 pppol2tp_la_SOURCES = pppol2tp.c
 
-openl2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
+openl2tp_la_CPPFLAGS = -I${top_srcdir}
 openl2tp_la_LDFLAGS = -module -avoid-version
 openl2tp_la_SOURCES = openl2tp.c
 openl2tp_la_LDFLAGS = -module -avoid-version
 openl2tp_la_SOURCES = openl2tp.c
index b9f9e146804a593a1c48c9fec0c7ca41a3af0e41..ec637ae7897e17ed85c020fbcf4de3f9e6c93004 100644 (file)
@@ -25,7 +25,7 @@ EXTRA_ETC = \
     etc/realms \
     etc/servers
 
     etc/realms \
     etc/servers
 
-RADIUS_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir} -DRC_LOG_FACILITY=LOG_DAEMON
+RADIUS_CPPFLAGS = -I${top_srcdir} -DRC_LOG_FACILITY=LOG_DAEMON
 RADIUS_LDFLAGS = -module -avoid-version $(LDFLAGS)
 
 radius_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
 RADIUS_LDFLAGS = -module -avoid-version $(LDFLAGS)
 
 radius_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
index b68babdfa659cdc161507f65f6a63fe94a33b50e..d16f9bfcdeab4a11fdd2739b85c798ba4ca4f485 100644 (file)
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <linux/ppp_defs.h>
-#include <linux/if_ppp.h>
+#include <linux/ppp-ioctl.h>
+
 
 #ifdef PPP_WITH_IPV6CP
 #include <linux/netlink.h>
 
 #ifdef PPP_WITH_IPV6CP
 #include <linux/netlink.h>
@@ -1476,20 +1476,21 @@ get_ppp_stats_ioctl(int u, struct pppd_stats *stats)
     static u_int32_t iwraps = 0;
     static u_int32_t owraps = 0;
 
     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));
 
 
     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;
     }
     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;
 
     if (stats->bytes_in < previbytes)
        ++iwraps;
index 2df7e0edd190d0db6021f51bfe82f7185f886c03..186f34e00e259d7837a365d8bdd4372d2dcab802 100644 (file)
@@ -2,7 +2,6 @@ sbin_PROGRAMS = pppdump
 dist_man8_MANS = pppdump.8
 
 pppdump_SOURCES = pppdump.c bsd-comp.c deflate.c zlib.c
 dist_man8_MANS = pppdump.8
 
 pppdump_SOURCES = pppdump.c bsd-comp.c deflate.c zlib.c
-pppdump_CFLAGS = -I${top_srcdir}/include/net
 
 noinst_HEADERS = \
     ppp-comp.h \
 
 noinst_HEADERS = \
     ppp-comp.h \
index 9d45f0bf610d8aa3a1da7e6f0c2f254bb1745578..7ad62892752fe79508666128337170293bd7f5a7 100644 (file)
@@ -46,7 +46,8 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 #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
 #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->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;
     out = db->bytes_out;
-    if (stats->ratio <= 0x7fffff)
-       stats->ratio <<= 8;
+    if (ratio <= 0x7fffff)
+       ratio <<= 8;
     else
        out >>= 8;
     if (out != 0)
     else
        out >>= 8;
     if (out != 0)
-       stats->ratio /= out;
+       stats->ratio = ratio / out;
 }
 
 /*
 }
 
 /*
index 5668a4d88067f66c86f1ad6a9e06585711f117ef..0f090b23463e45758f796f0b2cec75695dd82467 100644 (file)
@@ -41,7 +41,8 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include "ppp_defs.h"
+#include <net/ppp_defs.h>
+
 #include "ppp-comp.h"
 #include "zlib.h"
 
 #include "ppp-comp.h"
 #include "zlib.h"
 
@@ -115,12 +116,13 @@ z_comp_stats(void *arg, struct compstat *stats)
     *stats = state->stats;
     stats->ratio = stats->unc_bytes;
     out = stats->comp_bytes + stats->unc_bytes;
     *stats = state->stats;
     stats->ratio = stats->unc_bytes;
     out = stats->comp_bytes + stats->unc_bytes;
-    if (stats->ratio <= 0x7ffffff)
-       stats->ratio <<= 8;
+    u_int ratio = stats->ratio;
+    if (ratio <= 0x7ffffff)
+       ratio <<= 8;
     else
        out >>= 8;
     if (out != 0)
     else
        out >>= 8;
     if (out != 0)
-       stats->ratio /= out;
+       stats->ratio = ratio / out;
 }
 
 /*
 }
 
 /*
index 130300a17d348046dbc4a81100f8fbfcf3d9f0a5..8944ca5820012589658f435a3b238e598db07d47 100644 (file)
@@ -38,7 +38,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include <sys/types.h>
 #include <stdlib.h>
 #include <time.h>
 #include <sys/types.h>
-#include "ppp_defs.h"
+#include <net/ppp_defs.h>
 #include "ppp-comp.h"
 
 int hexmode;
 #include "ppp-comp.h"
 
 int hexmode;
@@ -233,6 +233,7 @@ static u_short fcstab[256] = {
        0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
        0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
 };
        0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
        0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
 };
+#define PPP_FCS(fcs, c)        (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
 
 struct pkt {
     int        cnt;
 
 struct pkt {
     int        cnt;
index d7d74e0200abc68407a0dde1c06614a63ed3b60c..4c8b83fa0186804cfc1aa6007ab5476801e29376 100644 (file)
@@ -5,10 +5,6 @@ pppstats_SOURCES = pppstats.c
 pppstats_CFLAGS =
 pppstats_CPPFLAGS =
 
 pppstats_CFLAGS =
 pppstats_CPPFLAGS =
 
-if LINUX
-pppstats_CFLAGS += -I${top_srcdir}/include
-endif
-
 if SUNOS
 pppstats_CPPFLAGS += -DSTREAMS
 endif
 if SUNOS
 pppstats_CPPFLAGS += -DSTREAMS
 endif
index cbea00b6d71268a1838ffd11428618c217a19cdc..44a254d70154f5d00ff03727419ef87eb1693623 100644 (file)
@@ -62,7 +62,6 @@ static const char rcsid[] = "$Id: pppstats.c,v 1.29 2002/10/27 12:56:26 fcusack
 #ifndef __linux__
 #include <net/if.h>
 #include <net/ppp_defs.h>
 #ifndef __linux__
 #include <net/if.h>
 #include <net/ppp_defs.h>
-#include <net/if_ppp.h>
 #else
 /* Linux */
 #if __GLIBC__ >= 2
 #else
 /* Linux */
 #if __GLIBC__ >= 2
@@ -74,6 +73,7 @@ static const char rcsid[] = "$Id: pppstats.c,v 1.29 2002/10/27 12:56:26 fcusack
 #endif
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
 #endif
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
+
 #endif /* __linux__ */
 
 #else  /* STREAMS */
 #endif /* __linux__ */
 
 #else  /* STREAMS */
@@ -137,15 +137,11 @@ catchalarm(int arg)
 static void
 get_ppp_stats(struct ppp_stats *curp)
 {
 static void
 get_ppp_stats(struct ppp_stats *curp)
 {
-    struct ifpppstatsreq req;
+    struct ifreq req;
 
     memset (&req, 0, sizeof (req));
 
 
     memset (&req, 0, sizeof (req));
 
-#ifdef __linux__
-    req.stats_ptr = (caddr_t) &req.stats;
-#undef ifr_name
-#define ifr_name ifr__name
-#endif
+    req.ifr_data = (caddr_t) curp;
 
     strncpy(req.ifr_name, interface, IFNAMSIZ);
     req.ifr_name[IFNAMSIZ - 1] = 0;
 
     strncpy(req.ifr_name, interface, IFNAMSIZ);
     req.ifr_name[IFNAMSIZ - 1] = 0;
@@ -157,25 +153,21 @@ get_ppp_stats(struct ppp_stats *curp)
            perror("couldn't get PPP statistics");
        exit(1);
     }
            perror("couldn't get PPP statistics");
        exit(1);
     }
-    *curp = req.stats;
 }
 
 static void
 get_ppp_cstats(struct ppp_comp_stats *csp)
 {
 }
 
 static void
 get_ppp_cstats(struct ppp_comp_stats *csp)
 {
-    struct ifpppcstatsreq creq;
+    struct ifreq req;
+    struct ppp_comp_stats stats;
 
 
-    memset (&creq, 0, sizeof (creq));
+    memset (&req, 0, sizeof (req));
 
 
-#ifdef __linux__
-    creq.stats_ptr = (caddr_t) &creq.stats;
-#undef  ifr_name
-#define ifr_name ifr__name
-#endif
+    req.ifr_data = (caddr_t) &stats;
 
 
-    strncpy(creq.ifr_name, interface, IFNAMSIZ);
-    creq.ifr_name[IFNAMSIZ - 1] = 0;
-    if (ioctl(s, SIOCGPPPCSTATS, &creq) < 0) {
+    strncpy(req.ifr_name, interface, IFNAMSIZ);
+    req.ifr_name[IFNAMSIZ - 1] = 0;
+    if (ioctl(s, SIOCGPPPCSTATS, &req) < 0) {
        fprintf(stderr, "%s: ", progname);
        if (errno == ENOTTY) {
            fprintf(stderr, "no kernel compression support\n");
        fprintf(stderr, "%s: ", progname);
        if (errno == ENOTTY) {
            fprintf(stderr, "no kernel compression support\n");
@@ -189,28 +181,26 @@ get_ppp_cstats(struct ppp_comp_stats *csp)
     }
 
 #ifdef __linux__
     }
 
 #ifdef __linux__
-    if (creq.stats.c.bytes_out == 0) {
-       creq.stats.c.bytes_out = creq.stats.c.comp_bytes + creq.stats.c.inc_bytes;
-       creq.stats.c.in_count = creq.stats.c.unc_bytes;
+    if (stats.c.bytes_out == 0) {
+       stats.c.bytes_out = stats.c.comp_bytes + stats.c.inc_bytes;
+       stats.c.in_count = stats.c.unc_bytes;
     }
     }
-    if (creq.stats.c.bytes_out == 0)
-       creq.stats.c.ratio = 0.0;
+    if (stats.c.bytes_out == 0)
+       stats.c.ratio = 0.0;
     else
     else
-       creq.stats.c.ratio = 256.0 * creq.stats.c.in_count /
-                            creq.stats.c.bytes_out;
+       stats.c.ratio = 256.0 * stats.c.in_count / stats.c.bytes_out;
 
 
-    if (creq.stats.d.bytes_out == 0) {
-       creq.stats.d.bytes_out = creq.stats.d.comp_bytes + creq.stats.d.inc_bytes;
-       creq.stats.d.in_count = creq.stats.d.unc_bytes;
+    if (stats.d.bytes_out == 0) {
+       stats.d.bytes_out = stats.d.comp_bytes + stats.d.inc_bytes;
+       stats.d.in_count = stats.d.unc_bytes;
     }
     }
-    if (creq.stats.d.bytes_out == 0)
-       creq.stats.d.ratio = 0.0;
+    if (stats.d.bytes_out == 0)
+       stats.d.ratio = 0.0;
     else
     else
-       creq.stats.d.ratio = 256.0 * creq.stats.d.in_count /
-                            creq.stats.d.bytes_out;
+       stats.d.ratio = 256.0 * stats.d.in_count / stats.d.bytes_out;
 #endif
 
 #endif
 
-    *csp = creq.stats;
+    *csp = stats;
 }
 
 #else  /* STREAMS */
 }
 
 #else  /* STREAMS */