Deleted Added
full compact
ip6_input.c (108825) ip6_input.c (109623)
1/* $FreeBSD: head/sys/netinet6/ip6_input.c 108825 2003-01-06 21:33:54Z sam $ */
1/* $FreeBSD: head/sys/netinet6/ip6_input.c 109623 2003-01-21 08:56:16Z alfred $ */
2/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

312 /*
313 * L2 bridge code and some other code can return mbuf chain
314 * that does not conform to KAME requirement. too bad.
315 * XXX: fails to join if interface MTU > MCLBYTES. jumbogram?
316 */
317 if (m && m->m_next != NULL && m->m_pkthdr.len < MCLBYTES) {
318 struct mbuf *n;
319
2/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

312 /*
313 * L2 bridge code and some other code can return mbuf chain
314 * that does not conform to KAME requirement. too bad.
315 * XXX: fails to join if interface MTU > MCLBYTES. jumbogram?
316 */
317 if (m && m->m_next != NULL && m->m_pkthdr.len < MCLBYTES) {
318 struct mbuf *n;
319
320 MGETHDR(n, M_DONTWAIT, MT_HEADER);
320 MGETHDR(n, M_NOWAIT, MT_HEADER);
321 if (n)
322 M_MOVE_PKTHDR(n, m);
323 if (n && n->m_pkthdr.len > MHLEN) {
321 if (n)
322 M_MOVE_PKTHDR(n, m);
323 if (n && n->m_pkthdr.len > MHLEN) {
324 MCLGET(n, M_DONTWAIT);
324 MCLGET(n, M_NOWAIT);
325 if ((n->m_flags & M_EXT) == 0) {
326 m_freem(n);
327 n = NULL;
328 }
329 }
330 if (n == NULL) {
331 m_freem(m);
332 return; /*ENOBUFS*/

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

1428#endif
1429
1430 m_copydata(m, off, sizeof(ip6e), (caddr_t)&ip6e);
1431 if (nxt == IPPROTO_AH)
1432 elen = (ip6e.ip6e_len + 2) << 2;
1433 else
1434 elen = (ip6e.ip6e_len + 1) << 3;
1435
325 if ((n->m_flags & M_EXT) == 0) {
326 m_freem(n);
327 n = NULL;
328 }
329 }
330 if (n == NULL) {
331 m_freem(m);
332 return; /*ENOBUFS*/

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

1428#endif
1429
1430 m_copydata(m, off, sizeof(ip6e), (caddr_t)&ip6e);
1431 if (nxt == IPPROTO_AH)
1432 elen = (ip6e.ip6e_len + 2) << 2;
1433 else
1434 elen = (ip6e.ip6e_len + 1) << 3;
1435
1436 MGET(n, M_DONTWAIT, MT_DATA);
1436 MGET(n, M_NOWAIT, MT_DATA);
1437 if (n && elen >= MLEN) {
1437 if (n && elen >= MLEN) {
1438 MCLGET(n, M_DONTWAIT);
1438 MCLGET(n, M_NOWAIT);
1439 if ((n->m_flags & M_EXT) == 0) {
1440 m_free(n);
1441 n = NULL;
1442 }
1443 }
1444 if (!n)
1445 return NULL;
1446

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

1618struct ip6aux *
1619ip6_addaux(m)
1620 struct mbuf *m;
1621{
1622 struct m_tag *tag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL);
1623 if (!tag) {
1624 tag = m_tag_get(PACKET_TAG_IPV6_INPUT,
1625 sizeof (struct ip6aux),
1439 if ((n->m_flags & M_EXT) == 0) {
1440 m_free(n);
1441 n = NULL;
1442 }
1443 }
1444 if (!n)
1445 return NULL;
1446

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

1618struct ip6aux *
1619ip6_addaux(m)
1620 struct mbuf *m;
1621{
1622 struct m_tag *tag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL);
1623 if (!tag) {
1624 tag = m_tag_get(PACKET_TAG_IPV6_INPUT,
1625 sizeof (struct ip6aux),
1626 M_DONTWAIT);
1626 M_NOWAIT);
1627 if (tag)
1628 m_tag_prepend(m, tag);
1629 }
1630 if (tag)
1631 bzero(tag+1, sizeof (struct ip6aux));
1632 return tag ? (struct ip6aux*)(tag+1) : NULL;
1633}
1634

--- 29 unchanged lines hidden ---
1627 if (tag)
1628 m_tag_prepend(m, tag);
1629 }
1630 if (tag)
1631 bzero(tag+1, sizeof (struct ip6aux));
1632 return tag ? (struct ip6aux*)(tag+1) : NULL;
1633}
1634

--- 29 unchanged lines hidden ---