rtsock.c (200473) | rtsock.c (201282) |
---|---|
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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 |
30 * $FreeBSD: head/sys/net/rtsock.c 200473 2009-12-13 13:57:32Z bz $ | 30 * $FreeBSD: head/sys/net/rtsock.c 201282 2009-12-30 21:35:34Z qingli $ |
31 */ 32#include "opt_sctp.h" 33#include "opt_mpath.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36 37#include <sys/param.h> 38#include <sys/jail.h> --- 16 unchanged lines hidden (view full) --- 55#include <net/if_dl.h> 56#include <net/if_llatbl.h> 57#include <net/netisr.h> 58#include <net/raw_cb.h> 59#include <net/route.h> 60#include <net/vnet.h> 61 62#include <netinet/in.h> | 31 */ 32#include "opt_sctp.h" 33#include "opt_mpath.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36 37#include <sys/param.h> 38#include <sys/jail.h> --- 16 unchanged lines hidden (view full) --- 55#include <net/if_dl.h> 56#include <net/if_llatbl.h> 57#include <net/netisr.h> 58#include <net/raw_cb.h> 59#include <net/route.h> 60#include <net/vnet.h> 61 62#include <netinet/in.h> |
63#include <netinet/if_ether.h> |
|
63#ifdef INET6 64#include <netinet6/scope6_var.h> 65#endif 66 67#if defined(INET) || defined(INET6) 68#ifdef SCTP 69extern void sctp_addr_change(struct ifaddr *ifa, int cmd); 70#endif /* SCTP */ --- 546 unchanged lines hidden (view full) --- 617 (rtm->rtm_type != RTM_GET || info.rti_info[RTAX_GATEWAY])) { 618 rt = rt_mpath_matchgate(rt, info.rti_info[RTAX_GATEWAY]); 619 if (!rt) { 620 RADIX_NODE_HEAD_RUNLOCK(rnh); 621 senderr(ESRCH); 622 } 623 } 624#endif | 64#ifdef INET6 65#include <netinet6/scope6_var.h> 66#endif 67 68#if defined(INET) || defined(INET6) 69#ifdef SCTP 70extern void sctp_addr_change(struct ifaddr *ifa, int cmd); 71#endif /* SCTP */ --- 546 unchanged lines hidden (view full) --- 618 (rtm->rtm_type != RTM_GET || info.rti_info[RTAX_GATEWAY])) { 619 rt = rt_mpath_matchgate(rt, info.rti_info[RTAX_GATEWAY]); 620 if (!rt) { 621 RADIX_NODE_HEAD_RUNLOCK(rnh); 622 senderr(ESRCH); 623 } 624 } 625#endif |
626 /* 627 * If performing proxied L2 entry insertion, and 628 * the actual PPP host entry is found, perform 629 * another search to retrieve the prefix route of 630 * the local end point of the PPP link. 631 */ 632 if ((rtm->rtm_flags & RTF_ANNOUNCE) && 633 (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { 634 struct sockaddr laddr; 635 rt_maskedcopy(rt->rt_ifa->ifa_addr, 636 &laddr, 637 rt->rt_ifa->ifa_netmask); 638 /* 639 * refactor rt and no lock operation necessary 640 */ 641 rt = (struct rtentry *)rnh->rnh_matchaddr(&laddr, rnh); 642 if (rt == NULL) { 643 RADIX_NODE_HEAD_RUNLOCK(rnh); 644 senderr(ESRCH); 645 } 646 } |
|
625 RT_LOCK(rt); 626 RT_ADDREF(rt); 627 RADIX_NODE_HEAD_RUNLOCK(rnh); 628 629 /* 630 * Fix for PR: 82974 631 * 632 * RTM_CHANGE/LOCK need a perfect match, rn_lookup() --- 929 unchanged lines hidden --- | 647 RT_LOCK(rt); 648 RT_ADDREF(rt); 649 RADIX_NODE_HEAD_RUNLOCK(rnh); 650 651 /* 652 * Fix for PR: 82974 653 * 654 * RTM_CHANGE/LOCK need a perfect match, rn_lookup() --- 929 unchanged lines hidden --- |