Remove some more alignment constraints.
This commit is contained in:
parent
d7a0fc4dca
commit
39228864fd
@ -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 @@ ng_mppc_compress(node_p node, struct mbuf **datap)
|
||||
/* 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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user