diff options
author | Erik Nordmark <Erik.Nordmark@Sun.COM> | 2009-11-11 11:49:49 -0800 |
---|---|---|
committer | Erik Nordmark <Erik.Nordmark@Sun.COM> | 2009-11-11 11:49:49 -0800 |
commit | bd670b35a010421b6e1a5536c34453a827007c81 (patch) | |
tree | 97c2057b6771dd40411a12eb89d2db2e2b2cce31 /usr/src/uts/common/inet/udp_impl.h | |
parent | b3388e4fc5f5c24c8a39fbe132a00b02dae5b717 (diff) | |
download | illumos-gate-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/udp_impl.h')
-rw-r--r-- | usr/src/uts/common/inet/udp_impl.h | 187 |
1 files changed, 22 insertions, 165 deletions
diff --git a/usr/src/uts/common/inet/udp_impl.h b/usr/src/uts/common/inet/udp_impl.h index 1b4935f456..4da82a0377 100644 --- a/usr/src/uts/common/inet/udp_impl.h +++ b/usr/src/uts/common/inet/udp_impl.h @@ -51,84 +51,6 @@ extern "C" { #define UDP_MOD_ID 5607 -typedef struct udp_bits_s { - - uint32_t - - udpb_debug : 1, /* SO_DEBUG "socket" option. */ - udpb_dontroute : 1, /* SO_DONTROUTE "socket" option. */ - udpb_broadcast : 1, /* SO_BROADCAST "socket" option. */ - udpb_useloopback : 1, /* SO_USELOOPBACK "socket" option */ - - udpb_reuseaddr : 1, /* SO_REUSEADDR "socket" option. */ - udpb_dgram_errind : 1, /* SO_DGRAM_ERRIND option */ - udpb_recvdstaddr : 1, /* IP_RECVDSTADDR option */ - udpb_recvopts : 1, /* IP_RECVOPTS option */ - - udpb_unspec_source : 1, /* IP*_UNSPEC_SRC option */ - udpb_ip_recvpktinfo : 1, /* IPV6_RECVPKTINFO option */ - udpb_ipv6_recvhoplimit : 1, /* IPV6_RECVHOPLIMIT option */ - udpb_ipv6_recvhopopts : 1, /* IPV6_RECVHOPOPTS option */ - - udpb_ipv6_recvdstopts : 1, /* IPV6_RECVDSTOPTS option */ - udpb_ipv6_recvrthdr : 1, /* IPV6_RECVRTHDR option */ - udpb_ipv6_recvtclass : 1, /* IPV6_RECVTCLASS */ - udpb_ipv6_recvpathmtu : 1, /* IPV6_RECVPATHMTU */ - - udpb_anon_priv_bind : 1, - udpb_exclbind : 1, /* ``exclusive'' binding */ - udpb_recvif : 1, /* IP_RECVIF option */ - udpb_recvslla : 1, /* IP_RECVSLLA option */ - - udpb_recvttl : 1, /* IP_RECVTTL option */ - udpb_recvucred : 1, /* IP_RECVUCRED option */ - udpb_old_ipv6_recvdstopts : 1, /* old form of IPV6_DSTOPTS */ - udpb_ipv6_recvrthdrdstopts : 1, /* IPV6_RECVRTHDRDSTOPTS */ - - udpb_rcvhdr : 1, /* UDP_RCVHDR option */ - udpb_issocket : 1, /* socket mode; sockfs is on top */ - udpb_timestamp : 1, /* SO_TIMESTAMP "socket" option */ - - udpb_nat_t_endpoint : 1, /* UDP_NAT_T_ENDPOINT option */ - udpb_pad_to_bit_31 : 4; -} udp_bits_t; - -#define udp_debug udp_bits.udpb_debug -#define udp_dontroute udp_bits.udpb_dontroute -#define udp_broadcast udp_bits.udpb_broadcast -#define udp_useloopback udp_bits.udpb_useloopback - -#define udp_reuseaddr udp_bits.udpb_reuseaddr -#define udp_dgram_errind udp_bits.udpb_dgram_errind -#define udp_recvdstaddr udp_bits.udpb_recvdstaddr -#define udp_recvopts udp_bits.udpb_recvopts - -#define udp_unspec_source udp_bits.udpb_unspec_source -#define udp_ip_recvpktinfo udp_bits.udpb_ip_recvpktinfo -#define udp_ipv6_recvhoplimit udp_bits.udpb_ipv6_recvhoplimit -#define udp_ipv6_recvhopopts udp_bits.udpb_ipv6_recvhopopts - -#define udp_ipv6_recvdstopts udp_bits.udpb_ipv6_recvdstopts -#define udp_ipv6_recvrthdr udp_bits.udpb_ipv6_recvrthdr -#define udp_ipv6_recvtclass udp_bits.udpb_ipv6_recvtclass -#define udp_ipv6_recvpathmtu udp_bits.udpb_ipv6_recvpathmtu - -#define udp_anon_priv_bind udp_bits.udpb_anon_priv_bind -#define udp_exclbind udp_bits.udpb_exclbind -#define udp_recvif udp_bits.udpb_recvif -#define udp_recvslla udp_bits.udpb_recvslla - -#define udp_recvttl udp_bits.udpb_recvttl -#define udp_recvucred udp_bits.udpb_recvucred -#define udp_old_ipv6_recvdstopts udp_bits.udpb_old_ipv6_recvdstopts -#define udp_ipv6_recvrthdrdstopts udp_bits.udpb_ipv6_recvrthdrdstopts - -#define udp_rcvhdr udp_bits.udpb_rcvhdr -#define udp_issocket udp_bits.udpb_issocket -#define udp_timestamp udp_bits.udpb_timestamp - -#define udp_nat_t_endpoint udp_bits.udpb_nat_t_endpoint - /* * Bind hash list size and hash function. It has to be a power of 2 for * hashing. @@ -148,49 +70,21 @@ typedef struct udp_fanout_s { #endif } udp_fanout_t; -/* - * dev_q is the write side queue of the entity below IP. - * If there is a module below IP, we can't optimize by looking - * at q_first of the queue below IP. If the driver is directly - * below IP and if the q_first is NULL, we optimize by not doing - * the canput check - */ -#define DEV_Q_FLOW_BLOCKED(dev_q) \ - (((dev_q)->q_next != NULL || (dev_q)->q_first != NULL) && \ - !canput(dev_q)) - /* Kstats */ typedef struct udp_stat { /* Class "net" kstats */ - kstat_named_t udp_ip_send; - kstat_named_t udp_ip_ire_send; - kstat_named_t udp_ire_null; kstat_named_t udp_sock_fallback; - kstat_named_t udp_out_sw_cksum; - kstat_named_t udp_out_sw_cksum_bytes; kstat_named_t udp_out_opt; kstat_named_t udp_out_err_notconn; kstat_named_t udp_out_err_output; kstat_named_t udp_out_err_tudr; - kstat_named_t udp_in_pktinfo; - kstat_named_t udp_in_recvdstaddr; - kstat_named_t udp_in_recvopts; - kstat_named_t udp_in_recvif; - kstat_named_t udp_in_recvslla; - kstat_named_t udp_in_recvucred; - kstat_named_t udp_in_recvttl; - kstat_named_t udp_in_recvhopopts; - kstat_named_t udp_in_recvhoplimit; - kstat_named_t udp_in_recvdstopts; - kstat_named_t udp_in_recvrtdstopts; - kstat_named_t udp_in_recvrthdr; - kstat_named_t udp_in_recvpktinfo; - kstat_named_t udp_in_recvtclass; - kstat_named_t udp_in_timestamp; - kstat_named_t udp_ip_rcvpktinfo; - kstat_named_t udp_cookie_coll; #ifdef DEBUG kstat_named_t udp_data_conn; kstat_named_t udp_data_notconn; + kstat_named_t udp_out_lastdst; + kstat_named_t udp_out_diffdst; + kstat_named_t udp_out_ipv6; + kstat_named_t udp_out_mapped; + kstat_named_t udp_out_ipv4; #endif } udp_stat_t; @@ -242,79 +136,43 @@ typedef struct udp_stack udp_stack_t; /* Internal udp control structure, one per open stream */ typedef struct udp_s { - krwlock_t udp_rwlock; /* Protects most of udp_t */ - t_scalar_t udp_pending_op; /* The current TPI operation */ /* - * Following fields up to udp_ipversion protected by conn_lock, - * and the fanout lock i.e.uf_lock. Need both locks to change the - * field, either lock is sufficient for reading the field. + * The addresses and ports in the conn_t and udp_state are protected by + * conn_lock and the fanout lock i.e. uf_lock. Need both locks to change + * the fields, either lock is sufficient for reading the field. + * conn_lock also protects the content of udp_t. */ uint32_t udp_state; /* TPI state */ - in_port_t udp_port; /* Port bound to this stream */ - in_port_t udp_dstport; /* Connected port */ - in6_addr_t udp_v6src; /* Source address of this stream */ - in6_addr_t udp_bound_v6src; /* Explicitly bound address */ - in6_addr_t udp_v6dst; /* Connected destination */ - /* - * IP format that packets transmitted from this struct should use. - * Value can be IP4_VERSION or IPV6_VERSION. - */ - ushort_t udp_ipversion; - /* Written to only once at the time of opening the endpoint */ - sa_family_t udp_family; /* Family from socket() call */ - - /* Following protected by udp_rwlock */ - uint32_t udp_flowinfo; /* Connected flow id and tclass */ - uint32_t udp_max_hdr_len; /* For write offset in stream head */ - uint32_t udp_ip_snd_options_len; /* Len of IPv4 options */ - uchar_t *udp_ip_snd_options; /* Ptr to IPv4 options */ - uint32_t udp_ip_rcv_options_len; /* Len of IPv4 options recvd */ - uchar_t *udp_ip_rcv_options; /* Ptr to IPv4 options recvd */ - uchar_t udp_multicast_ttl; /* IP*_MULTICAST_TTL/HOPS */ - ipaddr_t udp_multicast_if_addr; /* IP_MULTICAST_IF option */ - uint_t udp_multicast_if_index; /* IPV6_MULTICAST_IF option */ - int udp_bound_if; /* IP*_BOUND_IF option */ + ip_pkt_t udp_recv_ipp; /* Used for IPv4 options received */ /* Written to only once at the time of opening the endpoint */ conn_t *udp_connp; - /* Following protected by udp_rwlock */ - udp_bits_t udp_bits; /* Bit fields defined above */ - uint8_t udp_type_of_service; /* IP_TOS option */ - uint8_t udp_ttl; /* TTL or hoplimit */ - ip6_pkt_t udp_sticky_ipp; /* Sticky options */ - uint8_t *udp_sticky_hdrs; /* Prebuilt IPv6 hdrs */ - uint_t udp_sticky_hdrs_len; /* Incl. ip6h and any ip6i */ + uint32_t + udp_issocket : 1, /* socket mode; sockfs is on top */ + udp_nat_t_endpoint : 1, /* UDP_NAT_T_ENDPOINT option */ + udp_rcvhdr : 1, /* UDP_RCVHDR option */ + + udp_pad_to_bit_31 : 29; /* Following 2 fields protected by the uf_lock */ struct udp_s *udp_bind_hash; /* Bind hash chain */ struct udp_s **udp_ptpbhn; /* Pointer to previous bind hash next. */ - /* Following protected by udp_rwlock */ kmutex_t udp_recv_lock; /* recv lock */ size_t udp_rcv_disply_hiwat; /* user's view of rcvbuf */ size_t udp_rcv_hiwat; /* receive high watermark */ - size_t udp_rcv_lowat; /* receive low watermark */ - size_t udp_xmit_hiwat; /* Send buffer high watermark */ - size_t udp_xmit_lowat; /* Send buffer low watermark */ - uint_t udp_label_len; /* length of security label */ - uint_t udp_label_len_v6; /* len of v6 security label */ - in6_addr_t udp_v6lastdst; /* most recent destination */ - in_port_t udp_lastdstport; /* most recent dest port */ - cred_t *udp_last_cred; /* most recent credentials */ - cred_t *udp_effective_cred; /* cred with effective label */ - - uint64_t udp_open_time; /* time when this was opened */ - pid_t udp_open_pid; /* process id when this was opened */ + + /* Set at open time and never changed */ udp_stack_t *udp_us; /* Stack instance for zone */ + int udp_delayed_error; mblk_t *udp_fallback_queue_head; mblk_t *udp_fallback_queue_tail; struct sockaddr_storage udp_delayed_addr; } udp_t; -/* UDP Protocol header */ /* UDP Protocol header aligned */ typedef struct udpahdr_s { in_port_t uha_src_port; /* Source port */ @@ -334,6 +192,8 @@ typedef struct udpahdr_s { #define us_xmit_lowat us_param_arr[8].udp_param_value #define us_recv_hiwat us_param_arr[9].udp_param_value #define us_max_buf us_param_arr[10].udp_param_value +#define us_pmtu_discovery us_param_arr[11].udp_param_value +#define us_sendto_ignerr us_param_arr[12].udp_param_value #define UDP_STAT(us, x) ((us)->us_statistics.x.value.ui64++) @@ -348,14 +208,11 @@ typedef struct udpahdr_s { extern int udp_opt_default(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int udp_tpi_opt_get(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int udp_tpi_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *, - uint_t *, uchar_t *, void *, cred_t *, mblk_t *); + uint_t *, uchar_t *, void *, cred_t *); extern mblk_t *udp_snmp_get(queue_t *, mblk_t *); extern int udp_snmp_set(queue_t *, t_scalar_t, t_scalar_t, uchar_t *, int); -extern void udp_close_free(conn_t *); -extern void udp_quiesce_conn(conn_t *); extern void udp_ddi_g_init(void); extern void udp_ddi_g_destroy(void); -extern void udp_g_q_inactive(udp_stack_t *); extern void udp_output(conn_t *connp, mblk_t *mp, struct sockaddr *addr, socklen_t addrlen); extern void udp_wput(queue_t *, mblk_t *); |