rtsock.c (121816) | rtsock.c (122334) |
---|---|
1/* 2 * Copyright (c) 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 | 1/* 2 * Copyright (c) 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 |
34 * $FreeBSD: head/sys/net/rtsock.c 121816 2003-10-31 18:32:15Z brooks $ | 34 * $FreeBSD: head/sys/net/rtsock.c 122334 2003-11-08 23:36:32Z sam $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/domain.h> 39#include <sys/kernel.h> 40#include <sys/jail.h> 41#include <sys/malloc.h> 42#include <sys/mbuf.h> --- 309 unchanged lines hidden (view full) --- 352 error = rtrequest1(RTM_ADD, &info, &saved_nrt); 353 if (error == 0 && saved_nrt) { 354 RT_LOCK(saved_nrt); 355 rt_setmetrics(rtm->rtm_inits, 356 &rtm->rtm_rmx, &saved_nrt->rt_rmx); 357 saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits); 358 saved_nrt->rt_rmx.rmx_locks |= 359 (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks); | 35 */ 36 37#include <sys/param.h> 38#include <sys/domain.h> 39#include <sys/kernel.h> 40#include <sys/jail.h> 41#include <sys/malloc.h> 42#include <sys/mbuf.h> --- 309 unchanged lines hidden (view full) --- 352 error = rtrequest1(RTM_ADD, &info, &saved_nrt); 353 if (error == 0 && saved_nrt) { 354 RT_LOCK(saved_nrt); 355 rt_setmetrics(rtm->rtm_inits, 356 &rtm->rtm_rmx, &saved_nrt->rt_rmx); 357 saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits); 358 saved_nrt->rt_rmx.rmx_locks |= 359 (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks); |
360 saved_nrt->rt_refcnt--; | 360 RT_REMREF(saved_nrt); |
361 saved_nrt->rt_genmask = info.rti_info[RTAX_GENMASK]; 362 RT_UNLOCK(saved_nrt); 363 } 364 break; 365 366 case RTM_DELETE: 367 saved_nrt = 0; 368 error = rtrequest1(RTM_DELETE, &info, &saved_nrt); --- 12 unchanged lines hidden (view full) --- 381 senderr(EAFNOSUPPORT); 382 RADIX_NODE_HEAD_LOCK(rnh); 383 rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST], 384 info.rti_info[RTAX_NETMASK], rnh); 385 RADIX_NODE_HEAD_UNLOCK(rnh); 386 if (rt == NULL) /* XXX looks bogus */ 387 senderr(ESRCH); 388 RT_LOCK(rt); | 361 saved_nrt->rt_genmask = info.rti_info[RTAX_GENMASK]; 362 RT_UNLOCK(saved_nrt); 363 } 364 break; 365 366 case RTM_DELETE: 367 saved_nrt = 0; 368 error = rtrequest1(RTM_DELETE, &info, &saved_nrt); --- 12 unchanged lines hidden (view full) --- 381 senderr(EAFNOSUPPORT); 382 RADIX_NODE_HEAD_LOCK(rnh); 383 rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST], 384 info.rti_info[RTAX_NETMASK], rnh); 385 RADIX_NODE_HEAD_UNLOCK(rnh); 386 if (rt == NULL) /* XXX looks bogus */ 387 senderr(ESRCH); 388 RT_LOCK(rt); |
389 rt->rt_refcnt++; | 389 RT_ADDREF(rt); |
390 391 switch(rtm->rtm_type) { 392 393 case RTM_GET: 394 report: 395 RT_LOCK_ASSERT(rt); 396 info.rti_info[RTAX_DST] = rt_key(rt); 397 info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; --- 700 unchanged lines hidden --- | 390 391 switch(rtm->rtm_type) { 392 393 case RTM_GET: 394 report: 395 RT_LOCK_ASSERT(rt); 396 info.rti_info[RTAX_DST] = rt_key(rt); 397 info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; --- 700 unchanged lines hidden --- |