4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved
24 */
25 /* Copyright (c) 1990 Mentat Inc. */
26
27 #include <sys/types.h>
28 #include <sys/stream.h>
29 #include <sys/dlpi.h>
30 #include <sys/stropts.h>
31 #include <sys/sysmacros.h>
32 #include <sys/strsubr.h>
33 #include <sys/strlog.h>
34 #include <sys/strsun.h>
35 #include <sys/zone.h>
36 #define _SUN_TPI_VERSION 2
37 #include <sys/tihdr.h>
38 #include <sys/xti_inet.h>
39 #include <sys/ddi.h>
40 #include <sys/sunddi.h>
41 #include <sys/cmn_err.h>
42 #include <sys/debug.h>
43 #include <sys/kobj.h>
763 /* Can not use route cache with TX since the labels can differ */
764 if (ira->ira_flags & IRAF_SYSTEM_LABELED) {
765 if (IN6_IS_ADDR_MULTICAST(&nexthop)) {
766 ire = ire_multicast(ill);
767 } else if (IN6_IS_ADDR_LINKLOCAL(&nexthop)) {
768 ire = ire_linklocal(&nexthop, ill, ira, irr_flags,
769 ipst);
770 } else {
771 /* Match destination and label */
772 ire = ire_route_recursive_v6(&nexthop, 0, NULL,
773 ALL_ZONES, ira->ira_tsl, MATCH_IRE_SECATTR,
774 irr_flags, ira->ira_xmit_hint, ipst, NULL, NULL,
775 NULL);
776 }
777 /* Update the route cache so we do the ire_refrele */
778 ASSERT(ire != NULL);
779 if (rtc->rtc_ire != NULL)
780 ire_refrele(rtc->rtc_ire);
781 rtc->rtc_ire = ire;
782 rtc->rtc_ip6addr = nexthop;
783 } else if (IN6_ARE_ADDR_EQUAL(&nexthop, &rtc->rtc_ip6addr)) {
784 /* Use the route cache */
785 ASSERT(rtc->rtc_ire != NULL);
786 ire = rtc->rtc_ire;
787 } else {
788 /* Update the route cache */
789 if (IN6_IS_ADDR_MULTICAST(&nexthop)) {
790 ire = ire_multicast(ill);
791 } else if (IN6_IS_ADDR_LINKLOCAL(&nexthop)) {
792 ire = ire_linklocal(&nexthop, ill, ira, irr_flags,
793 ipst);
794 } else {
795 ire = ire_route_recursive_dstonly_v6(&nexthop,
796 irr_flags, ira->ira_xmit_hint, ipst);
797 }
798 ASSERT(ire != NULL);
799 if (rtc->rtc_ire != NULL)
800 ire_refrele(rtc->rtc_ire);
801 rtc->rtc_ire = ire;
802 rtc->rtc_ip6addr = nexthop;
803 }
804
805 ire->ire_ib_pkt_count++;
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved
24 *
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 */
27 /* Copyright (c) 1990 Mentat Inc. */
28
29 #include <sys/types.h>
30 #include <sys/stream.h>
31 #include <sys/dlpi.h>
32 #include <sys/stropts.h>
33 #include <sys/sysmacros.h>
34 #include <sys/strsubr.h>
35 #include <sys/strlog.h>
36 #include <sys/strsun.h>
37 #include <sys/zone.h>
38 #define _SUN_TPI_VERSION 2
39 #include <sys/tihdr.h>
40 #include <sys/xti_inet.h>
41 #include <sys/ddi.h>
42 #include <sys/sunddi.h>
43 #include <sys/cmn_err.h>
44 #include <sys/debug.h>
45 #include <sys/kobj.h>
765 /* Can not use route cache with TX since the labels can differ */
766 if (ira->ira_flags & IRAF_SYSTEM_LABELED) {
767 if (IN6_IS_ADDR_MULTICAST(&nexthop)) {
768 ire = ire_multicast(ill);
769 } else if (IN6_IS_ADDR_LINKLOCAL(&nexthop)) {
770 ire = ire_linklocal(&nexthop, ill, ira, irr_flags,
771 ipst);
772 } else {
773 /* Match destination and label */
774 ire = ire_route_recursive_v6(&nexthop, 0, NULL,
775 ALL_ZONES, ira->ira_tsl, MATCH_IRE_SECATTR,
776 irr_flags, ira->ira_xmit_hint, ipst, NULL, NULL,
777 NULL);
778 }
779 /* Update the route cache so we do the ire_refrele */
780 ASSERT(ire != NULL);
781 if (rtc->rtc_ire != NULL)
782 ire_refrele(rtc->rtc_ire);
783 rtc->rtc_ire = ire;
784 rtc->rtc_ip6addr = nexthop;
785 } else if (IN6_ARE_ADDR_EQUAL(&nexthop, &rtc->rtc_ip6addr) &&
786 rtc->rtc_ire != NULL) {
787 /* Use the route cache */
788 ire = rtc->rtc_ire;
789 } else {
790 /* Update the route cache */
791 if (IN6_IS_ADDR_MULTICAST(&nexthop)) {
792 ire = ire_multicast(ill);
793 } else if (IN6_IS_ADDR_LINKLOCAL(&nexthop)) {
794 ire = ire_linklocal(&nexthop, ill, ira, irr_flags,
795 ipst);
796 } else {
797 ire = ire_route_recursive_dstonly_v6(&nexthop,
798 irr_flags, ira->ira_xmit_hint, ipst);
799 }
800 ASSERT(ire != NULL);
801 if (rtc->rtc_ire != NULL)
802 ire_refrele(rtc->rtc_ire);
803 rtc->rtc_ire = ire;
804 rtc->rtc_ip6addr = nexthop;
805 }
806
807 ire->ire_ib_pkt_count++;
|