if_fwsubr.c (140323) | if_fwsubr.c (144114) |
---|---|
1/*- 2 * Copyright (c) 2004 Doug Rabson 3 * Copyright (c) 1982, 1989, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1/*- 2 * Copyright (c) 2004 Doug Rabson 3 * Copyright (c) 1982, 1989, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/net/if_fwsubr.c 140323 2005-01-15 22:04:17Z glebius $ | 30 * $FreeBSD: head/sys/net/if_fwsubr.c 144114 2005-03-25 16:05:42Z gallatin $ |
31 */ 32 33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_mac.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> --- 192 unchanged lines hidden (view full) --- 231 M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); 232 if (!m) { 233 error = ENOBUFS; 234 goto bad; 235 } 236 enc = mtod(m, union fw_encap *); 237 enc->unfrag.ether_type = type; 238 enc->unfrag.lf = FW_ENCAP_UNFRAG; | 31 */ 32 33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_mac.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> --- 192 unchanged lines hidden (view full) --- 231 M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); 232 if (!m) { 233 error = ENOBUFS; 234 goto bad; 235 } 236 enc = mtod(m, union fw_encap *); 237 enc->unfrag.ether_type = type; 238 enc->unfrag.lf = FW_ENCAP_UNFRAG; |
239 enc->unfrag.reserved = 0; |
|
239 240 /* 241 * Byte swap the encapsulation header manually. 242 */ 243 enc->ul[0] = htonl(enc->ul[0]); 244 245 IFQ_HANDOFF(ifp, m, error); 246 return (error); --- 25 unchanged lines hidden (view full) --- 272 M_PREPEND(m, 2*sizeof(uint32_t), M_DONTWAIT); 273 if (!m) { 274 error = ENOBUFS; 275 goto bad; 276 } 277 enc = mtod(m, union fw_encap *); 278 if (foff == 0) { 279 enc->firstfrag.lf = FW_ENCAP_FIRST; | 240 241 /* 242 * Byte swap the encapsulation header manually. 243 */ 244 enc->ul[0] = htonl(enc->ul[0]); 245 246 IFQ_HANDOFF(ifp, m, error); 247 return (error); --- 25 unchanged lines hidden (view full) --- 273 M_PREPEND(m, 2*sizeof(uint32_t), M_DONTWAIT); 274 if (!m) { 275 error = ENOBUFS; 276 goto bad; 277 } 278 enc = mtod(m, union fw_encap *); 279 if (foff == 0) { 280 enc->firstfrag.lf = FW_ENCAP_FIRST; |
281 enc->firstfrag.reserved1 = 0; 282 enc->firstfrag.reserved2 = 0; |
|
280 enc->firstfrag.datagram_size = dsize - 1; 281 enc->firstfrag.ether_type = type; 282 enc->firstfrag.dgl = dgl; 283 } else { 284 if (mtail) 285 enc->nextfrag.lf = FW_ENCAP_NEXT; 286 else 287 enc->nextfrag.lf = FW_ENCAP_LAST; | 283 enc->firstfrag.datagram_size = dsize - 1; 284 enc->firstfrag.ether_type = type; 285 enc->firstfrag.dgl = dgl; 286 } else { 287 if (mtail) 288 enc->nextfrag.lf = FW_ENCAP_NEXT; 289 else 290 enc->nextfrag.lf = FW_ENCAP_LAST; |
291 enc->nextfrag.reserved1 = 0; 292 enc->nextfrag.reserved2 = 0; 293 enc->nextfrag.reserved3 = 0; |
|
288 enc->nextfrag.datagram_size = dsize - 1; 289 enc->nextfrag.fragment_offset = foff; 290 enc->nextfrag.dgl = dgl; 291 } 292 foff += m->m_pkthdr.len - 2*sizeof(uint32_t); 293 294 /* 295 * Byte swap the encapsulation header manually. --- 506 unchanged lines hidden --- | 294 enc->nextfrag.datagram_size = dsize - 1; 295 enc->nextfrag.fragment_offset = foff; 296 enc->nextfrag.dgl = dgl; 297 } 298 foff += m->m_pkthdr.len - 2*sizeof(uint32_t); 299 300 /* 301 * Byte swap the encapsulation header manually. --- 506 unchanged lines hidden --- |