Deleted Added
full compact
ddp_output.c (101937) ddp_output.c (109623)
1/*
2 * Copyright (c) 1990,1991 Regents of The University of Michigan.
3 * All Rights Reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software and
6 * its documentation for any purpose and without fee is hereby granted,
7 * provided that the above copyright notice appears in all copies and
8 * that both that copyright notice and this permission notice appear

--- 7 unchanged lines hidden (view full) ---

16 * The University of Michigan
17 * c/o Mike Clark
18 * 535 W. William Street
19 * Ann Arbor, Michigan
20 * +1-313-763-0525
21 * netatalk@itd.umich.edu
22 */
23
1/*
2 * Copyright (c) 1990,1991 Regents of The University of Michigan.
3 * All Rights Reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software and
6 * its documentation for any purpose and without fee is hereby granted,
7 * provided that the above copyright notice appears in all copies and
8 * that both that copyright notice and this permission notice appear

--- 7 unchanged lines hidden (view full) ---

16 * The University of Michigan
17 * c/o Mike Clark
18 * 535 W. William Street
19 * Ann Arbor, Michigan
20 * +1-313-763-0525
21 * netatalk@itd.umich.edu
22 */
23
24/* $FreeBSD: head/sys/netatalk/ddp_output.c 101937 2002-08-15 18:58:44Z rwatson $ */
24/* $FreeBSD: head/sys/netatalk/ddp_output.c 109623 2003-01-21 08:56:16Z alfred $ */
25
26#include "opt_mac.h"
27
28#include <sys/param.h>
29#include <sys/systm.h>
30#include <sys/mac.h>
31#include <sys/mbuf.h>
32#include <sys/socket.h>

--- 17 unchanged lines hidden (view full) ---

50{
51 struct ddpehdr *deh;
52 struct ddpcb *ddp = sotoddpcb( so );
53
54#ifdef MAC
55 mac_create_mbuf_from_socket(so, m);
56#endif
57
25
26#include "opt_mac.h"
27
28#include <sys/param.h>
29#include <sys/systm.h>
30#include <sys/mac.h>
31#include <sys/mbuf.h>
32#include <sys/socket.h>

--- 17 unchanged lines hidden (view full) ---

50{
51 struct ddpehdr *deh;
52 struct ddpcb *ddp = sotoddpcb( so );
53
54#ifdef MAC
55 mac_create_mbuf_from_socket(so, m);
56#endif
57
58 M_PREPEND( m, sizeof( struct ddpehdr ), M_TRYWAIT );
58 M_PREPEND( m, sizeof( struct ddpehdr ), 0 );
59
60 deh = mtod( m, struct ddpehdr *);
61 deh->deh_pad = 0;
62 deh->deh_hops = 0;
63
64 deh->deh_len = m->m_pkthdr.len;
65
66 deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net;

--- 124 unchanged lines hidden (view full) ---

191
192 /*
193 * There are several places in the kernel where data is added to
194 * an mbuf without ensuring that the mbuf pointer is aligned.
195 * This is bad for transition routing, since phase 1 and phase 2
196 * packets end up poorly aligned due to the three byte elap header.
197 */
198 if ( !(aa->aa_flags & AFA_PHASE2) ) {
59
60 deh = mtod( m, struct ddpehdr *);
61 deh->deh_pad = 0;
62 deh->deh_hops = 0;
63
64 deh->deh_len = m->m_pkthdr.len;
65
66 deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net;

--- 124 unchanged lines hidden (view full) ---

191
192 /*
193 * There are several places in the kernel where data is added to
194 * an mbuf without ensuring that the mbuf pointer is aligned.
195 * This is bad for transition routing, since phase 1 and phase 2
196 * packets end up poorly aligned due to the three byte elap header.
197 */
198 if ( !(aa->aa_flags & AFA_PHASE2) ) {
199 MGET( m0, M_TRYWAIT, MT_HEADER );
199 MGET( m0, 0, MT_HEADER );
200 if ( m0 == 0 ) {
201 m_freem( m );
202 printf("ddp_route: no buffers\n");
203 return( ENOBUFS );
204 }
205#ifdef MAC
206 mac_create_mbuf_from_mbuf(m, m0);
207#endif

--- 33 unchanged lines hidden ---
200 if ( m0 == 0 ) {
201 m_freem( m );
202 printf("ddp_route: no buffers\n");
203 return( ENOBUFS );
204 }
205#ifdef MAC
206 mac_create_mbuf_from_mbuf(m, m0);
207#endif

--- 33 unchanged lines hidden ---