summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/ip_stack.h
diff options
context:
space:
mode:
authorErik Nordmark <Erik.Nordmark@Sun.COM>2009-11-11 11:49:49 -0800
committerErik Nordmark <Erik.Nordmark@Sun.COM>2009-11-11 11:49:49 -0800
commitbd670b35a010421b6e1a5536c34453a827007c81 (patch)
tree97c2057b6771dd40411a12eb89d2db2e2b2cce31 /usr/src/uts/common/inet/ip_stack.h
parentb3388e4fc5f5c24c8a39fbe132a00b02dae5b717 (diff)
downloadillumos-joyent-bd670b35a010421b6e1a5536c34453a827007c81.tar.gz
PSARC/2009/331 IP Datapath Refactoring
PSARC/2008/522 EOF of 2001/070 IPsec HW Acceleration support PSARC/2009/495 netstat -r flags for blackhole and reject routes PSARC 2009/496 EOF of XRESOLV PSARC/2009/494 IP_DONTFRAG socket option PSARC/2009/515 fragmentation controls for ping and traceroute 6798716 ip_newroute delenda est 6798739 ARP and IP are too separate 6807265 IPv4 ip2mac() support 6756382 Please remove Venus IPsec HWACCEL code 6880632 sendto/sendmsg never returns EHOSTUNREACH in Solaris 6748582 sendmsg() return OK, but doesn't send message using IPv4-mapped x IPv6 addr 1119790 TCP and path mtu discovery 4637227 should support equal-cost multi-path (ECMP) 5078568 getsockopt() for IPV6_PATHMTU on a non-connected socket should not succeed 6419648 "AR* contract private note" should be removed as part of ATM SW EOL 6274715 Arp could keep the old entry in the cache while it waits for an arp response 6605615 Remove duplicated TCP/IP opt_set/opt_get code; use conn_t 6874677 IP_TTL can be used to send with ttl zero 4034090 arp should not let you delete your own entry 6882140 Implement IP_DONTFRAG socket option 6883858 Implement ping -D option; traceroute -F should work for IPv6 and shared-IP zones 1119792 TCP/IP black hole detection is broken on receiver 4078796 Directed broadcast forwarding code has problems 4104337 restrict the IPPROTO_IP and IPPROTO_IPV6 options based on the socket family 4203747 Source address selection for source routed packets 4230259 pmtu is increased every ip_ire_pathmtu_interval timer value. 4300533 When sticky option ipv6_pktinfo set to bogus address subsequent connect time out 4471035 ire_delete_cache_gw is called through ire_walk unnecessarily 4514572 SO_DONTROUTE socket option doesn't work with IPv6 4524980 tcp_lookup_ipv4() should compare the ifindex against tcpb->tcpb_bound_if 4532714 machine fails to switch quickly among failed default routes 4634219 IPv6 path mtu discovery is broken when using routing header 4691581 udp broadcast handling causes too many replicas 4708405 mcast is broken on machines when all interfaces are IFF_POINTOPOINT 4770457 netstat/route: source address of interface routes pretends to be gateway address 4786974 use routing table to determine routes/interface for multicast 4792619 An ip_fanout_udp_ipc_v6() routine might lead to some simpler code 4816115 Nuke ipsec_out_use_global_policy 4862844 ipsec offload corner case 4867533 tcp_rq and tcp_wq are redundant 4868589 NCEs should be shared across an IPMP group 4872093 unplumbing an improper virtual interface panics in ip_newroute_get_dst_ill() 4901671 FireEngine needs some cleanup 4907617 IPsec identity latching should be done before sending SYN-ACK 4941461 scopeid and IPV6_PKTINFO with UDP/ICMP connect() does not work properly 4944981 ip does nothing with IP6I_NEXTHOP 4963353 IPv4 and IPv6 proto fanout codes could be brought closer 4963360 consider passing zoneid using ip6i_t instead of ipsec_out_t in NDP 4963734 new ip6_asp locking is used incorrectly in ip_newroute_v6() 5008315 IPv6 code passes ip6i_t to IPsec code instead of ip6_t 5009636 memory leak in ip_fanout_proto_v6() 5092337 tcp/udp option handling can use some cleanup 5035841 Solaris can fail to create a valid broadcast ire 5043747 ar_query_xmit: Could not find the ace 5051574 tcp_check_policy is missing some checks 6305037 full hardware checksum is discarded when there're more than 2 mblks in the chain 6311149 ip.c needs to be put through a woodchipper 4708860 Unable to reassemble CGTP fragmented multicast packets 6224628 Large IPv6 packets with IPsec protection sometimes have length mismatch. 6213243 Solaris does not currently support Dead Gateway Detection 5029091 duplicate code in IP's input path for TCP/UDP/SCTP 4674643 through IPv6 CGTP routes, the very first packet is sent only after a while 6207318 Multiple default routes do not round robin connections to routers. 4823410 IP has an inconsistent view of link mtu 5105520 adding interface route to down interface causes ifconfig hang 5105707 advanced sockets API introduced some dead code 6318399 IP option handling for icmp and udp is too complicated 6321434 Every dropped packet in IP should use ip_drop_packet() 6341693 ifconfig mtu should operate on the physical interface, not individual ipif's 6352430 The credentials attached to an mblk are not particularly useful 6357894 uninitialised ipp_hoplimit needs to be cleaned up. 6363568 ip_xmit_v6() may be missing IRE releases in error cases 6364828 ip_rput_forward needs a makeover 6384416 System panics when running as multicast forwarder using multicast tunnels 6402382 TX: UDP v6 slowpath is not modified to handle mac_exempt conns 6418413 assertion failed ipha->ipha_ident == 0||ipha->ipha_ident == 0xFFFF 6420916 assertion failures in ipv6 wput path 6430851 use of b_prev to store ifindex is not 100% safe 6446106 IPv6 packets stored in nce->nce_qd_mp will be sent with incorrect tcp/udp checksums 6453711 SCTP OOTB sent as if genetated by global zone 6465212 ARP/IP merge should remove ire_freemblk.esballoc 6490163 ip_input() could misbehave if the first mblk's size is not big enough 6496664 missing ipif_refrele leads to reference leak and deferred crash in ip_wput_ipsec_out_v6 6504856 memory leak in ip_fanout_proto_v6() when using link local outer tunnel addresses 6507765 IRE cache hash function performs badly 6510186 IP_FORWARD_PROG bit is easily overlooked 6514727 cgtp ipv6 failure on snv54 6528286 MULTIRT (CGTP) should offload checksum to hardware 6533904 SCTP: doesn't support traffic class for IPv6 6539415 TX: ipif source selection is flawed for unlabeled gateways 6539851 plumbed unworking nic blocks sending broadcast packets 6564468 non-solaris SCTP stack over rawip socket: netstat command counts rawipInData not rawipOutDatagrams 6568511 ipIfStatsOutDiscards not bumped when discarding an ipsec packet on the wrong NIC 6584162 tcp_g_q_inactive() makes incorrect use of taskq_dispatch() 6603974 round-robin default with many interfaces causes infinite temporary IRE thrashing 6611750 ilm_lookup_ill_index_v4 was born an orphan 6618423 ip_wput_frag_mdt sends out packets that void pfhooks 6620964 IRE max bucket count calculations performed in ip_ire_init() are flawed 6626266 various _broadcasts seem redundant 6638182 IP_PKTINFO + SO_DONTROUTE + CIPSO IP option == panic 6647710 IPv6 possible DoS vulnerability 6657357 nce should be kmem_cache alloc'ed from an nce_cache. 6685131 ilg_add -> conn_ilg_alloc interacting with conn_ilg[] walkers can cause panic. 6730298 adding 0.0.0.0 key with mask != 0 causes 'route delete default' to fail 6730976 vni and ipv6 doesn't quite work. 6740956 assertion failed: mp->b_next == 0L && mp->b_prev == 0L in nce_queue_mp_common() 6748515 BUMP_MIB() is occasionally done on the wrong ill 6753250 ip_output_v6() `notv6' error path has an errant ill_refrele() 6756411 NULL-pointer dereference in ip_wput_local() 6769582 IP must forward packet returned from FW-HOOK 6781525 bogus usesrc usage leads directly to panic 6422839 System paniced in ip_multicast_loopback due to NULL pointer dereference 6785521 initial IPv6 DAD solicitation is dropped in ip_newroute_ipif_v6() 6787370 ipnet devices not seeing forwarded IP packets on outgoing interface 6791187 ip*dbg() calls in ip_output_options() claim to originate from ip_wput() 6794047 nce_fp_mp prevents sharing of NCEs across an IPMP group 6797926 many unnecessary ip0dbg() in ip_rput_data_v6 6846919 Packet queued for ND gets sent in the clear. 6856591 ping doesn't send packets with DF set 6861113 arp module has incorrect dependency path for hook module 6865664 IPV6_NEXTHOP does not work with TCP socket 6874681 No ICMP time exceeded when a router receives packet with ttl = 0 6880977 ip_wput_ire() uses over 1k of stack 6595433 IPsec performance could be significantly better when calling hw crypto provider synchronously 6848397 ifconfig down of an interface can hang. 6849602 IPV6_PATHMTU size issue for UDP 6885359 Add compile-time option for testing pure IPsec overhead 6889268 Odd loopback source address selection with IPMP 6895420 assertion failed: connp->conn_helper_info == NULL 6851189 Routing-related panic occurred during reboot on T2000 system running snv_117 6896174 Post-async-encryption, AH+ESP packets may have misinitialized ipha/ip6 6896687 iptun presents IPv6 with an MTU < 1280 6897006 assertion failed: ipif->ipif_id != 0 in ip_sioctl_slifzone_restart
Diffstat (limited to 'usr/src/uts/common/inet/ip_stack.h')
-rw-r--r--usr/src/uts/common/inet/ip_stack.h156
1 files changed, 78 insertions, 78 deletions
diff --git a/usr/src/uts/common/inet/ip_stack.h b/usr/src/uts/common/inet/ip_stack.h
index b5d9715c65..d2f6c07234 100644
--- a/usr/src/uts/common/inet/ip_stack.h
+++ b/usr/src/uts/common/inet/ip_stack.h
@@ -38,6 +38,7 @@ extern "C" {
#ifdef _KERNEL
#include <sys/list.h>
+
/*
* IP statistics.
*/
@@ -46,52 +47,45 @@ extern "C" {
((ipst)->ips_ip_statistics.x.value.ui64 += (n))
typedef struct ip_stat {
- kstat_named_t ipsec_fanout_proto;
kstat_named_t ip_udp_fannorm;
kstat_named_t ip_udp_fanmb;
- kstat_named_t ip_udp_fanothers;
- kstat_named_t ip_udp_fast_path;
- kstat_named_t ip_udp_slow_path;
- kstat_named_t ip_udp_input_err;
- kstat_named_t ip_tcppullup;
- kstat_named_t ip_tcpoptions;
- kstat_named_t ip_multipkttcp;
- kstat_named_t ip_tcp_fast_path;
- kstat_named_t ip_tcp_slow_path;
- kstat_named_t ip_tcp_input_error;
+ kstat_named_t ip_recv_pullup;
kstat_named_t ip_db_ref;
- kstat_named_t ip_notaligned1;
- kstat_named_t ip_notaligned2;
- kstat_named_t ip_multimblk3;
- kstat_named_t ip_multimblk4;
- kstat_named_t ip_ipoptions;
- kstat_named_t ip_classify_fail;
+ kstat_named_t ip_notaligned;
+ kstat_named_t ip_multimblk;
kstat_named_t ip_opt;
- kstat_named_t ip_udp_rput_local;
kstat_named_t ipsec_proto_ahesp;
kstat_named_t ip_conn_flputbq;
kstat_named_t ip_conn_walk_drain;
kstat_named_t ip_out_sw_cksum;
+ kstat_named_t ip_out_sw_cksum_bytes;
kstat_named_t ip_in_sw_cksum;
- kstat_named_t ip_trash_ire_reclaim_calls;
- kstat_named_t ip_trash_ire_reclaim_success;
- kstat_named_t ip_ire_arp_timer_expired;
- kstat_named_t ip_ire_redirect_timer_expired;
- kstat_named_t ip_ire_pmtu_timer_expired;
- kstat_named_t ip_input_multi_squeue;
+ kstat_named_t ip_ire_reclaim_calls;
+ kstat_named_t ip_ire_reclaim_deleted;
+ kstat_named_t ip_nce_reclaim_calls;
+ kstat_named_t ip_nce_reclaim_deleted;
+ kstat_named_t ip_dce_reclaim_calls;
+ kstat_named_t ip_dce_reclaim_deleted;
kstat_named_t ip_tcp_in_full_hw_cksum_err;
kstat_named_t ip_tcp_in_part_hw_cksum_err;
kstat_named_t ip_tcp_in_sw_cksum_err;
- kstat_named_t ip_tcp_out_sw_cksum_bytes;
kstat_named_t ip_udp_in_full_hw_cksum_err;
kstat_named_t ip_udp_in_part_hw_cksum_err;
kstat_named_t ip_udp_in_sw_cksum_err;
- kstat_named_t ip_udp_out_sw_cksum_bytes;
- kstat_named_t ip_frag_mdt_pkt_out;
- kstat_named_t ip_frag_mdt_discarded;
- kstat_named_t ip_frag_mdt_allocfail;
- kstat_named_t ip_frag_mdt_addpdescfail;
- kstat_named_t ip_frag_mdt_allocd;
+ kstat_named_t conn_in_recvdstaddr;
+ kstat_named_t conn_in_recvopts;
+ kstat_named_t conn_in_recvif;
+ kstat_named_t conn_in_recvslla;
+ kstat_named_t conn_in_recvucred;
+ kstat_named_t conn_in_recvttl;
+ kstat_named_t conn_in_recvhopopts;
+ kstat_named_t conn_in_recvhoplimit;
+ kstat_named_t conn_in_recvdstopts;
+ kstat_named_t conn_in_recvrthdrdstopts;
+ kstat_named_t conn_in_recvrthdr;
+ kstat_named_t conn_in_recvpktinfo;
+ kstat_named_t conn_in_recvtclass;
+ kstat_named_t conn_in_timestamp;
} ip_stat_t;
@@ -103,20 +97,22 @@ typedef struct ip_stat {
((ipst)->ips_ip6_statistics.x.value.ui64 += (n))
typedef struct ip6_stat {
- kstat_named_t ip6_udp_fast_path;
- kstat_named_t ip6_udp_slow_path;
kstat_named_t ip6_udp_fannorm;
kstat_named_t ip6_udp_fanmb;
+ kstat_named_t ip6_recv_pullup;
+ kstat_named_t ip6_db_ref;
+ kstat_named_t ip6_notaligned;
+ kstat_named_t ip6_multimblk;
+ kstat_named_t ipsec_proto_ahesp;
kstat_named_t ip6_out_sw_cksum;
+ kstat_named_t ip6_out_sw_cksum_bytes;
kstat_named_t ip6_in_sw_cksum;
kstat_named_t ip6_tcp_in_full_hw_cksum_err;
kstat_named_t ip6_tcp_in_part_hw_cksum_err;
kstat_named_t ip6_tcp_in_sw_cksum_err;
- kstat_named_t ip6_tcp_out_sw_cksum_bytes;
kstat_named_t ip6_udp_in_full_hw_cksum_err;
kstat_named_t ip6_udp_in_part_hw_cksum_err;
kstat_named_t ip6_udp_in_sw_cksum_err;
- kstat_named_t ip6_udp_out_sw_cksum_bytes;
kstat_named_t ip6_frag_mdt_pkt_out;
kstat_named_t ip6_frag_mdt_discarded;
kstat_named_t ip6_frag_mdt_allocfail;
@@ -150,6 +146,8 @@ typedef struct srcid_map {
struct ip_stack {
netstack_t *ips_netstack; /* Common netstack */
+ uint_t ips_src_generation; /* Both IPv4 and IPv6 */
+
struct ipparam_s *ips_param_arr; /* ndd variable table */
struct ipndp_s *ips_ndp_arr;
@@ -178,10 +176,6 @@ struct ip_stack {
kmutex_t ips_ip_mi_lock;
kmutex_t ips_ip_addr_avail_lock;
krwlock_t ips_ill_g_lock;
- krwlock_t ips_ipsec_capab_ills_lock;
- /* protects the list of IPsec capable ills */
- struct ipsec_capab_ill_s *ips_ipsec_capab_ills_ah;
- struct ipsec_capab_ill_s *ips_ipsec_capab_ills_esp;
krwlock_t ips_ill_g_usesrc_lock;
@@ -198,10 +192,10 @@ struct ip_stack {
struct connf_s *ips_rts_clients;
struct connf_s *ips_ipcl_conn_fanout;
struct connf_s *ips_ipcl_bind_fanout;
- struct connf_s *ips_ipcl_proto_fanout;
+ struct connf_s *ips_ipcl_proto_fanout_v4;
struct connf_s *ips_ipcl_proto_fanout_v6;
struct connf_s *ips_ipcl_udp_fanout;
- struct connf_s *ips_ipcl_raw_fanout;
+ struct connf_s *ips_ipcl_raw_fanout; /* RAW SCTP sockets */
struct connf_s *ips_ipcl_iptun_fanout;
uint_t ips_ipcl_conn_fanout_size;
uint_t ips_ipcl_bind_fanout_size;
@@ -237,31 +231,47 @@ struct ip_stack {
/* IPv4 forwarding table */
struct radix_node_head *ips_ip_ftable;
- /* This is dynamically allocated in ip_ire_init */
- struct irb *ips_ip_cache_table;
-
#define IPV6_ABITS 128
#define IP6_MASK_TABLE_SIZE (IPV6_ABITS + 1) /* 129 ptrs */
-
struct irb *ips_ip_forwarding_table_v6[IP6_MASK_TABLE_SIZE];
- /* This is dynamically allocated in ip_ire_init */
- struct irb *ips_ip_cache_table_v6;
- uint32_t ips_ire_handle;
/*
* ire_ft_init_lock is used while initializing ip_forwarding_table
* dynamically in ire_add.
*/
kmutex_t ips_ire_ft_init_lock;
- kmutex_t ips_ire_handle_lock; /* Protects ire_handle */
- uint32_t ips_ip_cache_table_size;
- uint32_t ips_ip6_cache_table_size;
+ /*
+ * This is the IPv6 counterpart of RADIX_NODE_HEAD_LOCK. It is used
+ * to prevent adds and deletes while we are doing a ftable_lookup
+ * and extracting the ire_generation.
+ */
+ krwlock_t ips_ip6_ire_head_lock;
+
uint32_t ips_ip6_ftable_hash_size;
ire_stats_t ips_ire_stats_v4; /* IPv4 ire statistics */
ire_stats_t ips_ire_stats_v6; /* IPv6 ire statistics */
+ /* Count how many condemned objects for kmem_cache callbacks */
+ uint32_t ips_num_ire_condemned;
+ uint32_t ips_num_nce_condemned;
+ uint32_t ips_num_dce_condemned;
+
+ struct ire_s *ips_ire_reject_v4; /* For unreachable dests */
+ struct ire_s *ips_ire_reject_v6; /* For unreachable dests */
+ struct ire_s *ips_ire_blackhole_v4; /* For temporary failures */
+ struct ire_s *ips_ire_blackhole_v6; /* For temporary failures */
+
+ /* ips_ire_dep_lock protects ire_dep_* relationship between IREs */
+ krwlock_t ips_ire_dep_lock;
+
+ /* Destination Cache Entries */
+ struct dce_s *ips_dce_default;
+ uint_t ips_dce_hashsize;
+ struct dcb_s *ips_dce_hash_v4;
+ struct dcb_s *ips_dce_hash_v6;
+
/* pending binds */
mblk_t *ips_ip6_asp_pending_ops;
mblk_t *ips_ip6_asp_pending_ops_tail;
@@ -293,9 +303,10 @@ struct ip_stack {
uint_t ips_icmp_pkt_err_sent;
/* Protected by ip_mi_lock */
- void *ips_ip_g_head; /* Instance Data List Head */
+ void *ips_ip_g_head; /* IP Instance Data List Head */
+ void *ips_arp_g_head; /* ARP Instance Data List Head */
- caddr_t ips_ip_g_nd; /* Named Dispatch List Head */
+ caddr_t ips_ip_g_nd; /* Named Dispatch List Head */
/* Multirouting stuff */
/* Interval (in ms) between consecutive 'bad MTU' warnings */
@@ -306,27 +317,11 @@ struct ip_stack {
struct cgtp_filter_ops *ips_ip_cgtp_filter_ops; /* CGTP hooks */
boolean_t ips_ip_cgtp_filter; /* Enable/disable CGTP hooks */
- kmutex_t ips_ip_trash_timer_lock;
- timeout_id_t ips_ip_ire_expire_id; /* IRE expiration timer. */
struct ipsq_s *ips_ipsq_g_head;
uint_t ips_ill_index; /* Used to assign interface indicies */
/* When set search for unused index */
boolean_t ips_ill_index_wrap;
- clock_t ips_ip_ire_arp_time_elapsed;
- /* Time since IRE cache last flushed */
- clock_t ips_ip_ire_rd_time_elapsed;
- /* ... redirect IREs last flushed */
- clock_t ips_ip_ire_pmtu_time_elapsed;
- /* Time since path mtu increase */
-
- uint_t ips_ip_redirect_cnt;
- /* Num of redirect routes in ftable */
- uint_t ips_ipv6_ire_default_count;
- /* Number of IPv6 IRE_DEFAULT entries */
- uint_t ips_ipv6_ire_default_index;
- /* Walking IPv6 index used to mod in */
-
uint_t ips_loopback_packets;
/* NDP/NCE structures for IPv4 and IPv6 */
@@ -379,15 +374,17 @@ struct ip_stack {
struct srcid_map *ips_srcid_head;
krwlock_t ips_srcid_lock;
- uint64_t ips_ipif_g_seqid;
+ uint64_t ips_ipif_g_seqid; /* Used only for sctp_addr.c */
union phyint_list_u *ips_phyint_g_list; /* start of phyint list */
-/* ip_neti.c */
+/* ip_netinfo.c */
hook_family_t ips_ipv4root;
hook_family_t ips_ipv6root;
+ hook_family_t ips_arproot;
net_handle_t ips_ipv4_net_data;
net_handle_t ips_ipv6_net_data;
+ net_handle_t ips_arp_net_data;
/*
* Hooks for firewalling
@@ -397,17 +394,23 @@ struct ip_stack {
hook_event_t ips_ip4_forwarding_event;
hook_event_t ips_ip4_loopback_in_event;
hook_event_t ips_ip4_loopback_out_event;
+
hook_event_t ips_ip6_physical_in_event;
hook_event_t ips_ip6_physical_out_event;
hook_event_t ips_ip6_forwarding_event;
hook_event_t ips_ip6_loopback_in_event;
hook_event_t ips_ip6_loopback_out_event;
+ hook_event_t ips_arp_physical_in_event;
+ hook_event_t ips_arp_physical_out_event;
+ hook_event_t ips_arp_nic_events;
+
hook_event_token_t ips_ipv4firewall_physical_in;
hook_event_token_t ips_ipv4firewall_physical_out;
hook_event_token_t ips_ipv4firewall_forwarding;
hook_event_token_t ips_ipv4firewall_loopback_in;
hook_event_token_t ips_ipv4firewall_loopback_out;
+
hook_event_token_t ips_ipv6firewall_physical_in;
hook_event_token_t ips_ipv6firewall_physical_out;
hook_event_token_t ips_ipv6firewall_forwarding;
@@ -419,6 +422,10 @@ struct ip_stack {
hook_event_token_t ips_ipv4nicevents;
hook_event_token_t ips_ipv6nicevents;
+ hook_event_token_t ips_arp_physical_in;
+ hook_event_token_t ips_arp_physical_out;
+ hook_event_token_t ips_arpnicevents;
+
net_handle_t ips_ip4_observe_pr;
net_handle_t ips_ip6_observe_pr;
hook_event_t ips_ip4_observe;
@@ -432,13 +439,6 @@ struct ip_stack {
krwlock_t ips_ipmp_lock;
mod_hash_t *ips_ipmp_grp_hash;
-/* igmp.c */
- /* multicast restart timers thread logic */
- kmutex_t ips_mrt_lock;
- uint_t ips_mrt_flags;
- kcondvar_t ips_mrt_cv;
- kcondvar_t ips_mrt_done_cv;
- kthread_t *ips_mrt_thread;
};
typedef struct ip_stack ip_stack_t;