ng_pptpgre.c (108107) | ng_pptpgre.c (109623) |
---|---|
1 2/* 3 * ng_pptpgre.c 4 * 5 * Copyright (c) 1996-1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * | 1 2/* 3 * ng_pptpgre.c 4 * 5 * Copyright (c) 1996-1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * |
39 * $FreeBSD: head/sys/netgraph/ng_pptpgre.c 108107 2002-12-19 22:58:27Z bmilekic $ | 39 * $FreeBSD: head/sys/netgraph/ng_pptpgre.c 109623 2003-01-21 08:56:16Z alfred $ |
40 * $Whistle: ng_pptpgre.c,v 1.7 1999/12/08 00:10:06 archie Exp $ 41 */ 42 43/* 44 * PPTP/GRE netgraph node type. 45 * 46 * This node type does the GRE encapsulation as specified for the PPTP 47 * protocol (RFC 2637, section 4). This includes sequencing and --- 469 unchanged lines hidden (view full) --- 517 gre->data[gre->hasSeq] = htonl(priv->recvSeq); 518 priv->xmitAck = priv->recvSeq; 519 ng_pptpgre_stop_send_ack_timer(node); 520 } 521 522 /* Prepend GRE header to outgoing frame */ 523 grelen = sizeof(*gre) + sizeof(u_int32_t) * (gre->hasSeq + gre->hasAck); 524 if (m == NULL) { | 40 * $Whistle: ng_pptpgre.c,v 1.7 1999/12/08 00:10:06 archie Exp $ 41 */ 42 43/* 44 * PPTP/GRE netgraph node type. 45 * 46 * This node type does the GRE encapsulation as specified for the PPTP 47 * protocol (RFC 2637, section 4). This includes sequencing and --- 469 unchanged lines hidden (view full) --- 517 gre->data[gre->hasSeq] = htonl(priv->recvSeq); 518 priv->xmitAck = priv->recvSeq; 519 ng_pptpgre_stop_send_ack_timer(node); 520 } 521 522 /* Prepend GRE header to outgoing frame */ 523 grelen = sizeof(*gre) + sizeof(u_int32_t) * (gre->hasSeq + gre->hasAck); 524 if (m == NULL) { |
525 MGETHDR(m, M_DONTWAIT, MT_DATA); | 525 MGETHDR(m, M_NOWAIT, MT_DATA); |
526 if (m == NULL) { 527 priv->stats.memoryFailures++; 528 if (item) 529 NG_FREE_ITEM(item); 530 return (ENOBUFS); 531 } 532 m->m_len = m->m_pkthdr.len = grelen; 533 m->m_pkthdr.rcvif = NULL; 534 } else { | 526 if (m == NULL) { 527 priv->stats.memoryFailures++; 528 if (item) 529 NG_FREE_ITEM(item); 530 return (ENOBUFS); 531 } 532 m->m_len = m->m_pkthdr.len = grelen; 533 m->m_pkthdr.rcvif = NULL; 534 } else { |
535 M_PREPEND(m, grelen, M_DONTWAIT); | 535 M_PREPEND(m, grelen, M_NOWAIT); |
536 if (m == NULL || (m->m_len < grelen 537 && (m = m_pullup(m, grelen)) == NULL)) { 538 priv->stats.memoryFailures++; 539 if (item) 540 NG_FREE_ITEM(item); 541 return (ENOBUFS); 542 } 543 } --- 463 unchanged lines hidden --- | 536 if (m == NULL || (m->m_len < grelen 537 && (m = m_pullup(m, grelen)) == NULL)) { 538 priv->stats.memoryFailures++; 539 if (item) 540 NG_FREE_ITEM(item); 541 return (ENOBUFS); 542 } 543 } --- 463 unchanged lines hidden --- |