xref: /illumos-gate/usr/src/uts/common/inet/ip/ip_if.c (revision bbf21555)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fecf4ec7Sja  * Common Development and Distribution License (the "License").
6fecf4ec7Sja  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
221f19738eSmeem  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
231f19738eSmeem  * Copyright (c) 1990 Mentat Inc.
24299625c6SSebastien Roy  * Copyright (c) 2013 by Delphix. All rights reserved.
25854956ceSBryan Cantrill  * Copyright (c) 2016, Joyent, Inc. All rights reserved.
26843ea709SDan McDonald  * Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * This file contains the interface control functions for IP.
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include <sys/types.h>
347c478bd9Sstevel@tonic-gate #include <sys/stream.h>
357c478bd9Sstevel@tonic-gate #include <sys/dlpi.h>
367c478bd9Sstevel@tonic-gate #include <sys/stropts.h>
377c478bd9Sstevel@tonic-gate #include <sys/strsun.h>
387c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h>
39de8c4a14SErik Nordmark #include <sys/strsubr.h>
407c478bd9Sstevel@tonic-gate #include <sys/strlog.h>
417c478bd9Sstevel@tonic-gate #include <sys/ddi.h>
427c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
437c478bd9Sstevel@tonic-gate #include <sys/cmn_err.h>
447c478bd9Sstevel@tonic-gate #include <sys/kstat.h>
457c478bd9Sstevel@tonic-gate #include <sys/debug.h>
467c478bd9Sstevel@tonic-gate #include <sys/zone.h>
47f4b3ec61Sdh #include <sys/sunldi.h>
48f4b3ec61Sdh #include <sys/file.h>
496a8288c7Scarlsonj #include <sys/bitmap.h>
50da14cebeSEric Cheng #include <sys/cpuvar.h>
51da14cebeSEric Cheng #include <sys/time.h>
52e11c3f44Smeem #include <sys/ctype.h>
537c478bd9Sstevel@tonic-gate #include <sys/kmem.h>
547c478bd9Sstevel@tonic-gate #include <sys/systm.h>
557c478bd9Sstevel@tonic-gate #include <sys/param.h>
567c478bd9Sstevel@tonic-gate #include <sys/socket.h>
577c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
587c478bd9Sstevel@tonic-gate #include <net/if.h>
597c478bd9Sstevel@tonic-gate #include <net/if_arp.h>
607c478bd9Sstevel@tonic-gate #include <net/if_types.h>
617c478bd9Sstevel@tonic-gate #include <net/if_dl.h>
627c478bd9Sstevel@tonic-gate #include <net/route.h>
637c478bd9Sstevel@tonic-gate #include <sys/sockio.h>
647c478bd9Sstevel@tonic-gate #include <netinet/in.h>
657c478bd9Sstevel@tonic-gate #include <netinet/ip6.h>
667c478bd9Sstevel@tonic-gate #include <netinet/icmp6.h>
677c478bd9Sstevel@tonic-gate #include <netinet/igmp_var.h>
687c478bd9Sstevel@tonic-gate #include <sys/policy.h>
697c478bd9Sstevel@tonic-gate #include <sys/ethernet.h>
70da14cebeSEric Cheng #include <sys/callb.h>
71e11c3f44Smeem #include <sys/md5.h>
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #include <inet/common.h>   /* for various inet/mi.h and inet/nd.h needs */
747c478bd9Sstevel@tonic-gate #include <inet/mi.h>
757c478bd9Sstevel@tonic-gate #include <inet/nd.h>
766e91bba0SGirish Moodalbail #include <inet/tunables.h>
777c478bd9Sstevel@tonic-gate #include <inet/arp.h>
78bd670b35SErik Nordmark #include <inet/ip_arp.h>
797c478bd9Sstevel@tonic-gate #include <inet/mib2.h>
807c478bd9Sstevel@tonic-gate #include <inet/ip.h>
817c478bd9Sstevel@tonic-gate #include <inet/ip6.h>
827c478bd9Sstevel@tonic-gate #include <inet/ip6_asp.h>
837c478bd9Sstevel@tonic-gate #include <inet/tcp.h>
847c478bd9Sstevel@tonic-gate #include <inet/ip_multi.h>
857c478bd9Sstevel@tonic-gate #include <inet/ip_ire.h>
86c793af95Ssangeeta #include <inet/ip_ftable.h>
877c478bd9Sstevel@tonic-gate #include <inet/ip_rts.h>
887c478bd9Sstevel@tonic-gate #include <inet/ip_ndp.h>
897c478bd9Sstevel@tonic-gate #include <inet/ip_if.h>
90ff550d0eSmasputra #include <inet/ip_impl.h>
917c478bd9Sstevel@tonic-gate #include <inet/sctp_ip.h>
92381a2a9aSdr #include <inet/ip_netinfo.h>
93dbed73cbSSangeeta Misra #include <inet/ilb_ip.h>
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate #include <netinet/igmp.h>
967c478bd9Sstevel@tonic-gate #include <inet/ip_listutils.h>
977c478bd9Sstevel@tonic-gate #include <inet/ipclassifier.h>
98da14cebeSEric Cheng #include <sys/mac_client.h>
99da14cebeSEric Cheng #include <sys/dld.h>
100550b6e40SSowmini Varadhan #include <sys/mac_flow.h>
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #include <sys/systeminfo.h>
1037c478bd9Sstevel@tonic-gate #include <sys/bootconf.h>
1047c478bd9Sstevel@tonic-gate 
10545916cd2Sjpk #include <sys/tsol/tndb.h>
10645916cd2Sjpk #include <sys/tsol/tnet.h>
10745916cd2Sjpk 
1086e91bba0SGirish Moodalbail #include <inet/rawip_impl.h> /* needed for icmp_stack_t */
1096e91bba0SGirish Moodalbail #include <inet/udp_impl.h> /* needed for udp_stack_t */
1106e91bba0SGirish Moodalbail 
1117c478bd9Sstevel@tonic-gate /* The character which tells where the ill_name ends */
1127c478bd9Sstevel@tonic-gate #define	IPIF_SEPARATOR_CHAR	':'
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate /* IP ioctl function table entry */
1157c478bd9Sstevel@tonic-gate typedef struct ipft_s {
1167c478bd9Sstevel@tonic-gate 	int	ipft_cmd;
1177c478bd9Sstevel@tonic-gate 	pfi_t	ipft_pfi;
1187c478bd9Sstevel@tonic-gate 	int	ipft_min_size;
1197c478bd9Sstevel@tonic-gate 	int	ipft_flags;
1207c478bd9Sstevel@tonic-gate } ipft_t;
1217c478bd9Sstevel@tonic-gate #define	IPFT_F_NO_REPLY		0x1	/* IP ioctl does not expect any reply */
1227c478bd9Sstevel@tonic-gate #define	IPFT_F_SELF_REPLY	0x2	/* ioctl callee does the ioctl reply */
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate static int	nd_ill_forward_get(queue_t *, mblk_t *, caddr_t, cred_t *);
1257c478bd9Sstevel@tonic-gate static int	nd_ill_forward_set(queue_t *q, mblk_t *mp,
1267c478bd9Sstevel@tonic-gate 		    char *value, caddr_t cp, cred_t *ioc_cr);
1277c478bd9Sstevel@tonic-gate 
128968d2fd1Ssowmini static boolean_t ill_is_quiescent(ill_t *);
1297c478bd9Sstevel@tonic-gate static boolean_t ip_addr_ok_v4(ipaddr_t addr, ipaddr_t subnet_mask);
1307c478bd9Sstevel@tonic-gate static ip_m_t	*ip_m_lookup(t_uscalar_t mac_type);
1317c478bd9Sstevel@tonic-gate static int	ip_sioctl_addr_tail(ipif_t *ipif, sin_t *sin, queue_t *q,
1327c478bd9Sstevel@tonic-gate     mblk_t *mp, boolean_t need_up);
1337c478bd9Sstevel@tonic-gate static int	ip_sioctl_dstaddr_tail(ipif_t *ipif, sin_t *sin, queue_t *q,
1347c478bd9Sstevel@tonic-gate     mblk_t *mp, boolean_t need_up);
1357c478bd9Sstevel@tonic-gate static int	ip_sioctl_slifzone_tail(ipif_t *ipif, zoneid_t zoneid,
1367c478bd9Sstevel@tonic-gate     queue_t *q, mblk_t *mp, boolean_t need_up);
1377c478bd9Sstevel@tonic-gate static int	ip_sioctl_flags_tail(ipif_t *ipif, uint64_t flags, queue_t *q,
1387924222fSmeem     mblk_t *mp);
1397c478bd9Sstevel@tonic-gate static int	ip_sioctl_netmask_tail(ipif_t *ipif, sin_t *sin, queue_t *q,
1407c478bd9Sstevel@tonic-gate     mblk_t *mp);
1417c478bd9Sstevel@tonic-gate static int	ip_sioctl_subnet_tail(ipif_t *ipif, in6_addr_t, in6_addr_t,
1427c478bd9Sstevel@tonic-gate     queue_t *q, mblk_t *mp, boolean_t need_up);
143e6ed03fcSmeem static int	ip_sioctl_plink_ipmod(ipsq_t *ipsq, queue_t *q, mblk_t *mp,
144bd670b35SErik Nordmark     int ioccmd, struct linkblk *li);
145f4b3ec61Sdh static ipaddr_t	ip_subnet_mask(ipaddr_t addr, ipif_t **, ip_stack_t *);
1467c478bd9Sstevel@tonic-gate static void	ip_wput_ioctl(queue_t *q, mblk_t *mp);
1477c478bd9Sstevel@tonic-gate static void	ipsq_flush(ill_t *ill);
1488df01f76Smeem 
1497c478bd9Sstevel@tonic-gate static	int	ip_sioctl_token_tail(ipif_t *ipif, sin6_t *sin6, int addrlen,
1507c478bd9Sstevel@tonic-gate     queue_t *q, mblk_t *mp, boolean_t need_up);
1517c478bd9Sstevel@tonic-gate static void	ipsq_delete(ipsq_t *);
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate static ipif_t	*ipif_allocate(ill_t *ill, int id, uint_t ire_type,
154e899e593SGirish Moodalbail     boolean_t initialize, boolean_t insert, int *errorp);
155e6ed03fcSmeem static ire_t	**ipif_create_bcast_ires(ipif_t *ipif, ire_t **irep);
156bd670b35SErik Nordmark static void	ipif_delete_bcast_ires(ipif_t *ipif);
157bd670b35SErik Nordmark static int	ipif_add_ires_v4(ipif_t *, boolean_t);
15848de1bd2Skcpoon static boolean_t ipif_comp_multi(ipif_t *old_ipif, ipif_t *new_ipif,
15948de1bd2Skcpoon 		    boolean_t isv6);
1607c478bd9Sstevel@tonic-gate static int	ipif_logical_down(ipif_t *ipif, queue_t *q, mblk_t *mp);
1617c478bd9Sstevel@tonic-gate static void	ipif_free(ipif_t *ipif);
1627c478bd9Sstevel@tonic-gate static void	ipif_free_tail(ipif_t *ipif);
1637c478bd9Sstevel@tonic-gate static void	ipif_set_default(ipif_t *ipif);
1647c478bd9Sstevel@tonic-gate static int	ipif_set_values(queue_t *q, mblk_t *mp,
1657c478bd9Sstevel@tonic-gate     char *interf_name, uint_t *ppa);
1667c478bd9Sstevel@tonic-gate static int	ipif_set_values_tail(ill_t *ill, ipif_t *ipif, mblk_t *mp,
1677c478bd9Sstevel@tonic-gate     queue_t *q);
1687c478bd9Sstevel@tonic-gate static ipif_t	*ipif_lookup_on_name(char *name, size_t namelen,
1697c478bd9Sstevel@tonic-gate     boolean_t do_alloc, boolean_t *exists, boolean_t isv6, zoneid_t zoneid,
170bd670b35SErik Nordmark     ip_stack_t *);
171d6699634SErik Nordmark static ipif_t	*ipif_lookup_on_name_async(char *name, size_t namelen,
172d6699634SErik Nordmark     boolean_t isv6, zoneid_t zoneid, queue_t *q, mblk_t *mp, ipsq_func_t func,
173d6699634SErik Nordmark     int *error, ip_stack_t *);
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate static int	ill_alloc_ppa(ill_if_t *, ill_t *);
1767c478bd9Sstevel@tonic-gate static void	ill_delete_interface_type(ill_if_t *);
1777c478bd9Sstevel@tonic-gate static int	ill_dl_up(ill_t *ill, ipif_t *ipif, mblk_t *mp, queue_t *q);
17869bb4bb4Scarlsonj static void	ill_dl_down(ill_t *ill);
1797c478bd9Sstevel@tonic-gate static void	ill_down(ill_t *ill);
1801cb875aeSCathy Zhou static void	ill_down_ipifs(ill_t *, boolean_t);
1817c478bd9Sstevel@tonic-gate static void	ill_free_mib(ill_t *ill);
1827c478bd9Sstevel@tonic-gate static void	ill_glist_delete(ill_t *);
1837c478bd9Sstevel@tonic-gate static void	ill_phyint_reinit(ill_t *ill);
1847c478bd9Sstevel@tonic-gate static void	ill_set_nce_router_flags(ill_t *, boolean_t);
185b051ecf6Smeem static void	ill_set_phys_addr_tail(ipsq_t *, queue_t *, mblk_t *, void *);
1865d460eafSCathy Zhou static void	ill_replumb_tail(ipsq_t *, queue_t *, mblk_t *, void *);
1875d460eafSCathy Zhou 
188e11c3f44Smeem static ip_v6intfid_func_t ip_ether_v6intfid, ip_ib_v6intfid;
1892b24ab6bSSebastien Roy static ip_v6intfid_func_t ip_ipv4_v6intfid, ip_ipv6_v6intfid;
190e11c3f44Smeem static ip_v6intfid_func_t ip_ipmp_v6intfid, ip_nodef_v6intfid;
1912b24ab6bSSebastien Roy static ip_v6intfid_func_t ip_ipv4_v6destintfid, ip_ipv6_v6destintfid;
192bd670b35SErik Nordmark static ip_v4mapinfo_func_t ip_ether_v4_mapping;
193bd670b35SErik Nordmark static ip_v6mapinfo_func_t ip_ether_v6_mapping;
194bd670b35SErik Nordmark static ip_v4mapinfo_func_t ip_ib_v4_mapping;
195bd670b35SErik Nordmark static ip_v6mapinfo_func_t ip_ib_v6_mapping;
196bd670b35SErik Nordmark static ip_v4mapinfo_func_t ip_mbcast_mapping;
1978a06b3d6SToomas Soome static void	ip_cgtp_bcast_add(ire_t *, ip_stack_t *);
1988a06b3d6SToomas Soome static void	ip_cgtp_bcast_delete(ire_t *, ip_stack_t *);
199e11c3f44Smeem static void	phyint_free(phyint_t *);
2007c478bd9Sstevel@tonic-gate 
201bd670b35SErik Nordmark static void ill_capability_dispatch(ill_t *, mblk_t *, dl_capability_sub_t *);
2027c478bd9Sstevel@tonic-gate static void ill_capability_id_ack(ill_t *, mblk_t *, dl_capability_sub_t *);
2031cb875aeSCathy Zhou static void ill_capability_vrrp_ack(ill_t *, mblk_t *, dl_capability_sub_t *);
2047c478bd9Sstevel@tonic-gate static void ill_capability_hcksum_ack(ill_t *, mblk_t *, dl_capability_sub_t *);
205da14cebeSEric Cheng static void ill_capability_hcksum_reset_fill(ill_t *, mblk_t *);
2067c478bd9Sstevel@tonic-gate static void ill_capability_zerocopy_ack(ill_t *, mblk_t *,
2077c478bd9Sstevel@tonic-gate     dl_capability_sub_t *);
208da14cebeSEric Cheng static void ill_capability_zerocopy_reset_fill(ill_t *, mblk_t *);
209da14cebeSEric Cheng static void	ill_capability_dld_reset_fill(ill_t *, mblk_t *);
210da14cebeSEric Cheng static void	ill_capability_dld_ack(ill_t *, mblk_t *,
211da14cebeSEric Cheng 		    dl_capability_sub_t *);
212da14cebeSEric Cheng static void	ill_capability_dld_enable(ill_t *);
213da14cebeSEric Cheng static void	ill_capability_ack_thr(void *);
214da14cebeSEric Cheng static void	ill_capability_lso_enable(ill_t *);
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate static ill_t	*ill_prev_usesrc(ill_t *);
2177c478bd9Sstevel@tonic-gate static int	ill_relink_usesrc_ills(ill_t *, ill_t *, uint_t);
2187c478bd9Sstevel@tonic-gate static void	ill_disband_usesrc_group(ill_t *);
219bd670b35SErik Nordmark static void	ip_sioctl_garp_reply(mblk_t *, ill_t *, void *, int);
2207c478bd9Sstevel@tonic-gate 
2216a8288c7Scarlsonj #ifdef DEBUG
222bd670b35SErik Nordmark static	void	ill_trace_cleanup(const ill_t *);
223bd670b35SErik Nordmark static	void	ipif_trace_cleanup(const ipif_t *);
2246a8288c7Scarlsonj #endif
2256a8288c7Scarlsonj 
2265104857dSThirumalai Srinivasan static	void	ill_dlpi_clear_deferred(ill_t *ill);
2275104857dSThirumalai Srinivasan 
228f949c386SJoshua M. Clulow static	void	phyint_flags_init(phyint_t *, t_uscalar_t);
229f949c386SJoshua M. Clulow 
2307c478bd9Sstevel@tonic-gate /*
2317c478bd9Sstevel@tonic-gate  * if we go over the memory footprint limit more than once in this msec
2327c478bd9Sstevel@tonic-gate  * interval, we'll start pruning aggressively.
2337c478bd9Sstevel@tonic-gate  */
2347c478bd9Sstevel@tonic-gate int ip_min_frag_prune_time = 0;
2357c478bd9Sstevel@tonic-gate 
2367c478bd9Sstevel@tonic-gate static ipft_t	ip_ioctl_ftbl[] = {
2377c478bd9Sstevel@tonic-gate 	{ IP_IOC_IRE_DELETE, ip_ire_delete, sizeof (ipid_t), 0 },
2387c478bd9Sstevel@tonic-gate 	{ IP_IOC_IRE_DELETE_NO_REPLY, ip_ire_delete, sizeof (ipid_t),
2397c478bd9Sstevel@tonic-gate 		IPFT_F_NO_REPLY },
2407c478bd9Sstevel@tonic-gate 	{ IP_IOC_RTS_REQUEST, ip_rts_request, 0, IPFT_F_SELF_REPLY },
2417c478bd9Sstevel@tonic-gate 	{ 0 }
2427c478bd9Sstevel@tonic-gate };
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate /* Simple ICMP IP Header Template */
2457c478bd9Sstevel@tonic-gate static ipha_t icmp_ipha = {
2467c478bd9Sstevel@tonic-gate 	IP_SIMPLE_HDR_VERSION, 0, 0, 0, 0, 0, IPPROTO_ICMP
2477c478bd9Sstevel@tonic-gate };
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate static uchar_t	ip_six_byte_all_ones[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
2507c478bd9Sstevel@tonic-gate 
251b127ac41SPhilip Kirk static ip_m_t   ip_m_tbl[] = {
2522b24ab6bSSebastien Roy 	{ DL_ETHER, IFT_ETHER, ETHERTYPE_IP, ETHERTYPE_IPV6,
253bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_ether_v6intfid,
2547c478bd9Sstevel@tonic-gate 	    ip_nodef_v6intfid },
2552b24ab6bSSebastien Roy 	{ DL_CSMACD, IFT_ISO88023, ETHERTYPE_IP, ETHERTYPE_IPV6,
256bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_nodef_v6intfid,
2577c478bd9Sstevel@tonic-gate 	    ip_nodef_v6intfid },
2582b24ab6bSSebastien Roy 	{ DL_TPB, IFT_ISO88024, ETHERTYPE_IP, ETHERTYPE_IPV6,
259bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_nodef_v6intfid,
2607c478bd9Sstevel@tonic-gate 	    ip_nodef_v6intfid },
2612b24ab6bSSebastien Roy 	{ DL_TPR, IFT_ISO88025, ETHERTYPE_IP, ETHERTYPE_IPV6,
262bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_nodef_v6intfid,
2632b24ab6bSSebastien Roy 	    ip_nodef_v6intfid },
2642b24ab6bSSebastien Roy 	{ DL_FDDI, IFT_FDDI, ETHERTYPE_IP, ETHERTYPE_IPV6,
265bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_ether_v6intfid,
2662b24ab6bSSebastien Roy 	    ip_nodef_v6intfid },
2672b24ab6bSSebastien Roy 	{ DL_IB, IFT_IB, ETHERTYPE_IP, ETHERTYPE_IPV6,
268bd670b35SErik Nordmark 	    ip_ib_v4_mapping, ip_ib_v6_mapping, ip_ib_v6intfid,
269bd670b35SErik Nordmark 	    ip_nodef_v6intfid },
270bd670b35SErik Nordmark 	{ DL_IPV4, IFT_IPV4, IPPROTO_ENCAP, IPPROTO_IPV6,
271bd670b35SErik Nordmark 	    ip_mbcast_mapping, ip_mbcast_mapping, ip_ipv4_v6intfid,
272bd670b35SErik Nordmark 	    ip_ipv4_v6destintfid },
273bd670b35SErik Nordmark 	{ DL_IPV6, IFT_IPV6, IPPROTO_ENCAP, IPPROTO_IPV6,
274bd670b35SErik Nordmark 	    ip_mbcast_mapping, ip_mbcast_mapping, ip_ipv6_v6intfid,
275bd670b35SErik Nordmark 	    ip_ipv6_v6destintfid },
276bd670b35SErik Nordmark 	{ DL_6TO4, IFT_6TO4, IPPROTO_ENCAP, IPPROTO_IPV6,
277bd670b35SErik Nordmark 	    ip_mbcast_mapping, ip_mbcast_mapping, ip_ipv4_v6intfid,
2782b24ab6bSSebastien Roy 	    ip_nodef_v6intfid },
2792b24ab6bSSebastien Roy 	{ SUNW_DL_VNI, IFT_OTHER, ETHERTYPE_IP, ETHERTYPE_IPV6,
2802b24ab6bSSebastien Roy 	    NULL, NULL, ip_nodef_v6intfid, ip_nodef_v6intfid },
2812b24ab6bSSebastien Roy 	{ SUNW_DL_IPMP, IFT_OTHER, ETHERTYPE_IP, ETHERTYPE_IPV6,
2822b24ab6bSSebastien Roy 	    NULL, NULL, ip_ipmp_v6intfid, ip_nodef_v6intfid },
2832b24ab6bSSebastien Roy 	{ DL_OTHER, IFT_OTHER, ETHERTYPE_IP, ETHERTYPE_IPV6,
284bd670b35SErik Nordmark 	    ip_ether_v4_mapping, ip_ether_v6_mapping, ip_nodef_v6intfid,
2857c478bd9Sstevel@tonic-gate 	    ip_nodef_v6intfid }
2867c478bd9Sstevel@tonic-gate };
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate char	ipif_loopback_name[] = "lo0";
289721fffe3SKacheong Poon 
290721fffe3SKacheong Poon /* These are used by all IP network modules. */
291721fffe3SKacheong Poon sin6_t	sin6_null;	/* Zero address for quick clears */
292