summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_mppc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph/ng_mppc.c')
-rw-r--r--sys/netgraph/ng_mppc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c
index e934481..074c018 100644
--- a/sys/netgraph/ng_mppc.c
+++ b/sys/netgraph/ng_mppc.c
@@ -53,6 +53,7 @@
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
+#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/syslog.h>
@@ -601,7 +602,7 @@ err1:
/* Install header */
M_PREPEND(m, MPPC_HDRLEN, M_DONTWAIT);
if (m != NULL)
- *(mtod(m, uint16_t *)) = htons(header);
+ be16enc(mtod(m, void *), header);
*datap = m;
return (*datap == NULL ? ENOBUFS : 0);
@@ -630,8 +631,7 @@ ng_mppc_decompress(node_p node, struct mbuf **datap)
m_freem(m);
return (EINVAL);
}
- m_copydata(m, 0, MPPC_HDRLEN, (caddr_t)&header);
- header = ntohs(header);
+ header = be16dec(mtod(m, void *));
cc = (header & MPPC_CCOUNT_MASK);
m_adj(m, MPPC_HDRLEN);
OpenPOWER on IntegriCloud