ng_btsocket_l2cap.c (108107) | ng_btsocket_l2cap.c (109623) |
---|---|
1/* 2 * ng_btsocket_l2cap.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: ng_btsocket_l2cap.c,v 1.5 2002/10/26 03:34:37 max Exp $ | 1/* 2 * ng_btsocket_l2cap.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: ng_btsocket_l2cap.c,v 1.5 2002/10/26 03:34:37 max Exp $ |
29 * $FreeBSD: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c 108107 2002-12-19 22:58:27Z bmilekic $ | 29 * $FreeBSD: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c 109623 2003-01-21 08:56:16Z alfred $ |
30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/domain.h> 35#include <sys/endian.h> 36#include <sys/errno.h> 37#include <sys/filedesc.h> --- 1421 unchanged lines hidden (view full) --- 1459 goto next; 1460 1461 /* 1462 * Create a copy of the packet and append it to the 1463 * socket's queue. If m_dup() failed - no big deal 1464 * it is a broadcast traffic after all 1465 */ 1466 | 30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/domain.h> 35#include <sys/endian.h> 36#include <sys/errno.h> 37#include <sys/filedesc.h> --- 1421 unchanged lines hidden (view full) --- 1459 goto next; 1460 1461 /* 1462 * Create a copy of the packet and append it to the 1463 * socket's queue. If m_dup() failed - no big deal 1464 * it is a broadcast traffic after all 1465 */ 1466 |
1467 copy = m_dup(m, M_DONTWAIT); | 1467 copy = m_dup(m, M_NOWAIT); |
1468 if (copy != NULL) { 1469 sbappendrecord(&pcb->so->so_rcv, copy); 1470 sorwakeup(pcb->so); 1471 } 1472next: 1473 mtx_unlock(&pcb->pcb_mtx); 1474 } 1475 --- 903 unchanged lines hidden (view full) --- 2379 ng_l2cap_l2ca_hdr_t *hdr = NULL; 2380 int error = 0; 2381 2382 mtx_assert(&pcb->pcb_mtx, MA_OWNED); 2383 2384 if (pcb->so->so_snd.sb_cc == 0) 2385 return (EINVAL); /* XXX */ 2386 | 1468 if (copy != NULL) { 1469 sbappendrecord(&pcb->so->so_rcv, copy); 1470 sorwakeup(pcb->so); 1471 } 1472next: 1473 mtx_unlock(&pcb->pcb_mtx); 1474 } 1475 --- 903 unchanged lines hidden (view full) --- 2379 ng_l2cap_l2ca_hdr_t *hdr = NULL; 2380 int error = 0; 2381 2382 mtx_assert(&pcb->pcb_mtx, MA_OWNED); 2383 2384 if (pcb->so->so_snd.sb_cc == 0) 2385 return (EINVAL); /* XXX */ 2386 |
2387 m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); | 2387 m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); |
2388 if (m == NULL) 2389 return (ENOBUFS); 2390 2391 /* Create L2CA packet header */ 2392 M_PREPEND(m, sizeof(*hdr), M_NOWAIT); 2393 if (m != NULL) 2394 if (m->m_len < sizeof(*hdr)) 2395 m = m_pullup(m, sizeof(*hdr)); --- 322 unchanged lines hidden --- | 2388 if (m == NULL) 2389 return (ENOBUFS); 2390 2391 /* Create L2CA packet header */ 2392 M_PREPEND(m, sizeof(*hdr), M_NOWAIT); 2393 if (m != NULL) 2394 if (m->m_len < sizeof(*hdr)) 2395 m = m_pullup(m, sizeof(*hdr)); --- 322 unchanged lines hidden --- |