diff options
author | mav <mav@FreeBSD.org> | 2010-03-31 22:47:55 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-03-31 22:47:55 +0000 |
commit | 636a35a886cdc058e44b0e076917e3b4eda62947 (patch) | |
tree | 81dd1e512f5f22836a9a4b6bcaee4f19c46c672e /sys/netgraph/ng_ppp.c | |
parent | 4cf5e5ba4b623f3d41661d7252d884bd65f329cf (diff) | |
download | FreeBSD-src-636a35a886cdc058e44b0e076917e3b4eda62947.zip FreeBSD-src-636a35a886cdc058e44b0e076917e3b4eda62947.tar.gz |
Remove some more alignment constraints.
Diffstat (limited to 'sys/netgraph/ng_ppp.c')
-rw-r--r-- | sys/netgraph/ng_ppp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index ec3ed82..e5897f3 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -97,6 +97,7 @@ #include <sys/time.h> #include <sys/mbuf.h> #include <sys/malloc.h> +#include <sys/endian.h> #include <sys/errno.h> #include <sys/ctype.h> @@ -860,8 +861,8 @@ ng_ppp_rcvdata_bypass(hook_p hook, item_p item) NG_FREE_ITEM(item); return (ENOBUFS); } - linkNum = ntohs(mtod(m, uint16_t *)[0]); - proto = ntohs(mtod(m, uint16_t *)[1]); + linkNum = be16dec(mtod(m, uint8_t *)); + proto = be16dec(mtod(m, uint8_t *) + 2); m_adj(m, 4); NGI_M(item) = m; @@ -1544,7 +1545,7 @@ ng_ppp_mp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum) if (m->m_len < 2 && (m = m_pullup(m, 2)) == NULL) ERROUT(ENOBUFS); - shdr = ntohs(*mtod(m, uint16_t *)); + shdr = be16dec(mtod(m, void *)); frag->seq = MP_SHORT_EXTEND(shdr); frag->first = (shdr & MP_SHORT_FIRST_FLAG) != 0; frag->last = (shdr & MP_SHORT_LAST_FLAG) != 0; @@ -1561,7 +1562,7 @@ ng_ppp_mp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum) if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) ERROUT(ENOBUFS); - lhdr = ntohl(*mtod(m, uint32_t *)); + lhdr = be32dec(mtod(m, void *)); frag->seq = MP_LONG_EXTEND(lhdr); frag->first = (lhdr & MP_LONG_FIRST_FLAG) != 0; frag->last = (lhdr & MP_LONG_LAST_FLAG) != 0; |