ng_socket.c (89306) | ng_socket.c (89319) |
---|---|
1 2/* 3 * ng_socket.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: Julian Elischer <julian@freebsd.org> 38 * | 1 2/* 3 * ng_socket.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: Julian Elischer <julian@freebsd.org> 38 * |
39 * $FreeBSD: head/sys/netgraph/ng_socket.c 89306 2002-01-13 11:58:06Z alfred $ | 39 * $FreeBSD: head/sys/netgraph/ng_socket.c 89319 2002-01-14 00:13:45Z alfred $ |
40 * $Whistle: ng_socket.c,v 1.28 1999/11/01 09:24:52 julian Exp $ 41 */ 42 43/* 44 * Netgraph socket nodes 45 * 46 * There are two types of netgraph sockets, control and data. 47 * Control sockets have a netgraph node, but data sockets are --- 538 unchanged lines hidden (view full) --- 586 if (oldfds != 1) { 587 TRAP_ERROR; 588 return (EINVAL); 589 } 590 591 /* Check that the FD given is legit. and change it to a pointer to a 592 * struct file. */ 593 fd = CMSG_DATA(cm); | 40 * $Whistle: ng_socket.c,v 1.28 1999/11/01 09:24:52 julian Exp $ 41 */ 42 43/* 44 * Netgraph socket nodes 45 * 46 * There are two types of netgraph sockets, control and data. 47 * Control sockets have a netgraph node, but data sockets are --- 538 unchanged lines hidden (view full) --- 586 if (oldfds != 1) { 587 TRAP_ERROR; 588 return (EINVAL); 589 } 590 591 /* Check that the FD given is legit. and change it to a pointer to a 592 * struct file. */ 593 fd = CMSG_DATA(cm); |
594 fp = ffind_hold(td, fd); 595 if (fp == NULL) 596 return (EBADF); | 594 if ((error = fget(td, fd, &fp)) != 0) 595 return (error); |
597 598 /* Depending on what kind of resource it is, act differently. For 599 * devices, we treat it as a file. For a AF_NETGRAPH socket, 600 * shortcut straight to the node. */ 601 switch (fp->f_type) { 602 case DTYPE_VNODE: 603 vn = (struct vnode *) fp->f_data; 604 if (vn && (vn->v_type == VCHR)) { --- 489 unchanged lines hidden --- | 596 597 /* Depending on what kind of resource it is, act differently. For 598 * devices, we treat it as a file. For a AF_NETGRAPH socket, 599 * shortcut straight to the node. */ 600 switch (fp->f_type) { 601 case DTYPE_VNODE: 602 vn = (struct vnode *) fp->f_data; 603 if (vn && (vn->v_type == VCHR)) { --- 489 unchanged lines hidden --- |