Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/net80211 Make the STRICT_ALIGNMENT variant compile



details:   https://anonhg.NetBSD.org/src-all/rev/3cb79df8f3f0
branches:  trunk
changeset: 932862:3cb79df8f3f0
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Wed May 06 21:31:25 2020 +0200

description:
Make the STRICT_ALIGNMENT variant compile

diffstat:

 sys/net80211/ieee80211_mesh.c   |  2 +-
 sys/net80211/ieee80211_netbsd.c |  6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 01f563ce15d6 -r 3cb79df8f3f0 sys/net80211/ieee80211_mesh.c
--- a/sys/net80211/ieee80211_mesh.c     Wed May 06 21:30:43 2020 +0200
+++ b/sys/net80211/ieee80211_mesh.c     Wed May 06 21:31:25 2020 +0200
@@ -1363,7 +1363,7 @@
                }
        }
 #ifndef __NO_STRICT_ALIGNMENT
-       if (!ALIGNED_POINTER(mtod(m, caddr_t) + sizeof(*eh), uint32_t)) {
+       if (!ALIGNED_POINTER(mtod(m, char*) + sizeof(*eh), uint32_t)) {
                m = ieee80211_realign(vap, m, sizeof(*eh));
                if (m == NULL)
                        return NULL;
diff -r 01f563ce15d6 -r 3cb79df8f3f0 sys/net80211/ieee80211_netbsd.c
--- a/sys/net80211/ieee80211_netbsd.c   Wed May 06 21:30:43 2020 +0200
+++ b/sys/net80211/ieee80211_netbsd.c   Wed May 06 21:31:25 2020 +0200
@@ -633,10 +633,11 @@
 struct mbuf *
 ieee80211_realign(struct ieee80211vap *vap, struct mbuf *m, size_t align)
 {
-       int pktlen, space;
+       int pktlen; // , space;
        struct mbuf *n;
 
        pktlen = m->m_pkthdr.len;
+#if 0 // MMM
        space = pktlen + align;
        if (space < MINCLSIZE)
                n = m_gethdr(M_NOWAIT, MT_DATA);
@@ -648,6 +649,9 @@
 #endif
                    space <= MJUM9BYTES ?   MJUM9BYTES : MJUM16BYTES);
        }
+#else
+       n = m_gethdr(M_NOWAIT, MT_DATA);
+#endif
        if (__predict_true(n != NULL)) {
                m_move_pkthdr(n, m);
                n->m_data = (caddr_t)(ALIGN(n->m_data + align) - align);



Home | Main Index | Thread Index | Old Index