Deleted Added
full compact
ipsec_output.c (108466) ipsec_output.c (109623)
1/* $FreeBSD: head/sys/netipsec/ipsec_output.c 108466 2002-12-30 20:22:40Z sam $ */
1/* $FreeBSD: head/sys/netipsec/ipsec_output.c 109623 2003-01-21 08:56:16Z alfred $ */
2/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
3
4/*
5 * IPsec output processing.
6 */
7#include "opt_inet.h"
8#include "opt_inet6.h"
9#include "opt_ipsec.h"

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

464 struct ip6_hdr *ip6;
465 int hlen;
466
467 KASSERT(m->m_len >= sizeof (struct ip6_hdr),
468 ("ipsec6_splithdr: first mbuf too short, len %u", m->m_len));
469 ip6 = mtod(m, struct ip6_hdr *);
470 hlen = sizeof(struct ip6_hdr);
471 if (m->m_len > hlen) {
2/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
3
4/*
5 * IPsec output processing.
6 */
7#include "opt_inet.h"
8#include "opt_inet6.h"
9#include "opt_ipsec.h"

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

464 struct ip6_hdr *ip6;
465 int hlen;
466
467 KASSERT(m->m_len >= sizeof (struct ip6_hdr),
468 ("ipsec6_splithdr: first mbuf too short, len %u", m->m_len));
469 ip6 = mtod(m, struct ip6_hdr *);
470 hlen = sizeof(struct ip6_hdr);
471 if (m->m_len > hlen) {
472 MGETHDR(mh, M_DONTWAIT, MT_HEADER);
472 MGETHDR(mh, M_NOWAIT, MT_HEADER);
473 if (!mh) {
474 m_freem(m);
475 return NULL;
476 }
477 M_MOVE_PKTHDR(mh, m);
478 MH_ALIGN(mh, hlen);
479 m->m_len -= hlen;
480 m->m_data += hlen;

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

575
576
577 /*
578 * grow the mbuf to accomodate the new IPv6 header.
579 */
580 plen = m->m_pkthdr.len;
581 if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) {
582 struct mbuf *n;
473 if (!mh) {
474 m_freem(m);
475 return NULL;
476 }
477 M_MOVE_PKTHDR(mh, m);
478 MH_ALIGN(mh, hlen);
479 m->m_len -= hlen;
480 m->m_data += hlen;

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

575
576
577 /*
578 * grow the mbuf to accomodate the new IPv6 header.
579 */
580 plen = m->m_pkthdr.len;
581 if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) {
582 struct mbuf *n;
583 MGET(n, M_DONTWAIT, MT_DATA);
583 MGET(n, M_NOWAIT, MT_DATA);
584 if (!n) {
585 m_freem(m);
586 return ENOBUFS;
587 }
588 n->m_len = sizeof(struct ip6_hdr);
589 n->m_next = m->m_next;
590 m->m_next = n;
591 m->m_pkthdr.len += sizeof(struct ip6_hdr);

--- 146 unchanged lines hidden ---
584 if (!n) {
585 m_freem(m);
586 return ENOBUFS;
587 }
588 n->m_len = sizeof(struct ip6_hdr);
589 n->m_next = m->m_next;
590 m->m_next = n;
591 m->m_pkthdr.len += sizeof(struct ip6_hdr);

--- 146 unchanged lines hidden ---