Author: mav
Date: Thu Apr 15 12:38:55 2010
New Revision: 206657
URL: http://svn.freebsd.org/changeset/base/206657

Log:
  NFC r206000:
  Make ng_ppp fulfill upper protocol stack layers alignment requirements
  on platforms with strict alignment constraints.
  This fixes kernel panics on arm and probably other architectures.
  
  PR:             sparc64/80410, sparc/118932, sparc/113556

Modified:
  stable/8/sys/netgraph/ng_ppp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netgraph/ng_ppp.c
==============================================================================
--- stable/8/sys/netgraph/ng_ppp.c      Thu Apr 15 12:30:46 2010        
(r206656)
+++ stable/8/sys/netgraph/ng_ppp.c      Thu Apr 15 12:38:55 2010        
(r206657)
@@ -907,7 +907,21 @@ ng_ppp_proto_recv(node_p node, item_p it
        const priv_p priv = NG_NODE_PRIVATE(node);
        hook_p outHook = NULL;
        int error;
+#ifdef ALIGNED_POINTER
+       struct mbuf *m, *n;
 
+       NGI_GET_M(item, m);
+       if (!ALIGNED_POINTER(mtod(m, caddr_t), uint32_t)) {
+               n = m_defrag(m, M_NOWAIT);
+               if (n == NULL) {
+                       m_freem(m);
+                       NG_FREE_ITEM(item);
+                       return (ENOBUFS);
+               }
+               m = n;
+       }
+       NGI_M(item) = m;
+#endif /* ALIGNED_POINTER */
        switch (proto) {
            case PROT_IP:
                if (priv->conf.enableIP)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to