Deleted Added
full compact
ng_base.c (231760) ng_base.c (231761)
1/*-
2 * Copyright (c) 1996-1999 Whistle Communications, Inc.
3 * All rights reserved.
4 *
5 * Subject to the following obligations and disclaimer of warranty, use and
6 * redistribution of this software, in source or object code forms, with or
7 * without modifications are expressly permitted by Whistle Communications;
8 * provided, however, that:

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

29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
32 * OF SUCH DAMAGE.
33 *
34 * Authors: Julian Elischer <julian@freebsd.org>
35 * Archie Cobbs <archie@freebsd.org>
36 *
1/*-
2 * Copyright (c) 1996-1999 Whistle Communications, Inc.
3 * All rights reserved.
4 *
5 * Subject to the following obligations and disclaimer of warranty, use and
6 * redistribution of this software, in source or object code forms, with or
7 * without modifications are expressly permitted by Whistle Communications;
8 * provided, however, that:

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

29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
32 * OF SUCH DAMAGE.
33 *
34 * Authors: Julian Elischer <julian@freebsd.org>
35 * Archie Cobbs <archie@freebsd.org>
36 *
37 * $FreeBSD: head/sys/netgraph/ng_base.c 231760 2012-02-15 14:26:50Z glebius $
37 * $FreeBSD: head/sys/netgraph/ng_base.c 231761 2012-02-15 14:29:23Z glebius $
38 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $
39 */
40
41/*
42 * This file implements the base netgraph code.
43 */
44
45#include <sys/param.h>

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

1156int
1157ng_bypass(hook_p hook1, hook_p hook2)
1158{
1159 if (hook1->hk_node != hook2->hk_node) {
1160 TRAP_ERROR();
1161 return (EINVAL);
1162 }
1163 mtx_lock(&ng_topo_mtx);
38 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $
39 */
40
41/*
42 * This file implements the base netgraph code.
43 */
44
45#include <sys/param.h>

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

1156int
1157ng_bypass(hook_p hook1, hook_p hook2)
1158{
1159 if (hook1->hk_node != hook2->hk_node) {
1160 TRAP_ERROR();
1161 return (EINVAL);
1162 }
1163 mtx_lock(&ng_topo_mtx);
1164 if (NG_HOOK_NOT_VALID(hook1) || NG_HOOK_NOT_VALID(hook2)) {
1165 mtx_unlock(&ng_topo_mtx);
1166 return (EINVAL);
1167 }
1164 hook1->hk_peer->hk_peer = hook2->hk_peer;
1165 hook2->hk_peer->hk_peer = hook1->hk_peer;
1166
1167 hook1->hk_peer = &ng_deadhook;
1168 hook2->hk_peer = &ng_deadhook;
1169 mtx_unlock(&ng_topo_mtx);
1170
1171 NG_HOOK_UNREF(hook1);

--- 2593 unchanged lines hidden ---
1168 hook1->hk_peer->hk_peer = hook2->hk_peer;
1169 hook2->hk_peer->hk_peer = hook1->hk_peer;
1170
1171 hook1->hk_peer = &ng_deadhook;
1172 hook2->hk_peer = &ng_deadhook;
1173 mtx_unlock(&ng_topo_mtx);
1174
1175 NG_HOOK_UNREF(hook1);

--- 2593 unchanged lines hidden ---