summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-10-15 22:13:16 +0300
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2019-01-04 13:36:33 +0100
commit8a06b3d6467c15646e663c05086378f16288af85 (patch)
treefcbc4c98d4ed2d9e526c0dec3cbe4d39a5db6952
parentc5749750a3e052f1194f65a303456224c51dea63 (diff)
downloadillumos-joyent-8a06b3d6467c15646e663c05086378f16288af85.tar.gz
10155 ip: cast between incompatible function types
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r--usr/src/uts/common/inet/ip.h68
-rw-r--r--usr/src/uts/common/inet/ip/icmp.c49
-rw-r--r--usr/src/uts/common/inet/ip/ip.c106
-rw-r--r--usr/src/uts/common/inet/ip/ip2mac.c7
-rw-r--r--usr/src/uts/common/inet/ip/ip6.c11
-rw-r--r--usr/src/uts/common/inet/ip/ip_arp.c99
-rw-r--r--usr/src/uts/common/inet/ip/ip_dummy.c12
-rw-r--r--usr/src/uts/common/inet/ip/ip_helper_stream.c7
-rw-r--r--usr/src/uts/common/inet/ip/ip_if.c65
-rw-r--r--usr/src/uts/common/inet/ip/ip_ndp.c32
-rw-r--r--usr/src/uts/common/inet/ip/ip_squeue.c4
-rw-r--r--usr/src/uts/common/inet/ip/ipmp.c8
-rw-r--r--usr/src/uts/common/inet/ip/rts.c22
-rw-r--r--usr/src/uts/common/inet/ip6.h6
-rw-r--r--usr/src/uts/common/inet/ip_ndp.h10
-rw-r--r--usr/src/uts/common/inet/tcp/tcp.c32
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_input.c17
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_output.c35
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_tpi.c17
-rw-r--r--usr/src/uts/common/inet/tcp_impl.h12
-rw-r--r--usr/src/uts/common/inet/udp/udp.c72
-rw-r--r--usr/src/uts/common/inet/udp_impl.h2
22 files changed, 358 insertions, 335 deletions
diff --git a/usr/src/uts/common/inet/ip.h b/usr/src/uts/common/inet/ip.h
index 3c65fcf97e..2c1b030309 100644
--- a/usr/src/uts/common/inet/ip.h
+++ b/usr/src/uts/common/inet/ip.h
@@ -784,7 +784,7 @@ typedef struct ipsec_selector {
*/
#define CONN_INBOUND_POLICY_PRESENT(connp, ipss) \
((connp)->conn_in_enforce_policy || \
- (!((connp)->conn_policy_cached) && \
+ (!((connp)->conn_policy_cached) && \
(ipss)->ipsec_inbound_v4_policy_present))
#define CONN_INBOUND_POLICY_PRESENT_V6(connp, ipss) \
@@ -1114,15 +1114,15 @@ typedef enum { IPVL_UNICAST_UP, IPVL_UNICAST_DOWN, IPVL_MCAST, IPVL_BCAST,
* ipsq_xop_switch_mp ipsq_lock ipsq_lock
* ipsq_phyint write once write once
* ipsq_next RW_READER ill_g_lock RW_WRITER ill_g_lock
- * ipsq_xop ipsq_lock or ipsq ipsq_lock + ipsq
+ * ipsq_xop ipsq_lock or ipsq ipsq_lock + ipsq
* ipsq_swxop ipsq ipsq
- * ipsq_ownxop see ipxop_t see ipxop_t
+ * ipsq_ownxop see ipxop_t see ipxop_t
* ipsq_ipst write once write once
*
* ipxop_t synchronization: read write
*
- * ipx_writer ipx_lock ipx_lock
- * ipx_xop_queued ipx_lock ipx_lock
+ * ipx_writer ipx_lock ipx_lock
+ * ipx_xop_queued ipx_lock ipx_lock
* ipx_mphead ipx_lock ipx_lock
* ipx_mptail ipx_lock ipx_lock
* ipx_ipsq write once write once
@@ -1140,7 +1140,7 @@ typedef enum { IPVL_UNICAST_UP, IPVL_UNICAST_DOWN, IPVL_MCAST, IPVL_BCAST,
*/
typedef struct ipxop_s {
kmutex_t ipx_lock; /* see above */
- kthread_t *ipx_writer; /* current owner */
+ kthread_t *ipx_writer; /* current owner */
mblk_t *ipx_mphead; /* messages tied to this op */
mblk_t *ipx_mptail;
struct ipsq_s *ipx_ipsq; /* associated ipsq */
@@ -1151,8 +1151,8 @@ typedef struct ipxop_s {
int ipx_current_ioctl; /* current ioctl, or 0 if no ioctl */
ipif_t *ipx_current_ipif; /* ipif for current op */
ipif_t *ipx_pending_ipif; /* ipif for ipx_pending_mp */
- mblk_t *ipx_pending_mp; /* current ioctl mp while waiting */
- boolean_t ipx_forced; /* debugging aid */
+ mblk_t *ipx_pending_mp; /* current ioctl mp while waiting */
+ boolean_t ipx_forced; /* debugging aid */
#ifdef DEBUG
int ipx_depth; /* debugging aid */
#define IPX_STACK_DEPTH 15
@@ -1345,7 +1345,7 @@ typedef int (*pfirepostfrag_t)(mblk_t *, nce_t *, iaflags_t, uint_t, uint32_t,
/*
* unpadded ill_if structure
*/
-struct _ill_if_s_ {
+struct _ill_if_s_ {
union ill_if_u *illif_next;
union ill_if_u *illif_prev;
avl_tree_t illif_avl_by_ppa; /* AVL tree sorted on ppa */
@@ -1357,9 +1357,9 @@ struct _ill_if_s_ {
};
/* cache aligned ill_if structure */
-typedef union ill_if_u {
- struct _ill_if_s_ ill_if_s;
- char illif_filler[CACHE_ALIGN(_ill_if_s_)];
+typedef union ill_if_u {
+ struct _ill_if_s_ ill_if_s;
+ char illif_filler[CACHE_ALIGN(_ill_if_s_)];
} ill_if_t;
#define illif_next ill_if_s.illif_next
@@ -1512,7 +1512,7 @@ typedef struct ill_lso_capab_s ill_lso_capab_t;
* ig_mc_mtu ipsq ipsq
*/
typedef struct ipmp_illgrp_s {
- list_t ig_if; /* list of all interfaces */
+ list_t ig_if; /* list of all interfaces */
list_t ig_actif; /* list of active interfaces */
uint_t ig_nactif; /* number of active interfaces */
struct ill_s *ig_next_ill; /* next active interface to use */
@@ -1552,13 +1552,13 @@ typedef struct ipmp_grp_s {
t_uscalar_t gr_mactype; /* DLPI mactype of group */
phyint_t *gr_phyint; /* IPMP group phyint */
uint_t gr_nif; /* number of interfaces in group */
- uint_t gr_nactif; /* number of active interfaces */
+ uint_t gr_nactif; /* number of active interfaces */
ipmp_illgrp_t *gr_v4; /* V4 group information */
ipmp_illgrp_t *gr_v6; /* V6 group information */
uint_t gr_nv4; /* number of ills in V4 group */
uint_t gr_nv6; /* number of ills in V6 group */
- uint_t gr_pendv4; /* number of pending ills in V4 group */
- uint_t gr_pendv6; /* number of pending ills in V6 group */
+ uint_t gr_pendv4; /* number of pending ills in V4 group */
+ uint_t gr_pendv6; /* number of pending ills in V6 group */
mblk_t *gr_linkdownmp; /* message used to bring link down */
kstat_t *gr_ksp; /* group kstat pointer */
uint64_t gr_kstats0[IPMP_KSTAT_MAX]; /* baseline group kstats */
@@ -1569,10 +1569,10 @@ typedef struct ipmp_grp_s {
* ARP up-to-date as the active set of interfaces in the group changes.
*/
typedef struct ipmp_arpent_s {
- ipaddr_t ia_ipaddr; /* IP address for this entry */
- boolean_t ia_proxyarp; /* proxy ARP entry? */
- boolean_t ia_notified; /* ARP notified about this entry? */
- list_node_t ia_node; /* next ARP entry in list */
+ ipaddr_t ia_ipaddr; /* IP address for this entry */
+ boolean_t ia_proxyarp; /* proxy ARP entry? */
+ boolean_t ia_notified; /* ARP notified about this entry? */
+ list_node_t ia_node; /* next ARP entry in list */
uint16_t ia_flags; /* nce_flags for the address */
size_t ia_lladdr_len;
uchar_t *ia_lladdr;
@@ -1810,7 +1810,7 @@ typedef struct ill_s {
* IPMP fields.
*/
ipmp_illgrp_t *ill_grp; /* IPMP group information */
- list_node_t ill_actnode; /* next active ill in group */
+ list_node_t ill_actnode; /* next active ill in group */
list_node_t ill_grpnode; /* next ill in group */
ipif_t *ill_src_ipif; /* source address selection rotor */
ipif_t *ill_move_ipif; /* ipif awaiting move to new ill */
@@ -2147,9 +2147,9 @@ struct ip_xmit_attr_s {
* IXAF_IPSEC_SECURE is set. Otherwise they contain garbage.
*/
ipsec_latch_t *ixa_ipsec_latch; /* Just the ids */
- struct ipsa_s *ixa_ipsec_ah_sa; /* Hard reference SA for AH */
- struct ipsa_s *ixa_ipsec_esp_sa; /* Hard reference SA for ESP */
- struct ipsec_policy_s *ixa_ipsec_policy; /* why are we here? */
+ struct ipsa_s *ixa_ipsec_ah_sa; /* Hard reference SA for AH */
+ struct ipsa_s *ixa_ipsec_esp_sa; /* Hard reference SA for ESP */
+ struct ipsec_policy_s *ixa_ipsec_policy; /* why are we here? */
struct ipsec_action_s *ixa_ipsec_action; /* For reflected packets */
ipsa_ref_t ixa_ipsec_ref[2]; /* Soft reference to SA */
/* 0: ESP, 1: AH */
@@ -2352,8 +2352,8 @@ struct ip_recv_attr_s {
* IRAF_IPSEC_SECURE is set. Otherwise they contain garbage.
*/
struct ipsec_action_s *ira_ipsec_action; /* how we made it in.. */
- struct ipsa_s *ira_ipsec_ah_sa; /* SA for AH */
- struct ipsa_s *ira_ipsec_esp_sa; /* SA for ESP */
+ struct ipsa_s *ira_ipsec_ah_sa; /* SA for AH */
+ struct ipsa_s *ira_ipsec_esp_sa; /* SA for ESP */
ipaddr_t ira_mroute_tunnel; /* IRAF_MROUTE_TUNNEL_SET */
@@ -3006,7 +3006,7 @@ extern vmem_t *ip_minor_arena_la;
/* Misc IP configuration knobs */
#define ips_ip_policy_mask ips_propinfo_tbl[44].prop_cur_uval
#define ips_ip_ecmp_behavior ips_propinfo_tbl[45].prop_cur_uval
-#define ips_ip_multirt_ttl ips_propinfo_tbl[46].prop_cur_uval
+#define ips_ip_multirt_ttl ips_propinfo_tbl[46].prop_cur_uval
#define ips_ip_ire_badcnt_lifetime ips_propinfo_tbl[47].prop_cur_uval
#define ips_ip_max_temp_idle ips_propinfo_tbl[48].prop_cur_uval
#define ips_ip_max_temp_defend ips_propinfo_tbl[49].prop_cur_uval
@@ -3210,7 +3210,7 @@ extern mblk_t *ip_dlnotify_alloc(uint_t, uint_t);
extern mblk_t *ip_dlnotify_alloc2(uint_t, uint_t, uint_t);
extern char *ip_dot_addr(ipaddr_t, char *);
extern const char *mac_colon_addr(const uint8_t *, size_t, char *, size_t);
-extern void ip_lwput(queue_t *, mblk_t *);
+extern int ip_lwput(queue_t *, mblk_t *);
extern boolean_t icmp_err_rate_limit(ip_stack_t *);
extern void icmp_frag_needed(mblk_t *, int, ip_recv_attr_t *);
extern mblk_t *icmp_inbound_v4(mblk_t *, ip_recv_attr_t *);
@@ -3247,7 +3247,7 @@ extern int ip_openv6(queue_t *q, dev_t *devp, int flag, int sflag,
cred_t *credp);
extern int ip_reassemble(mblk_t *, ipf_t *, uint_t, boolean_t, ill_t *,
size_t);
-extern void ip_rput(queue_t *, mblk_t *);
+extern int ip_rput(queue_t *, mblk_t *);
extern void ip_input(ill_t *, ill_rx_ring_t *, mblk_t *,
struct mac_header_info_s *);
extern void ip_input_v6(ill_t *, ill_rx_ring_t *, mblk_t *,
@@ -3368,8 +3368,8 @@ extern boolean_t conn_wantpacket(conn_t *, ip_recv_attr_t *, ipha_t *);
extern uint_t ip_type_v4(ipaddr_t, ip_stack_t *);
extern uint_t ip_type_v6(const in6_addr_t *, ip_stack_t *);
-extern void ip_wput_nondata(queue_t *, mblk_t *);
-extern void ip_wsrv(queue_t *);
+extern int ip_wput_nondata(queue_t *, mblk_t *);
+extern int ip_wsrv(queue_t *);
extern char *ip_nv_lookup(nv_t *, int);
extern boolean_t ip_local_addr_ok_v6(const in6_addr_t *, const in6_addr_t *);
extern boolean_t ip_remote_addr_ok_v6(const in6_addr_t *, const in6_addr_t *);
@@ -3568,7 +3568,7 @@ typedef enum {
* include mac/dls header files here.
*/
typedef boolean_t (*ip_mac_intr_disable_t)(void *);
-typedef void (*ip_mac_intr_enable_t)(void *);
+typedef int (*ip_mac_intr_enable_t)(void *);
typedef ip_mac_tx_cookie_t (*ip_dld_tx_t)(void *, mblk_t *,
uint64_t, uint16_t);
typedef void (*ip_flow_enable_t)(void *, ip_mac_tx_cookie_t);
@@ -3643,7 +3643,7 @@ struct ill_dld_capab_s {
/*
* IP squeues exports
*/
-extern boolean_t ip_squeue_fanout;
+extern boolean_t ip_squeue_fanout;
#define IP_SQUEUE_GET(hint) ip_squeue_random(hint)
@@ -3660,7 +3660,7 @@ extern void ip_squeue_restart_ring(ill_t *, ill_rx_ring_t *);
extern void ip_squeue_clean_all(ill_t *);
extern boolean_t ip_source_routed(ipha_t *, ip_stack_t *);
-extern void tcp_wput(queue_t *, mblk_t *);
+extern int tcp_wput(queue_t *, mblk_t *);
extern int ip_fill_mtuinfo(conn_t *, ip_xmit_attr_t *,
struct ip6_mtuinfo *);
diff --git a/usr/src/uts/common/inet/ip/icmp.c b/usr/src/uts/common/inet/ip/icmp.c
index de1a68dcb7..bad55b034d 100644
--- a/usr/src/uts/common/inet/ip/icmp.c
+++ b/usr/src/uts/common/inet/ip/icmp.c
@@ -114,7 +114,7 @@ static void icmp_icmp_error_ipv6(conn_t *connp, mblk_t *mp,
ip_recv_attr_t *);
static void icmp_info_req(queue_t *q, mblk_t *mp);
static void icmp_input(void *, mblk_t *, void *, ip_recv_attr_t *);
-static conn_t *icmp_open(int family, cred_t *credp, int *err, int flags);
+static conn_t *icmp_open(int family, cred_t *credp, int *err, int flags);
static int icmp_openv4(queue_t *q, dev_t *devp, int flag, int sflag,
cred_t *credp);
static int icmp_openv6(queue_t *q, dev_t *devp, int flag, int sflag,
@@ -136,8 +136,8 @@ static int icmp_snmp_set(queue_t *q, t_scalar_t level, t_scalar_t name,
uchar_t *ptr, int len);
static void icmp_ud_err(queue_t *q, mblk_t *mp, t_scalar_t err);
static void icmp_tpi_unbind(queue_t *q, mblk_t *mp);
-static void icmp_wput(queue_t *q, mblk_t *mp);
-static void icmp_wput_fallback(queue_t *q, mblk_t *mp);
+static int icmp_wput(queue_t *q, mblk_t *mp);
+static int icmp_wput_fallback(queue_t *q, mblk_t *mp);
static void icmp_wput_other(queue_t *q, mblk_t *mp);
static void icmp_wput_iocdata(queue_t *q, mblk_t *mp);
static void icmp_wput_restricted(queue_t *q, mblk_t *mp);
@@ -181,12 +181,12 @@ static struct qinit icmprinitv6 = {
};
static struct qinit icmpwinit = {
- (pfi_t)icmp_wput, (pfi_t)ip_wsrv, NULL, NULL, NULL, &icmp_mod_info
+ icmp_wput, ip_wsrv, NULL, NULL, NULL, &icmp_mod_info
};
/* ICMP entry point during fallback */
static struct qinit icmp_fallback_sock_winit = {
- (pfi_t)icmp_wput_fallback, NULL, NULL, NULL, NULL, &icmp_mod_info
+ icmp_wput_fallback, NULL, NULL, NULL, NULL, &icmp_mod_info
};
/* For AF_INET aka /dev/icmp */
@@ -720,7 +720,7 @@ rawip_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len,
sin_t *sin;
sin6_t *sin6;
int error;
- uint16_t dstport;
+ uint16_t dstport;
ipaddr_t v4dst;
in6_addr_t v6dst;
uint32_t flowinfo;
@@ -1959,7 +1959,7 @@ int
icmp_tpi_opt_get(queue_t *q, int level, int name, uchar_t *ptr)
{
conn_t *connp = Q_TO_CONN(q);
- int err;
+ int err;
err = icmp_opt_get(connp, level, name, ptr);
return (err);
@@ -2184,9 +2184,9 @@ icmp_opt_set(conn_t *connp, uint_t optset_context, int level, int name,
/*
* Note: Implies T_CHECK semantics for T_OPTCOM_REQ
* inlen != 0 implies value supplied and
- * we have to "pretend" to set it.
+ * we have to "pretend" to set it.
* inlen == 0 implies that there is no
- * value part in T_CHECK request and just validation
+ * value part in T_CHECK request and just validation
* done elsewhere should be enough, we just return here.
*/
if (inlen == 0) {
@@ -4117,7 +4117,7 @@ icmp_prepend_header_template(conn_t *connp, ip_xmit_attr_t *ixa, mblk_t *mp,
* consumes the message or passes it downstream; it never queues a
* a message.
*/
-void
+int
icmp_wput(queue_t *q, mblk_t *mp)
{
sin6_t *sin6;
@@ -4144,7 +4144,7 @@ icmp_wput(queue_t *q, mblk_t *mp)
/* sockfs never sends down M_DATA */
BUMP_MIB(&is->is_rawip_mib, rawipOutErrors);
freemsg(mp);
- return;
+ return (0);
case M_PROTO:
case M_PCPROTO:
@@ -4152,13 +4152,13 @@ icmp_wput(queue_t *q, mblk_t *mp)
if (MBLKL(mp) < sizeof (*tudr) ||
((t_primp_t)mp->b_rptr)->type != T_UNITDATA_REQ) {
icmp_wput_other(q, mp);
- return;
+ return (0);
}
break;
default:
icmp_wput_other(q, mp);
- return;
+ return (0);
}
/* Handle valid T_UNITDATA_REQ here */
@@ -4274,7 +4274,7 @@ icmp_wput(queue_t *q, mblk_t *mp)
}
if (error == 0) {
freeb(mp);
- return;
+ return (0);
}
break;
@@ -4300,7 +4300,7 @@ icmp_wput(queue_t *q, mblk_t *mp)
error = icmp_output_hdrincl(connp, data_mp, cr, pid);
if (error == 0) {
freeb(mp);
- return;
+ return (0);
}
/* data_mp consumed above */
data_mp = NULL;
@@ -4349,14 +4349,14 @@ icmp_wput(queue_t *q, mblk_t *mp)
}
if (error == 0) {
freeb(mp);
- return;
+ return (0);
}
break;
}
ASSERT(mp != NULL);
/* mp is freed by the following routine */
icmp_ud_err(q, mp, (t_scalar_t)error);
- return;
+ return (0);
ud_error2:
BUMP_MIB(&is->is_rawip_mib, rawipOutErrors);
@@ -4364,6 +4364,7 @@ ud_error2:
ASSERT(mp != NULL);
/* mp is freed by the following routine */
icmp_ud_err(q, mp, (t_scalar_t)error);
+ return (0);
}
/*
@@ -4700,13 +4701,14 @@ ud_error:
}
/* ARGSUSED */
-static void
+static int
icmp_wput_fallback(queue_t *q, mblk_t *mp)
{
#ifdef DEBUG
cmn_err(CE_CONT, "icmp_wput_fallback: Message during fallback \n");
#endif
freemsg(mp);
+ return (0);
}
static void
@@ -5028,7 +5030,8 @@ rawip_stack_fini(netstackid_t stackid, void *arg)
}
static void *
-rawip_kstat_init(netstackid_t stackid) {
+rawip_kstat_init(netstackid_t stackid)
+{
kstat_t *ksp;
rawip_named_kstat_t template = {
@@ -5040,9 +5043,7 @@ rawip_kstat_init(netstackid_t stackid) {
};
ksp = kstat_create_netstack("icmp", 0, "rawip", "mib2",
- KSTAT_TYPE_NAMED,
- NUM_OF_FIELDS(rawip_named_kstat_t),
- 0, stackid);
+ KSTAT_TYPE_NAMED, NUM_OF_FIELDS(rawip_named_kstat_t), 0, stackid);
if (ksp == NULL || ksp->ks_data == NULL)
return (NULL);
@@ -5383,7 +5384,7 @@ rawip_activate(sock_lower_handle_t proto_handle,
sock_upper_handle_t sock_handle, sock_upcalls_t *sock_upcalls, int flags,
cred_t *cr)
{
- conn_t *connp = (conn_t *)proto_handle;
+ conn_t *connp = (conn_t *)proto_handle;
struct sock_proto_props sopp;
/* All Solaris components should pass a cred for this operation. */
@@ -5572,7 +5573,7 @@ int
rawip_ioctl(sock_lower_handle_t proto_handle, int cmd, intptr_t arg,
int mode, int32_t *rvalp, cred_t *cr)
{
- conn_t *connp = (conn_t *)proto_handle;
+ conn_t *connp = (conn_t *)proto_handle;
int error;
/* All Solaris components should pass a cred for this operation. */
diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c
index 4a8f4f298e..7e6cf3b4d7 100644
--- a/usr/src/uts/common/inet/ip/ip.c
+++ b/usr/src/uts/common/inet/ip/ip.c
@@ -667,10 +667,10 @@ mblk_t *ip_dlpi_alloc(size_t, t_uscalar_t);
char *ip_dot_addr(ipaddr_t, char *);
mblk_t *ip_carve_mp(mblk_t **, ssize_t);
static char *ip_dot_saddr(uchar_t *, char *);
-static void ip_lrput(queue_t *, mblk_t *);
+static int ip_lrput(queue_t *, mblk_t *);
ipaddr_t ip_net_mask(ipaddr_t);
char *ip_nv_lookup(nv_t *, int);
-void ip_rput(queue_t *, mblk_t *);
+int ip_rput(queue_t *, mblk_t *);
static void ip_rput_dlpi_writer(ipsq_t *dummy_sq, queue_t *q, mblk_t *mp,
void *dummy_arg);
int ip_snmp_get(queue_t *, mblk_t *, int, boolean_t);
@@ -706,8 +706,8 @@ static mblk_t *ip_snmp_get_mib2_ip6_route_media(queue_t *, mblk_t *, int,
ip_stack_t *ipst);
static void ip_snmp_get2_v4(ire_t *, iproutedata_t *);
static void ip_snmp_get2_v6_route(ire_t *, iproutedata_t *);
-static int ip_snmp_get2_v4_media(ncec_t *, iproutedata_t *);
-static int ip_snmp_get2_v6_media(ncec_t *, iproutedata_t *);
+static void ip_snmp_get2_v4_media(ncec_t *, void *);
+static void ip_snmp_get2_v6_media(ncec_t *, void *);
int ip_snmp_set(queue_t *, int, int, uchar_t *, int);
static mblk_t *ip_fragment_copyhdr(uchar_t *, int, int, ip_stack_t *,
@@ -1184,28 +1184,23 @@ struct module_info ip_mod_info = {
* We have separate open functions for the /dev/ip and /dev/ip6 devices.
*/
static struct qinit iprinitv4 = {
- (pfi_t)ip_rput, NULL, ip_openv4, ip_close, NULL,
- &ip_mod_info
+ ip_rput, NULL, ip_openv4, ip_close, NULL, &ip_mod_info
};
struct qinit iprinitv6 = {
- (pfi_t)ip_rput_v6, NULL, ip_openv6, ip_close, NULL,
- &ip_mod_info
+ ip_rput_v6, NULL, ip_openv6, ip_close, NULL, &ip_mod_info
};
static struct qinit ipwinit = {
- (pfi_t)ip_wput_nondata, (pfi_t)ip_wsrv, NULL, NULL, NULL,
- &ip_mod_info
+ ip_wput_nondata, ip_wsrv, NULL, NULL, NULL, &ip_mod_info
};
static struct qinit iplrinit = {
- (pfi_t)ip_lrput, NULL, ip_openv4, ip_close, NULL,
- &ip_mod_info
+ ip_lrput, NULL, ip_openv4, ip_close, NULL, &ip_mod_info
};
static struct qinit iplwinit = {
- (pfi_t)ip_lwput, NULL, NULL, NULL, NULL,
- &ip_mod_info
+ ip_lwput, NULL, NULL, NULL, NULL, &ip_mod_info
};
/* For AF_INET aka /dev/ip */
@@ -1288,9 +1283,9 @@ icmp_frag_needed(mblk_t *mp, int mtu, ip_recv_attr_t *ira)
* while affecting the values in IP and while delivering up to TCP
* should be the same.
*
- * There are two cases.
+ * There are two cases.
*
- * a) If we reject data at the IP layer (ipsec_check_global_policy()
+ * a) If we reject data at the IP layer (ipsec_check_global_policy()
* failed), we will not deliver it to the ULP, even though they
* are *willing* to accept in *clear*. This is fine as our global
* disposition to icmp messages asks us reject the datagram.
@@ -2628,7 +2623,7 @@ icmp_redirect_v4(mblk_t *mp, ipha_t *ipha, icmph_t *icmph, ip_recv_attr_t *ira)
{
ire_t *ire, *nire;
ire_t *prev_ire;
- ipaddr_t src, dst, gateway;
+ ipaddr_t src, dst, gateway;
ip_stack_t *ipst = ira->ira_ill->ill_ipst;
ipha_t *inner_ipha; /* Inner IP header */
@@ -4652,7 +4647,7 @@ ip_stack_init(netstackid_t stackid, netstack_t *ns)
ipst->ips_ill_index = 1;
ipst->ips_saved_ip_forwarding = -1;
- ipst->ips_reg_vif_num = ALL_VIFS; /* Index to Register vif */
+ ipst->ips_reg_vif_num = ALL_VIFS; /* Index to Register vif */
arrsz = ip_propinfo_count * sizeof (mod_prop_info_t);
ipst->ips_propinfo_tbl = (mod_prop_info_t *)kmem_alloc(arrsz, KM_SLEEP);
@@ -5673,7 +5668,7 @@ ip_type_v6(const in6_addr_t *addr, ip_stack_t *ipst)
* Nobody should be sending
* packets up this stream
*/
-static void
+static int
ip_lrput(queue_t *q, mblk_t *mp)
{
switch (mp->b_datap->db_type) {
@@ -5682,19 +5677,21 @@ ip_lrput(queue_t *q, mblk_t *mp)
if (*mp->b_rptr & FLUSHW) {
*mp->b_rptr &= ~FLUSHR;
qreply(q, mp);
- return;
+ return (0);
}
break;
}
freemsg(mp);
+ return (0);
}
/* Nobody should be sending packets down this stream */
/* ARGSUSED */
-void
+int
ip_lwput(queue_t *q, mblk_t *mp)
{
freemsg(mp);
+ return (0);
}
/*
@@ -5962,7 +5959,7 @@ int
ip_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp,
boolean_t isv6)
{
- conn_t *connp;
+ conn_t *connp;
major_t maj;
zoneid_t zoneid;
netstack_t *ns;
@@ -7997,7 +7994,7 @@ ip_rput_notdata(ill_t *ill, mblk_t *mp)
}
/* Read side put procedure. Packets coming from the wire arrive here. */
-void
+int
ip_rput(queue_t *q, mblk_t *mp)
{
ill_t *ill;
@@ -8016,7 +8013,7 @@ ip_rput(queue_t *q, mblk_t *mp)
if (DB_TYPE(mp) != M_PCPROTO ||
dl->dl_primitive == DL_UNITDATA_IND) {
inet_freemsg(mp);
- return;
+ return (0);
}
}
if (DB_TYPE(mp) == M_DATA) {
@@ -8027,6 +8024,7 @@ ip_rput(queue_t *q, mblk_t *mp)
} else {
ip_rput_notdata(ill, mp);
}
+ return (0);
}
/*
@@ -11157,16 +11155,17 @@ ip_snmp_get2_v6_route(ire_t *ire, iproutedata_t *ird)
/*
* ncec_walk routine to create ipv6NetToMediaEntryTable
*/
-static int
-ip_snmp_get2_v6_media(ncec_t *ncec, iproutedata_t *ird)
+static void
+ip_snmp_get2_v6_media(ncec_t *ncec, void *ptr)
{
+ iproutedata_t *ird = ptr;
ill_t *ill;
mib2_ipv6NetToMediaEntry_t ntme;
ill = ncec->ncec_ill;
/* skip arpce entries, and loopback ncec entries */
if (ill->ill_isv6 == B_FALSE || ill->ill_net_type == IRE_LOOPBACK)
- return (0);
+ return;
/*
* Neighbor cache entry attached to IRE with on-link
* destination.
@@ -11205,7 +11204,6 @@ ip_snmp_get2_v6_media(ncec_t *ncec, iproutedata_t *ird)
ip1dbg(("ip_snmp_get2_v6_media: failed to allocate %u bytes\n",
(uint_t)sizeof (ntme)));
}
- return (0);
}
int
@@ -11235,9 +11233,10 @@ nce2ace(ncec_t *ncec)
/*
* ncec_walk routine to create ipNetToMediaEntryTable
*/
-static int
-ip_snmp_get2_v4_media(ncec_t *ncec, iproutedata_t *ird)
+static void
+ip_snmp_get2_v4_media(ncec_t *ncec, void *ptr)
{
+ iproutedata_t *ird = ptr;
ill_t *ill;
mib2_ipNetToMediaEntry_t ntme;
const char *name = "unknown";
@@ -11246,7 +11245,7 @@ ip_snmp_get2_v4_media(ncec_t *ncec, iproutedata_t *ird)
ill = ncec->ncec_ill;
if (ill->ill_isv6 || (ncec->ncec_flags & NCE_F_BCAST) ||
ill->ill_net_type == IRE_LOOPBACK)
- return (0);
+ return;
/* We report all IPMP groups on ncec_ill which is normally the upper. */
name = ill->ill_name;
@@ -11292,7 +11291,6 @@ ip_snmp_get2_v4_media(ncec_t *ncec, iproutedata_t *ird)
ip1dbg(("ip_snmp_get2_v4_media: failed to allocate %u bytes\n",
(uint_t)sizeof (ntme)));
}
- return (0);
}
/*
@@ -12759,7 +12757,7 @@ ip_ioctl_finish(queue_t *q, mblk_t *mp, int err, int mode, ipsq_t *ipsq)
}
/* Handles all non data messages */
-void
+int
ip_wput_nondata(queue_t *q, mblk_t *mp)
{
mblk_t *mp1;
@@ -12781,7 +12779,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
* will arrange to copy in associated control structures.
*/
ip_sioctl_copyin_setup(q, mp);
- return;
+ return (0);
case M_IOCDATA:
/*
* Ensure that this is associated with one of our trans-
@@ -12796,7 +12794,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
} else {
putnext(q, mp);
}
- return;
+ return (0);
}
if ((q->q_next != NULL) && !(ipip->ipi_flags & IPI_MODOK)) {
/*
@@ -12812,7 +12810,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
* The copy operation failed. mi_copy_state already
* cleaned up, so we're out of here.
*/
- return;
+ return (0);
}
/*
* If we just completed a copy in, we become writer and
@@ -12823,7 +12821,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
if (MI_COPY_DIRECTION(mp) == MI_COPY_IN) {
if (!(mp1 = mp->b_cont) || !(mp1 = mp1->b_cont)) {
mi_copy_done(q, mp, EPROTO);
- return;
+ return (0);
}
/*
* Check for cases that need more copying. A return
@@ -12834,7 +12832,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
if (ipip->ipi_cmd_type == MSFILT_CMD &&
MI_COPY_COUNT(mp) == 1) {
if (ip_copyin_msfilter(q, mp) == 0)
- return;
+ return (0);
}
/*
* Refhold the conn, till the ioctl completes. This is
@@ -12855,7 +12853,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
} else {
if (!(ipip->ipi_flags & IPI_MODOK)) {
mi_copy_done(q, mp, EINVAL);
- return;
+ return (0);
}
}
@@ -12864,7 +12862,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
} else {
mi_copyout(q, mp);
}
- return;
+ return (0);
case M_IOCNAK:
/*
@@ -12875,7 +12873,7 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
"ip_wput_nondata: unexpected M_IOCNAK, ioc_cmd 0x%x",
((struct iocblk *)mp->b_rptr)->ioc_cmd);
freemsg(mp);
- return;
+ return (0);
case M_IOCACK:
/* /dev/ip shouldn't see this */
goto nak;
@@ -12884,15 +12882,15 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
flushq(q, FLUSHALL);
if (q->q_next) {
putnext(q, mp);
- return;
+ return (0);
}
if (*mp->b_rptr & FLUSHR) {
*mp->b_rptr &= ~FLUSHW;
qreply(q, mp);
- return;
+ return (0);
}
freemsg(mp);
- return;
+ return (0);
case M_CTL:
break;
case M_PROTO:
@@ -12924,19 +12922,19 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
mp = mi_tpi_err_ack_alloc(mp, TSYSERR, EINVAL);
if (mp != NULL)
qreply(q, mp);
- return;
+ return (0);
}
if (!snmpcom_req(q, mp, ip_snmp_set, ip_snmp_get, cr)) {
proto_str = "Bad SNMPCOM request?";
goto protonak;
}
- return;
+ return (0);
default:
ip1dbg(("ip_wput_nondata: dropping M_PROTO prim %u\n",
(int)*(uint_t *)mp->b_rptr));
freemsg(mp);
- return;
+ return (0);
}
default:
break;
@@ -12945,19 +12943,20 @@ ip_wput_nondata(queue_t *q, mblk_t *mp)
putnext(q, mp);
} else
freemsg(mp);
- return;
+ return (0);
nak:
iocp->ioc_error = EINVAL;
mp->b_datap->db_type = M_IOCNAK;
iocp->ioc_count = 0;
qreply(q, mp);
- return;
+ return (0);
protonak:
cmn_err(CE_NOTE, "IP doesn't process %s as a module", proto_str);
if ((mp = mi_tpi_err_ack_alloc(mp, TPROTO, EINVAL)) != NULL)
qreply(q, mp);
+ return (0);
}
/*
@@ -13343,7 +13342,7 @@ conn_drain(conn_t *connp, boolean_t closing)
* has backenabled the ill_wq. Send sockfs notification about flow-control on
* each waiting conn.
*/
-void
+int
ip_wsrv(queue_t *q)
{
ill_t *ill;
@@ -13363,6 +13362,7 @@ ip_wsrv(queue_t *q)
conn_walk_drain(ipst, &ipst->ips_idl_tx_list[0]);
enableok(ill->ill_wq);
}
+ return (0);
}
/*
@@ -13920,9 +13920,9 @@ ip_kstat2_init(netstackid_t stackid, ip_stat_t *ip_statisticsp)
kstat_t *ksp;
ip_stat_t template = {
- { "ip_udp_fannorm", KSTAT_DATA_UINT64 },
- { "ip_udp_fanmb", KSTAT_DATA_UINT64 },
- { "ip_recv_pullup", KSTAT_DATA_UINT64 },
+ { "ip_udp_fannorm", KSTAT_DATA_UINT64 },
+ { "ip_udp_fanmb", KSTAT_DATA_UINT64 },
+ { "ip_recv_pullup", KSTAT_DATA_UINT64 },
{ "ip_db_ref", KSTAT_DATA_UINT64 },
{ "ip_notaligned", KSTAT_DATA_UINT64 },
{ "ip_multimblk", KSTAT_DATA_UINT64 },
diff --git a/usr/src/uts/common/inet/ip/ip2mac.c b/usr/src/uts/common/inet/ip/ip2mac.c
index 7ee7504d28..ac16e45d82 100644
--- a/usr/src/uts/common/inet/ip/ip2mac.c
+++ b/usr/src/uts/common/inet/ip/ip2mac.c
@@ -336,7 +336,7 @@ typedef struct ip2mac_cancel_data_s {
* to an active nce_cb_t in the ncec's callback list, we want to remove
* the callback (if there are no walkers) or return EBUSY to the caller
*/
-static int
+static void
ip2mac_cancel_callback(ncec_t *ncec, void *arg)
{
ip2mac_cancel_data_t *ip2m_wdata = arg;
@@ -344,12 +344,12 @@ ip2mac_cancel_callback(ncec_t *ncec, void *arg)
ncec_cb_t *ncec_cb;
if (ip2m_nce_cb->ncec_cb_id != ncec)
- return (0);
+ return;
mutex_enter(&ncec->ncec_lock);
if (list_is_empty(&ncec->ncec_cb)) {
mutex_exit(&ncec->ncec_lock);
- return (0);
+ return;
}
/*
* IP does not hold internal locks like nce_lock across calls to
@@ -375,7 +375,6 @@ ip2mac_cancel_callback(ncec_t *ncec, void *arg)
break;
}
mutex_exit(&ncec->ncec_lock);
- return (0);
}
/*
diff --git a/usr/src/uts/common/inet/ip/ip6.c b/usr/src/uts/common/inet/ip/ip6.c
index 7f30aaa81d..e0c6706dd9 100644
--- a/usr/src/uts/common/inet/ip/ip6.c
+++ b/usr/src/uts/common/inet/ip/ip6.c
@@ -3083,7 +3083,7 @@ ip_process_rthdr(mblk_t *mp, ip6_t *ip6h, ip6_rthdr_t *rth,
/*
* Read side put procedure for IPv6 module.
*/
-void
+int
ip_rput_v6(queue_t *q, mblk_t *mp)
{
ill_t *ill;
@@ -3104,7 +3104,7 @@ ip_rput_v6(queue_t *q, mblk_t *mp)
if ((mp->b_datap->db_type != M_PCPROTO) ||
(dl->dl_primitive == DL_UNITDATA_IND)) {
inet_freemsg(mp);
- return;
+ return (0);
}
}
if (DB_TYPE(mp) == M_DATA) {
@@ -3115,6 +3115,7 @@ ip_rput_v6(queue_t *q, mblk_t *mp)
} else {
ip_rput_notdata(ill, mp);
}
+ return (0);
}
/*
@@ -4828,9 +4829,9 @@ void
kstat_t *ksp;
ip6_stat_t template = {
- { "ip6_udp_fannorm", KSTAT_DATA_UINT64 },
- { "ip6_udp_fanmb", KSTAT_DATA_UINT64 },
- { "ip6_recv_pullup", KSTAT_DATA_UINT64 },
+ { "ip6_udp_fannorm", KSTAT_DATA_UINT64 },
+ { "ip6_udp_fanmb", KSTAT_DATA_UINT64 },
+ { "ip6_recv_pullup", KSTAT_DATA_UINT64 },
{ "ip6_db_ref", KSTAT_DATA_UINT64 },
{ "ip6_notaligned", KSTAT_DATA_UINT64 },
{ "ip6_multimblk", KSTAT_DATA_UINT64 },
diff --git a/usr/src/uts/common/inet/ip/ip_arp.c b/usr/src/uts/common/inet/ip/ip_arp.c
index ab7a1ab209..b271bf33d1 100644
--- a/usr/src/uts/common/inet/ip/ip_arp.c
+++ b/usr/src/uts/common/inet/ip/ip_arp.c
@@ -59,8 +59,8 @@ typedef struct arp_m_s {
} arp_m_t;
static int arp_close(queue_t *, int, cred_t *);
-static void arp_rput(queue_t *, mblk_t *);
-static void arp_wput(queue_t *, mblk_t *);
+static int arp_rput(queue_t *, mblk_t *);
+static int arp_wput(queue_t *, mblk_t *);
static arp_m_t *arp_m_lookup(t_uscalar_t mac_type);
static void arp_notify(ipaddr_t, mblk_t *, uint32_t, ip_recv_attr_t *,
ncec_t *);
@@ -101,11 +101,10 @@ struct module_info arp_mod_info = {
IP_MOD_ID, "arp", 1, INFPSZ, 65536, 1024
};
static struct qinit rinit_arp = {
- (pfi_t)arp_rput, NULL, arp_open, arp_close, NULL, &arp_mod_info
+ arp_rput, NULL, arp_open, arp_close, NULL, &arp_mod_info
};
static struct qinit winit_arp = {
- (pfi_t)arp_wput, NULL, arp_open, arp_close, NULL,
- &arp_mod_info
+ arp_wput, NULL, arp_open, arp_close, NULL, &arp_mod_info
};
struct streamtab arpinfo = {
&rinit_arp, &winit_arp
@@ -118,52 +117,52 @@ struct streamtab arpinfo = {
*/
#define ARP_HOOK_IN(_hook, _event, _ilp, _hdr, _fm, _m, ipst) \
\
- if ((_hook).he_interested) { \
- hook_pkt_event_t info; \
+ if ((_hook).he_interested) { \
+ hook_pkt_event_t info; \
\
info.hpe_protocol = ipst->ips_arp_net_data; \
- info.hpe_ifp = _ilp; \
- info.hpe_ofp = 0; \
- info.hpe_hdr = _hdr; \
- info.hpe_mp = &(_fm); \
- info.hpe_mb = _m; \
+ info.hpe_ifp = _ilp; \
+ info.hpe_ofp = 0; \
+ info.hpe_hdr = _hdr; \
+ info.hpe_mp = &(_fm); \
+ info.hpe_mb = _m; \
if (hook_run(ipst->ips_arp_net_data->netd_hooks, \
_event, (hook_data_t)&info) != 0) { \
- if (_fm != NULL) { \
- freemsg(_fm); \
- _fm = NULL; \
- } \
- _hdr = NULL; \
- _m = NULL; \
- } else { \
- _hdr = info.hpe_hdr; \
- _m = info.hpe_mb; \
- } \
+ if (_fm != NULL) { \
+ freemsg(_fm); \
+ _fm = NULL; \
+ } \
+ _hdr = NULL; \
+ _m = NULL; \
+ } else { \
+ _hdr = info.hpe_hdr; \
+ _m = info.hpe_mb; \
+ } \
}
#define ARP_HOOK_OUT(_hook, _event, _olp, _hdr, _fm, _m, ipst) \
\
- if ((_hook).he_interested) { \
- hook_pkt_event_t info; \
+ if ((_hook).he_interested) { \
+ hook_pkt_event_t info; \
\
info.hpe_protocol = ipst->ips_arp_net_data; \
- info.hpe_ifp = 0; \
- info.hpe_ofp = _olp; \
- info.hpe_hdr = _hdr; \
- info.hpe_mp = &(_fm); \
- info.hpe_mb = _m; \
+ info.hpe_ifp = 0; \
+ info.hpe_ofp = _olp; \
+ info.hpe_hdr = _hdr; \
+ info.hpe_mp = &(_fm); \
+ info.hpe_mb = _m; \
if (hook_run(ipst->ips_arp_net_data->netd_hooks, \
_event, (hook_data_t)&info) != 0) { \
- if (_fm != NULL) { \
- freemsg(_fm); \
- _fm = NULL; \
- } \
- _hdr = NULL; \
- _m = NULL; \
- } else { \
- _hdr = info.hpe_hdr; \
- _m = info.hpe_mb; \
- } \
+ if (_fm != NULL) { \
+ freemsg(_fm); \
+ _fm = NULL; \
+ } \
+ _hdr = NULL; \
+ _m = NULL; \
+ } else { \
+ _hdr = info.hpe_hdr; \
+ _m = info.hpe_mb; \
+ } \
}
static arp_m_t arp_m_tbl[] = {
@@ -451,7 +450,7 @@ arp_ll_set_defaults(arl_t *arl, mblk_t *mp)
arl_defaults_common(arl, mp);
}
-static void
+static int
arp_wput(queue_t *q, mblk_t *mp)
{
int err = EINVAL;
@@ -468,7 +467,7 @@ arp_wput(queue_t *q, mblk_t *mp)
char *, "<some ioctl>", char *, "-",
arl_t *, (arl_t *)q->q_ptr);
putnext(q, mp);
- return;
+ break;
}
if ((mp1 = mp->b_cont) == 0)
err = EINVAL;
@@ -480,14 +479,15 @@ arp_wput(queue_t *q, mblk_t *mp)
miocack(q, mp, 0, 0);
else
miocnak(q, mp, 0, err);
- return;
+ break;
default:
DTRACE_PROBE4(arl__dlpi, char *, "arp_wput default",
char *, "default mblk", char *, "-",
arl_t *, (arl_t *)q->q_ptr);
putnext(q, mp);
- return;
+ break;
}
+ return (0);
}
/*
@@ -740,7 +740,7 @@ arp_rput_dlpi_writer(ipsq_t *ipsq, queue_t *q, mblk_t *mp, void *dummy_arg)
freemsg(mp);
}
-void
+int
arp_rput(queue_t *q, mblk_t *mp)
{
arl_t *arl = q->q_ptr;
@@ -756,7 +756,7 @@ arp_rput(queue_t *q, mblk_t *mp)
if (DB_TYPE(mp) != M_PCPROTO) {
mutex_exit(&arl->arl_lock);
freemsg(mp);
- return;
+ return (0);
}
} else {
arl_refhold_locked(arl);
@@ -806,12 +806,13 @@ arp_rput(queue_t *q, mblk_t *mp)
}
if (need_refrele)
arl_refrele(arl);
+ return (0);
}
static void
arp_process_packet(ill_t *ill, mblk_t *mp)
{
- mblk_t *mp1;
+ mblk_t *mp1;
arh_t *arh;
in_addr_t src_paddr, dst_paddr;
uint32_t hlen, plen;
@@ -1384,7 +1385,7 @@ arp_ll_up(ill_t *ill)
mblk_t *attach_mp = NULL;
mblk_t *bind_mp = NULL;
mblk_t *unbind_mp = NULL;
- arl_t *arl;
+ arl_t *arl;
ASSERT(IAM_WRITER_ILL(ill));
arl = ill_to_arl(ill);
@@ -1506,7 +1507,7 @@ arp_notify(in_addr_t src, mblk_t *mp, uint32_t arcn_code,
hwm.hwm_hwaddr = (uchar_t *)(arh + 1);
hwm.hwm_flags = 0;
ncec_walk_common(ipst->ips_ndp4, NULL,
- (pfi_t)nce_update_hw_changed, &hwm, B_TRUE);
+ nce_update_hw_changed, &hwm, B_TRUE);
freemsg(mp);
break;
}
@@ -1773,7 +1774,7 @@ arl_unbind(arl_t *arl)
int
arp_ll_down(ill_t *ill)
{
- arl_t *arl;
+ arl_t *arl;
mblk_t *unbind_mp;
int err = 0;
boolean_t replumb = (ill->ill_replumbing == 1);
diff --git a/usr/src/uts/common/inet/ip/ip_dummy.c b/usr/src/uts/common/inet/ip/ip_dummy.c
index c304d23f82..0cdb3b1304 100644
--- a/usr/src/uts/common/inet/ip/ip_dummy.c
+++ b/usr/src/uts/common/inet/ip/ip_dummy.c
@@ -37,6 +37,7 @@
* MIB information comes from IP.
*/
+static int dummy_wput(queue_t *, mblk_t *);
static int dummy_modclose(queue_t *, int, cred_t *);
static int dummy_modopen(queue_t *q, dev_t *devp, int flag,
int sflag, cred_t *credp);
@@ -52,12 +53,12 @@ struct module_info dummy_mod_info = {
static struct qinit dummyrmodinit = {
- (pfi_t)putnext, NULL, dummy_modopen, dummy_modclose, NULL,
+ dummy_wput, NULL, dummy_modopen, dummy_modclose, NULL,
&dummy_mod_info
};
static struct qinit dummywmodinit = {
- (pfi_t)putnext, NULL, NULL, NULL, NULL, &dummy_mod_info
+ dummy_wput, NULL, NULL, NULL, NULL, &dummy_mod_info
};
struct streamtab dummymodinfo = {
@@ -66,6 +67,13 @@ struct streamtab dummymodinfo = {
/* ARGSUSED */
static int
+dummy_wput(queue_t *q, mblk_t *m)
+{
+ putnext(q, m);
+ return (0);
+}
+
+static int
dummy_modclose(queue_t *q, int flags __unused, cred_t *credp __unused)
{
qprocsoff(q);
diff --git a/usr/src/uts/common/inet/ip/ip_helper_stream.c b/usr/src/uts/common/inet/ip/ip_helper_stream.c
index 9f40c09acf..06d61d116e 100644
--- a/usr/src/uts/common/inet/ip/ip_helper_stream.c
+++ b/usr/src/uts/common/inet/ip/ip_helper_stream.c
@@ -40,7 +40,7 @@
#include <sys/vmem.h>
#include <sys/disp.h>
-void ip_helper_wput(queue_t *q, mblk_t *mp);
+int ip_helper_wput(queue_t *q, mblk_t *mp);
static int ip_helper_stream_close(queue_t *, int, cred_t *);
@@ -54,7 +54,7 @@ static struct qinit ip_helper_stream_rinit = {
};
static struct qinit ip_helper_stream_winit = {
- (pfi_t)ip_helper_wput, (pfi_t)ip_wsrv, NULL, NULL, NULL,
+ ip_helper_wput, ip_wsrv, NULL, NULL, NULL,
&ip_helper_stream_info, NULL, NULL, NULL, STRUIOT_NONE
};
@@ -84,7 +84,7 @@ ip_helper_share_conn(queue_t *q, mblk_t *mp, cred_t *crp)
miocack(q, mp, 0, 0);
}
-void
+int
ip_helper_wput(queue_t *q, mblk_t *mp)
{
struct iocblk *iocp = (struct iocblk *)mp->b_rptr;
@@ -96,6 +96,7 @@ ip_helper_wput(queue_t *q, mblk_t *mp)
ASSERT(DB_TYPE(mp) != M_DATA);
ip_wput_nondata(q, mp);
}
+ return (0);
}
/* ARGSUSED3 */
diff --git a/usr/src/uts/common/inet/ip/ip_if.c b/usr/src/uts/common/inet/ip/ip_if.c
index b88dcae2d1..d1bc11f361 100644
--- a/usr/src/uts/common/inet/ip/ip_if.c
+++ b/usr/src/uts/common/inet/ip/ip_if.c
@@ -194,8 +194,8 @@ static ip_v6mapinfo_func_t ip_ether_v6_mapping;
static ip_v4mapinfo_func_t ip_ib_v4_mapping;
static ip_v6mapinfo_func_t ip_ib_v6_mapping;
static ip_v4mapinfo_func_t ip_mbcast_mapping;
-static void ip_cgtp_bcast_add(ire_t *, ip_stack_t *);
-static void ip_cgtp_bcast_delete(ire_t *, ip_stack_t *);
+static void ip_cgtp_bcast_add(ire_t *, ip_stack_t *);
+static void ip_cgtp_bcast_delete(ire_t *, ip_stack_t *);
static void phyint_free(phyint_t *);
static void ill_capability_dispatch(ill_t *, mblk_t *, dl_capability_sub_t *);
@@ -2207,7 +2207,7 @@ ill_capability_dld_disable(ill_t *ill)
*
* state next state event, action
*
- * IDCS_UNKNOWN IDCS_PROBE_SENT ill_capability_probe
+ * IDCS_UNKNOWN IDCS_PROBE_SENT ill_capability_probe
* IDCS_PROBE_SENT IDCS_OK ill_capability_ack
* IDCS_PROBE_SENT IDCS_FAILED ip_rput_dlpi_writer (nack)
* IDCS_OK IDCS_RENEG Receipt of DL_NOTE_CAPAB_RENEG
@@ -2227,7 +2227,7 @@ void
ill_taskq_dispatch(ip_stack_t *ipst)
{
callb_cpr_t cprinfo;
- char name[64];
+ char name[64];
mblk_t *mp;
(void) snprintf(name, sizeof (name), "ill_taskq_dispatch_%d",
@@ -3140,10 +3140,10 @@ ill_alloc_ppa(ill_if_t *ifp, ill_t *ill)
ill->ill_ppa = --ppa;
} else {
ppa = (int)(uintptr_t)vmem_xalloc(ifp->illif_ppa_arena,
- 1, /* size */
- 1, /* align/quantum */
- 0, /* phase */
- 0, /* nocross */
+ 1, /* size */
+ 1, /* align/quantum */
+ 0, /* phase */
+ 0, /* nocross */
(void *)(uintptr_t)(ill->ill_ppa + 1), /* minaddr */
(void *)(uintptr_t)(ill->ill_ppa + 2), /* maxaddr */
VM_NOSLEEP|VM_FIRSTFIT);
@@ -4408,13 +4408,13 @@ ipif_comp_multi(ipif_t *old_ipif, ipif_t *new_ipif, boolean_t isv6)
* condemned, not an underlying interface in an IPMP group, and
* not a VNI interface. Order of preference:
*
- * 1a. normal
- * 1b. normal, but deprecated
- * 2a. point to point
- * 2b. point to point, but deprecated
- * 3a. link local
- * 3b. link local, but deprecated
- * 4. loopback.
+ * 1a. normal
+ * 1b. normal, but deprecated
+ * 2a. point to point
+ * 2b. point to point, but deprecated
+ * 3a. link local
+ * 3b. link local, but deprecated
+ * 4. loopback.
*/
static ipif_t *
ipif_lookup_multicast(ip_stack_t *ipst, zoneid_t zoneid, boolean_t isv6)
@@ -4943,7 +4943,7 @@ ipif_ill_refrele_tail(ill_t *ill)
ASSERT(ipx->ipx_pending_mp != NULL && ipx->ipx_pending_ipif != NULL);
ipif = ipx->ipx_pending_ipif;
- if (ipif->ipif_ill != ill) /* wait is for another ill; bail */
+ if (ipif->ipif_ill != ill) /* wait is for another ill; bail */
goto unlock;
switch (ipx->ipx_waitfor) {
@@ -5382,7 +5382,7 @@ ip_mcast_mapping(ill_t *ill, uchar_t *addr, uchar_t *hwaddr)
*
* The netmask can be verified to be contiguous with 32 shifts and or
* operations. Take the contiguous mask (in host byte order) and compute
- * mask | mask << 1 | mask << 2 | ... | mask << 31
+ * mask | mask << 1 | mask << 2 | ... | mask << 31
* the result will be the same as the 'mask' for contiguous mask.
*/
static boolean_t
@@ -7867,7 +7867,7 @@ ip_sioctl_ip6addrpolicy(queue_t *q, mblk_t *mp)
static void
ip_sioctl_dstinfo(queue_t *q, mblk_t *mp)
{
- mblk_t *data_mp;
+ mblk_t *data_mp;
struct dstinforeq *dir;
uint8_t *end, *cur;
in6_addr_t *daddr, *saddr;
@@ -8618,7 +8618,7 @@ ip_sioctl_plink_ipmod(ipsq_t *ipsq, queue_t *q, mblk_t *mp, int ioccmd,
struct linkblk *li)
{
int err = 0;
- ill_t *ill;
+ ill_t *ill;
queue_t *ipwq, *dwq;
const char *name;
struct qinit *qinfo;
@@ -8637,12 +8637,12 @@ ip_sioctl_plink_ipmod(ipsq_t *ipsq, queue_t *q, mblk_t *mp, int ioccmd,
qinfo = ipwq->q_qinfo;
name = qinfo->qi_minfo->mi_idname;
if (name != NULL && strcmp(name, ip_mod_info.mi_idname) == 0 &&
- qinfo->qi_putp != (pfi_t)ip_lwput && ipwq->q_next != NULL) {
+ qinfo->qi_putp != ip_lwput && ipwq->q_next != NULL) {
is_ip = B_TRUE;
break;
}
if (name != NULL && strcmp(name, arp_mod_info.mi_idname) == 0 &&
- qinfo->qi_putp != (pfi_t)ip_lwput && ipwq->q_next != NULL) {
+ qinfo->qi_putp != ip_lwput && ipwq->q_next != NULL) {
break;
}
}
@@ -9286,7 +9286,7 @@ ip_sioctl_addif(ipif_t *dummy_ipif, sin_t *dummy_sin, queue_t *q, mblk_t *mp,
struct lifreq *lifr;
boolean_t isv6;
boolean_t exists;
- char *name;
+ char *name;
char *endp;
char *cp;
int namelen;
@@ -10186,7 +10186,7 @@ ip_sioctl_flags_onoff(ipif_t *ipif, uint64_t flags, uint64_t *onp,
uint64_t *offp)
{
ill_t *ill = ipif->ipif_ill;
- phyint_t *phyi = ill->ill_phyint;
+ phyint_t *phyi = ill->ill_phyint;
uint64_t cantchange_flags, intf_flags;
uint64_t turn_on, turn_off;
@@ -12170,7 +12170,7 @@ ipif_arp_down(ipif_t *ipif)
* basic DAD related initialization for IPv6. Honors ILLF_NOARP.
*
* The enumerated value res_act tunes the behavior:
- * * Res_act_initial: set up all the resolver structures for a new
+ * * Res_act_initial: set up all the resolver structures for a new
* IP address.
* * Res_act_defend: tell ARP that it needs to send a single gratuitous
* ARP message in defense of the address.
@@ -14332,7 +14332,7 @@ int
ipif_up(ipif_t *ipif, queue_t *q, mblk_t *mp)
{
ill_t *ill = ipif->ipif_ill;
- boolean_t isv6 = ipif->ipif_isv6;
+ boolean_t isv6 = ipif->ipif_isv6;
int err = 0;
boolean_t success;
uint_t ipif_orig_id;
@@ -15288,8 +15288,8 @@ ipif_good_addr(ill_t *ill, zoneid_t zoneid)
*/
typedef enum {
IPIF_NONE,
- IPIF_DIFFNET_DEPRECATED, /* deprecated and different subnet */
- IPIF_SAMENET_DEPRECATED, /* deprecated and same subnet */
+ IPIF_DIFFNET_DEPRECATED, /* deprecated and different subnet */
+ IPIF_SAMENET_DEPRECATED, /* deprecated and same subnet */
IPIF_DIFFNET_ALLZONES, /* allzones and different subnet */
IPIF_SAMENET_ALLZONES, /* allzones and same subnet */
IPIF_DIFFNET, /* normal and different subnet */
@@ -15614,7 +15614,7 @@ if_unitsel(ipif_t *dummy_ipif, sin_t *dummy_sin, queue_t *q, mblk_t *mp,
ip_ioctl_cmd_t *ipip, void *dummy_ifreq)
{
queue_t *q1 = q;
- char *cp;
+ char *cp;
char interf_name[LIFNAMSIZ];
uint_t ppa = *(uint_t *)mp->b_cont->b_cont->b_rptr;
@@ -17398,7 +17398,7 @@ ip_ipmp_v6intfid(ill_t *ill, in6_addr_t *v6addr)
zone_t *zp;
uint8_t *addr;
uchar_t hash[16];
- ulong_t hostid;
+ ulong_t hostid;
MD5_CTX ctx;
ipmp_ifcookie_t ic = { 0 };
@@ -18498,8 +18498,8 @@ arp_up_done:
int
ipif_arp_up(ipif_t *ipif, enum ip_resolver_action res_act, boolean_t was_dup)
{
- int err = 0;
- ill_t *ill = ipif->ipif_ill;
+ int err = 0;
+ ill_t *ill = ipif->ipif_ill;
boolean_t first_interface, wait_for_dlpi = B_FALSE;
DTRACE_PROBE3(ipif__downup, char *, "ipif_arp_up",
@@ -18996,8 +18996,7 @@ ipif_nce_down(ipif_t *ipif)
* is going away.
*/
if (ill->ill_ipif_up_count == 0) {
- ncec_walk(ill, (pfi_t)ncec_delete_per_ill,
- (uchar_t *)ill, ill->ill_ipst);
+ ncec_walk(ill, ncec_delete_per_ill, ill, ill->ill_ipst);
if (IS_UNDER_IPMP(ill))
nce_flush(ill, B_TRUE);
}
diff --git a/usr/src/uts/common/inet/ip/ip_ndp.c b/usr/src/uts/common/inet/ip/ip_ndp.c
index 2cb91f8c41..eabe8949ae 100644
--- a/usr/src/uts/common/inet/ip/ip_ndp.c
+++ b/usr/src/uts/common/inet/ip/ip_ndp.c
@@ -107,7 +107,7 @@
*/
static void nce_cleanup_list(ncec_t *ncec);
-static void nce_set_ll(ncec_t *ncec, uchar_t *ll_addr);
+static void nce_set_ll(ncec_t *ncec, uchar_t *ll_addr);
static ncec_t *ncec_lookup_illgrp(ill_t *, const in6_addr_t *,
ncec_t *);
static nce_t *nce_lookup_addr(ill_t *, const in6_addr_t *);
@@ -126,7 +126,7 @@ static int nce_add_common(ill_t *, uchar_t *, uint_t, const in6_addr_t *,
static nce_t *nce_add_impl(ill_t *, ncec_t *, nce_t *, mblk_t *);
static nce_t *nce_add(ill_t *, ncec_t *);
static void nce_inactive(nce_t *);
-extern nce_t *nce_lookup(ill_t *, const in6_addr_t *);
+extern nce_t *nce_lookup(ill_t *, const in6_addr_t *);
static nce_t *nce_ill_lookup_then_add(ill_t *, ncec_t *);
static int nce_add_v6(ill_t *, uchar_t *, uint_t, const in6_addr_t *,
uint16_t, uint16_t, nce_t **);
@@ -596,9 +596,9 @@ ncec_inactive(ncec_t *ncec)
* that is going away. Always called as a writer.
*/
void
-ncec_delete_per_ill(ncec_t *ncec, uchar_t *arg)
+ncec_delete_per_ill(ncec_t *ncec, void *arg)
{
- if ((ncec != NULL) && ncec->ncec_ill == (ill_t *)arg) {
+ if ((ncec != NULL) && ncec->ncec_ill == arg) {
ncec_delete(ncec);
}
}
@@ -934,13 +934,13 @@ nce_process(ncec_t *ncec, uchar_t *hw_addr, uint32_t flag, boolean_t is_adv)
}
/*
- * Pass arg1 to the pfi supplied, along with each ncec in existence.
+ * Pass arg1 to the cbf supplied, along with each ncec in existence.
* ncec_walk() places a REFHOLD on the ncec and drops the lock when
* walking the hash list.
*/
void
-ncec_walk_common(ndp_g_t *ndp, ill_t *ill, pfi_t pfi, void *arg1,
- boolean_t trace)
+ncec_walk_common(ndp_g_t *ndp, ill_t *ill, ncec_walk_cb_t cbf,
+ void *arg1, boolean_t trace)
{
ncec_t *ncec;
ncec_t *ncec1;
@@ -958,11 +958,11 @@ ncec_walk_common(ndp_g_t *ndp, ill_t *ill, pfi_t pfi, void *arg1,
if (ill == NULL || ncec->ncec_ill == ill) {
if (trace) {
ncec_refhold(ncec);
- (*pfi)(ncec, arg1);
+ (*cbf)(ncec, arg1);
ncec_refrele(ncec);
} else {
ncec_refhold_notr(ncec);
- (*pfi)(ncec, arg1);
+ (*cbf)(ncec, arg1);
ncec_refrele_notr(ncec);
}
}
@@ -994,10 +994,10 @@ ncec_walk_common(ndp_g_t *ndp, ill_t *ill, pfi_t pfi, void *arg1,
* Note that ill can be NULL hence can't derive the ipst from it.
*/
void
-ncec_walk(ill_t *ill, pfi_t pfi, void *arg1, ip_stack_t *ipst)
+ncec_walk(ill_t *ill, ncec_walk_cb_t cbf, void *arg1, ip_stack_t *ipst)
{
- ncec_walk_common(ipst->ips_ndp4, ill, pfi, arg1, B_TRUE);
- ncec_walk_common(ipst->ips_ndp6, ill, pfi, arg1, B_TRUE);
+ ncec_walk_common(ipst->ips_ndp4, ill, cbf, arg1, B_TRUE);
+ ncec_walk_common(ipst->ips_ndp6, ill, cbf, arg1, B_TRUE);
}
/*
@@ -2124,7 +2124,7 @@ ndp_xmit(ill_t *ill, uint32_t operation, uint8_t *hw_addr, uint_t hw_addr_len,
const in6_addr_t *sender, const in6_addr_t *target, int flag)
{
uint32_t len;
- icmp6_t *icmp6;
+ icmp6_t *icmp6;
mblk_t *mp;
ip6_t *ip6h;
nd_opt_hdr_t *opt;
@@ -3405,7 +3405,7 @@ ndp_verify_optlen(nd_opt_hdr_t *opt, int optlen)
* order of ncec_last and/or maintain state)
*/
static void
-ncec_cache_reclaim(ncec_t *ncec, char *arg)
+ncec_cache_reclaim(ncec_t *ncec, void *arg)
{
ip_stack_t *ipst = ncec->ncec_ipst;
uint_t fraction = *(uint_t *)arg;
@@ -3436,7 +3436,7 @@ ip_nce_reclaim_stack(ip_stack_t *ipst)
IP_STAT(ipst, ip_nce_reclaim_calls);
- ncec_walk(NULL, (pfi_t)ncec_cache_reclaim, (uchar_t *)&fraction, ipst);
+ ncec_walk(NULL, ncec_cache_reclaim, &fraction, ipst);
/*
* Walk all CONNs that can have a reference on an ire, ncec or dce.
@@ -4363,7 +4363,7 @@ ip_nce_lookup_and_update(ipaddr_t *addr, ipif_t *ipif, ip_stack_t *ipst,
hwm.hwm_flags = flags;
ncec_walk_common(ipst->ips_ndp4, NULL,
- (pfi_t)nce_update_hw_changed, (uchar_t *)&hwm, B_TRUE);
+ nce_update_hw_changed, &hwm, B_TRUE);
}
}
diff --git a/usr/src/uts/common/inet/ip/ip_squeue.c b/usr/src/uts/common/inet/ip/ip_squeue.c
index 33a2fa5935..ee7c7b0f1d 100644
--- a/usr/src/uts/common/inet/ip/ip_squeue.c
+++ b/usr/src/uts/common/inet/ip/ip_squeue.c
@@ -508,7 +508,7 @@ ip_squeue_add_ring(ill_t *ill, void *mrp)
}
bzero(rx_ring, sizeof (ill_rx_ring_t));
- rx_ring->rr_rx = (ip_mac_rx_t)mrfp->mrf_receive;
+ rx_ring->rr_rx = mrfp->mrf_receive;
/* XXX: Hard code it to tcp accept for now */
rx_ring->rr_ip_accept = (ip_accept_t)ip_accept_tcp;
@@ -683,7 +683,7 @@ ip_squeue_clean_all(ill_t *ill)
squeue_t *
ip_squeue_get(ill_rx_ring_t *ill_rx_ring)
{
- squeue_t *sqp;
+ squeue_t *sqp;
if ((ill_rx_ring == NULL) || ((sqp = ill_rx_ring->rr_sqp) == NULL))
return (IP_SQUEUE_GET(CPU_PSEUDO_RANDOM()));
diff --git a/usr/src/uts/common/inet/ip/ipmp.c b/usr/src/uts/common/inet/ip/ipmp.c
index 3be5bb7c75..912b489c40 100644
--- a/usr/src/uts/common/inet/ip/ipmp.c
+++ b/usr/src/uts/common/inet/ip/ipmp.c
@@ -90,7 +90,7 @@ static void ipmp_ill_bind_ipif(ill_t *, ipif_t *, enum ip_resolver_action);
static ipif_t *ipmp_ill_unbind_ipif(ill_t *, ipif_t *, boolean_t);
static void ipmp_phyint_get_kstats(phyint_t *, uint64_t *);
static boolean_t ipmp_ipif_is_up_dataaddr(const ipif_t *);
-static void ipmp_ncec_delete_nonlocal(ncec_t *, uchar_t *);
+static void ipmp_ncec_delete_nonlocal(ncec_t *, void *);
/*
* Initialize IPMP state for IP stack `ipst'; called from ip_stack_init().
@@ -800,7 +800,7 @@ ipmp_illgrp_set_cast(ipmp_illgrp_t *illg, ill_t *castill)
* last since ill_leave_multicast() may trigger IREs to be
* built using ig_cast_ill.
*/
- ncec_walk(ocastill, (pfi_t)ipmp_ncec_delete_nonlocal, ocastill,
+ ncec_walk(ocastill, ipmp_ncec_delete_nonlocal, ocastill,
ocastill->ill_ipst);
}
@@ -1592,7 +1592,7 @@ ipmp_ill_deactivate(ill_t *ill)
* any NCECs associated with the group and mark the group link down.
*/
if (--grp->gr_nactif == 0) {
- ncec_walk(ipmp_ill, (pfi_t)ncec_delete_per_ill, ipmp_ill, ipst);
+ ncec_walk(ipmp_ill, ncec_delete_per_ill, ipmp_ill, ipst);
mp = grp->gr_linkdownmp;
grp->gr_linkdownmp = NULL;
ASSERT(mp != NULL);
@@ -2182,7 +2182,7 @@ ipmp_packet_is_probe(mblk_t *mp, ill_t *ill)
* is not one of our local addresses. Caller must be inside the IPSQ.
*/
static void
-ipmp_ncec_delete_nonlocal(ncec_t *ncec, uchar_t *ill_arg)
+ipmp_ncec_delete_nonlocal(ncec_t *ncec, void *ill_arg)
{
if (!NCE_MYADDR(ncec) && ncec->ncec_ill == (ill_t *)ill_arg)
ncec_delete(ncec);
diff --git a/usr/src/uts/common/inet/ip/rts.c b/usr/src/uts/common/inet/ip/rts.c
index ee092ef18e..ba3d2391df 100644
--- a/usr/src/uts/common/inet/ip/rts.c
+++ b/usr/src/uts/common/inet/ip/rts.c
@@ -120,10 +120,10 @@ static int rts_param_get(queue_t *q, mblk_t *mp, caddr_t cp, cred_t *cr);
static boolean_t rts_param_register(IDP *ndp, rtsparam_t *rtspa, int cnt);
static int rts_param_set(queue_t *q, mblk_t *mp, char *value, caddr_t cp,
cred_t *cr);
-static void rts_rsrv(queue_t *q);
+static int rts_rsrv(queue_t *q);
static void *rts_stack_init(netstackid_t stackid, netstack_t *ns);
static void rts_stack_fini(netstackid_t stackid, void *arg);
-static void rts_wput(queue_t *q, mblk_t *mp);
+static int rts_wput(queue_t *q, mblk_t *mp);
static void rts_wput_iocdata(queue_t *q, mblk_t *mp);
static void rts_wput_other(queue_t *q, mblk_t *mp);
static int rts_wrw(queue_t *q, struiod_t *dp);
@@ -141,13 +141,13 @@ static struct module_info rts_mod_info = {
};
static struct qinit rtsrinit = {
- NULL, (pfi_t)rts_rsrv, rts_stream_open, rts_stream_close, NULL,
+ NULL, rts_rsrv, rts_stream_open, rts_stream_close, NULL,
&rts_mod_info
};
static struct qinit rtswinit = {
- (pfi_t)rts_wput, NULL, NULL, NULL, NULL, &rts_mod_info,
- NULL, (pfi_t)rts_wrw, NULL, STRUIOT_STANDARD
+ rts_wput, NULL, NULL, NULL, NULL, &rts_mod_info,
+ NULL, rts_wrw, NULL, STRUIOT_STANDARD
};
struct streamtab rtsinfo = {
@@ -817,9 +817,10 @@ rts_param_set(queue_t *q, mblk_t *mp, char *value, caddr_t cp, cred_t *cr)
* of a thread in qwait.
*/
/*ARGSUSED*/
-static void
+static int
rts_rsrv(queue_t *q)
{
+ return (0);
}
/*
@@ -919,7 +920,7 @@ err_ret:
* a message. The data messages that go down are wrapped in an IOCTL
* message.
*/
-static void
+static int
rts_wput(queue_t *q, mblk_t *mp)
{
uchar_t *rptr = mp->b_rptr;
@@ -938,7 +939,7 @@ rts_wput(queue_t *q, mblk_t *mp)
mp1 = mp->b_cont;
freeb(mp);
if (mp1 == NULL)
- return;
+ return (0);
mp = mp1;
break;
}
@@ -946,7 +947,7 @@ rts_wput(queue_t *q, mblk_t *mp)
/* FALLTHRU */
default:
rts_wput_other(q, mp);
- return;
+ return (0);
}
@@ -960,9 +961,10 @@ rts_wput(queue_t *q, mblk_t *mp)
rts->rts_error = ENOMEM;
rts->rts_flag &= ~RTS_WPUT_PENDING;
}
- return;
+ return (0);
}
ip_wput_nondata(q, mp1);
+ return (0);
}
diff --git a/usr/src/uts/common/inet/ip6.h b/usr/src/uts/common/inet/ip6.h
index b7954a9a4d..4f5b81c12f 100644
--- a/usr/src/uts/common/inet/ip6.h
+++ b/usr/src/uts/common/inet/ip6.h
@@ -154,7 +154,7 @@ typedef enum {
(a).s6_addr32[0] == 0)
#else
-#define V6_OR_V4_INADDR_ANY(a) ((a).s6_addr32[3] == 0 && \
+#define V6_OR_V4_INADDR_ANY(a) ((a).s6_addr32[3] == 0 && \
((a).s6_addr32[2] == 0xffff0000U || \
(a).s6_addr32[2] == 0) && \
(a).s6_addr32[1] == 0 && \
@@ -207,7 +207,7 @@ typedef enum {
(d).s6_addr32[3] = (s).s6_addr32[3] & (m).s6_addr32[3])
#define ILL_FRAG_HASH_V6(v6addr, i) \
- ((ntohl((v6addr).s6_addr32[3]) ^ (i ^ (i >> 8))) % \
+ ((ntohl((v6addr).s6_addr32[3]) ^ (i ^ (i >> 8))) % \
ILL_FRAG_HASH_TBL_COUNT)
@@ -272,7 +272,7 @@ extern mblk_t *ipsec_early_ah_v6(mblk_t *, ip_recv_attr_t *);
extern int ipsec_ah_get_hdr_size_v6(mblk_t *, boolean_t);
extern void ip_send_potential_redirect_v6(mblk_t *, ip6_t *, ire_t *,
ip_recv_attr_t *);
-extern void ip_rput_v6(queue_t *, mblk_t *);
+extern int ip_rput_v6(queue_t *, mblk_t *);
extern mblk_t *mld_input(mblk_t *, ip_recv_attr_t *);
extern void mld_joingroup(ilm_t *);
extern void mld_leavegroup(ilm_t *);
diff --git a/usr/src/uts/common/inet/ip_ndp.h b/usr/src/uts/common/inet/ip_ndp.h
index 21c907f3f3..ae9463720c 100644
--- a/usr/src/uts/common/inet/ip_ndp.h
+++ b/usr/src/uts/common/inet/ip_ndp.h
@@ -67,7 +67,7 @@ typedef struct ncec_cb_s {
struct ncec_s {
struct ncec_s *ncec_next; /* Hash chain next pointer */
struct ncec_s **ncec_ptpn; /* Pointer to previous next */
- struct ill_s *ncec_ill; /* Associated ill */
+ struct ill_s *ncec_ill; /* Associated ill */
uint16_t ncec_flags; /* See below */
uint16_t ncec_state; /* See reachability states in if.h */
int16_t ncec_pcnt; /* Probe counter */
@@ -273,9 +273,11 @@ typedef struct {
/* NDP Cache Entry Hash Table */
#define NCE_TABLE_SIZE 256
+typedef void (*ncec_walk_cb_t)(ncec_t *, void *);
+
extern void ip_nce_reclaim(void *);
extern void ncec_delete(ncec_t *);
-extern void ncec_delete_per_ill(ncec_t *, uchar_t *);
+extern void ncec_delete_per_ill(ncec_t *, void *);
extern void nce_fastpath_update(ill_t *, mblk_t *);
extern nd_opt_hdr_t *ndp_get_option(nd_opt_hdr_t *, int, int);
extern void ncec_inactive(ncec_t *);
@@ -293,8 +295,8 @@ extern int ndp_query(ill_t *, lif_nd_req_t *);
extern int ndp_sioc_update(ill_t *, lif_nd_req_t *);
extern boolean_t ndp_verify_optlen(nd_opt_hdr_t *, int);
extern void nce_timer(void *);
-extern void ncec_walk(ill_t *, pfi_t, void *, ip_stack_t *);
-extern void ncec_walk_common(ndp_g_t *, ill_t *, pfi_t,
+extern void ncec_walk(ill_t *, ncec_walk_cb_t, void *, ip_stack_t *);
+extern void ncec_walk_common(ndp_g_t *, ill_t *, ncec_walk_cb_t,
void *, boolean_t);
extern boolean_t nce_restart_dad(ncec_t *);
extern void ndp_resolv_failed(ncec_t *);
diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c
index c3bbd6a0d6..d340aff2a5 100644
--- a/usr/src/uts/common/inet/tcp/tcp.c
+++ b/usr/src/uts/common/inet/tcp/tcp.c
@@ -286,7 +286,7 @@ static void tcp_iss_init(tcp_t *tcp);
static void tcp_reinit(tcp_t *tcp);
static void tcp_reinit_values(tcp_t *tcp);
-static void tcp_wsrv(queue_t *q);
+static int tcp_wsrv(queue_t *q);
static void tcp_update_lso(tcp_t *tcp, ip_xmit_attr_t *ixa);
static void tcp_update_zcopy(tcp_t *tcp);
static void tcp_notify(void *, ip_xmit_attr_t *, ixa_notify_type_t,
@@ -316,25 +316,25 @@ static struct module_info tcp_winfo = {
* We have separate open functions for the /dev/tcp and /dev/tcp6 devices.
*/
struct qinit tcp_rinitv4 = {
- NULL, (pfi_t)tcp_rsrv, tcp_openv4, tcp_tpi_close, NULL, &tcp_rinfo
+ NULL, tcp_rsrv, tcp_openv4, tcp_tpi_close, NULL, &tcp_rinfo
};
struct qinit tcp_rinitv6 = {
- NULL, (pfi_t)tcp_rsrv, tcp_openv6, tcp_tpi_close, NULL, &tcp_rinfo
+ NULL, tcp_rsrv, tcp_openv6, tcp_tpi_close, NULL, &tcp_rinfo
};
struct qinit tcp_winit = {
- (pfi_t)tcp_wput, (pfi_t)tcp_wsrv, NULL, NULL, NULL, &tcp_winfo
+ tcp_wput, tcp_wsrv, NULL, NULL, NULL, &tcp_winfo
};
/* Initial entry point for TCP in socket mode. */
struct qinit tcp_sock_winit = {
- (pfi_t)tcp_wput_sock, (pfi_t)tcp_wsrv, NULL, NULL, NULL, &tcp_winfo
+ tcp_wput_sock, tcp_wsrv, NULL, NULL, NULL, &tcp_winfo
};
/* TCP entry point during fallback */
struct qinit tcp_fallback_sock_winit = {
- (pfi_t)tcp_wput_fallback, NULL, NULL, NULL, NULL, &tcp_winfo
+ tcp_wput_fallback, NULL, NULL, NULL, NULL, &tcp_winfo
};
/*
@@ -343,11 +343,11 @@ struct qinit tcp_fallback_sock_winit = {
* been created.
*/
struct qinit tcp_acceptor_rinit = {
- NULL, (pfi_t)tcp_rsrv, NULL, tcp_tpi_close_accept, NULL, &tcp_winfo
+ NULL, tcp_rsrv, NULL, tcp_tpi_close_accept, NULL, &tcp_winfo
};
struct qinit tcp_acceptor_winit = {
- (pfi_t)tcp_tpi_accept, NULL, NULL, NULL, NULL, &tcp_winfo
+ tcp_tpi_accept, NULL, NULL, NULL, NULL, &tcp_winfo
};
/* For AF_INET aka /dev/tcp */
@@ -1037,7 +1037,7 @@ void
tcp_close_common(conn_t *connp, int flags)
{
tcp_t *tcp = connp->conn_tcp;
- mblk_t *mp = &tcp->tcp_closemp;
+ mblk_t *mp = &tcp->tcp_closemp;
boolean_t conn_ioctl_cleanup_reqd = B_FALSE;
mblk_t *bp;
@@ -1474,7 +1474,7 @@ tcp_get_conn(void *arg, tcp_stack_t *tcps)
tcp_t *tcp = NULL;
conn_t *connp = NULL;
squeue_t *sqp = (squeue_t *)arg;
- tcp_squeue_priv_t *tcp_time_wait;
+ tcp_squeue_priv_t *tcp_time_wait;
netstack_t *ns;
mblk_t *tcp_rsrv_mp = NULL;
@@ -1554,8 +1554,8 @@ static int
tcp_connect_ipv4(tcp_t *tcp, ipaddr_t *dstaddrp, in_port_t dstport,
uint_t srcid)
{
- ipaddr_t dstaddr = *dstaddrp;
- uint16_t lport;
+ ipaddr_t dstaddr = *dstaddrp;
+ uint16_t lport;
conn_t *connp = tcp->tcp_connp;
tcp_stack_t *tcps = tcp->tcp_tcps;
int error;
@@ -1643,7 +1643,7 @@ static int
tcp_connect_ipv6(tcp_t *tcp, in6_addr_t *dstaddrp, in_port_t dstport,
uint32_t flowinfo, uint_t srcid, uint32_t scope_id)
{
- uint16_t lport;
+ uint16_t lport;
conn_t *connp = tcp->tcp_connp;
tcp_stack_t *tcps = tcp->tcp_tcps;
int error;
@@ -2054,8 +2054,7 @@ tcp_reinit(tcp_t *tcp)
* structure!
*/
static void
-tcp_reinit_values(tcp)
- tcp_t *tcp;
+tcp_reinit_values(tcp_t *tcp)
{
tcp_stack_t *tcps = tcp->tcp_tcps;
conn_t *connp = tcp->tcp_connp;
@@ -3415,12 +3414,13 @@ tcp_notify(void *arg, ip_xmit_attr_t *ixa, ixa_notify_type_t ntype,
* The TCP write service routine should never be called...
*/
/* ARGSUSED */
-static void
+static int
tcp_wsrv(queue_t *q)
{
tcp_stack_t *tcps = Q_TO_TCP(q)->tcp_tcps;
TCP_STAT(tcps, tcp_wsrv_called);
+ return (0);
}
/*
diff --git a/usr/src/uts/common/inet/tcp/tcp_input.c b/usr/src/uts/common/inet/tcp/tcp_input.c
index 37e4d72745..e917f7c774 100644
--- a/usr/src/uts/common/inet/tcp/tcp_input.c
+++ b/usr/src/uts/common/inet/tcp/tcp_input.c
@@ -784,12 +784,12 @@ static mblk_t *
tcp_conn_create_v6(conn_t *lconnp, conn_t *connp, mblk_t *mp,
ip_recv_attr_t *ira)
{
- tcp_t *ltcp = lconnp->conn_tcp;
+ tcp_t *ltcp = lconnp->conn_tcp;
tcp_t *tcp = connp->conn_tcp;
mblk_t *tpi_mp;
ipha_t *ipha;
ip6_t *ip6h;
- sin6_t sin6;
+ sin6_t sin6;
uint_t ifindex = ira->ira_ruifindex;
tcp_stack_t *tcps = tcp->tcp_tcps;
@@ -881,7 +881,7 @@ static mblk_t *
tcp_conn_create_v4(conn_t *lconnp, conn_t *connp, mblk_t *mp,
ip_recv_attr_t *ira)
{
- tcp_t *ltcp = lconnp->conn_tcp;
+ tcp_t *ltcp = lconnp->conn_tcp;
tcp_t *tcp = connp->conn_tcp;
sin_t sin;
mblk_t *tpi_mp = NULL;
@@ -987,7 +987,7 @@ boolean_t
tcp_eager_blowoff(tcp_t *listener, t_scalar_t seqnum)
{
tcp_t *eager;
- mblk_t *mp;
+ mblk_t *mp;
eager = listener;
mutex_enter(&listener->tcp_eager_lock);
@@ -1157,7 +1157,7 @@ tcp_eager_unlink(tcp_t *tcp)
*
* incoming SYN (listener perimeter) -> tcp_input_listener()
*
- * incoming SYN-ACK-ACK (eager perim) -> tcp_input_data()
+ * incoming SYN-ACK-ACK (eager perim) -> tcp_input_data()
* send T_CONN_IND (listener perim) -> tcp_send_conn_ind()
*
* Sockfs ACCEPT Path:
@@ -1268,7 +1268,7 @@ tcp_input_listener(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *ira)
conn_t *econnp = NULL;
squeue_t *new_sqp;
mblk_t *mp1;
- uint_t ip_hdr_len;
+ uint_t ip_hdr_len;
conn_t *lconnp = (conn_t *)arg;
tcp_t *listener = lconnp->conn_tcp;
tcp_stack_t *tcps = listener->tcp_tcps;
@@ -5456,7 +5456,7 @@ tcp_rsrv_input(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy)
* TCP, we have no data to send out of here. What we do is clear the receive
* window, and send out a window update.
*/
-void
+int
tcp_rsrv(queue_t *q)
{
conn_t *connp = Q_TO_CONN(q);
@@ -5473,7 +5473,7 @@ tcp_rsrv(queue_t *q)
mutex_enter(&tcp->tcp_rsrv_mp_lock);
if ((mp = tcp->tcp_rsrv_mp) == NULL) {
mutex_exit(&tcp->tcp_rsrv_mp_lock);
- return;
+ return (0);
}
tcp->tcp_rsrv_mp = NULL;
mutex_exit(&tcp->tcp_rsrv_mp_lock);
@@ -5481,6 +5481,7 @@ tcp_rsrv(queue_t *q)
CONN_INC_REF(connp);
SQUEUE_ENTER_ONE(connp->conn_sqp, mp, tcp_rsrv_input, connp,
NULL, SQ_PROCESS, SQTAG_TCP_RSRV);
+ return (0);
}
/* At minimum we need 8 bytes in the TCP header for the lookup */
diff --git a/usr/src/uts/common/inet/tcp/tcp_output.c b/usr/src/uts/common/inet/tcp/tcp_output.c
index fedff0b962..60840a3d54 100644
--- a/usr/src/uts/common/inet/tcp/tcp_output.c
+++ b/usr/src/uts/common/inet/tcp/tcp_output.c
@@ -80,7 +80,7 @@ static void tcp_wput_proto(void *, mblk_t *, void *, ip_recv_attr_t *);
*/
static int tcp_tx_pull_len = 16;
-void
+int
tcp_wput(queue_t *q, mblk_t *mp)
{
conn_t *connp = Q_TO_CONN(q);
@@ -110,11 +110,11 @@ tcp_wput(queue_t *q, mblk_t *mp)
CONN_INC_REF(connp);
SQUEUE_ENTER_ONE(connp->conn_sqp, mp, tcp_output, connp,
NULL, tcp_squeue_flag, SQTAG_TCP_OUTPUT);
- return;
+ return (0);
case M_CMD:
tcp_wput_cmdblk(q, mp);
- return;
+ return (0);
case M_PROTO:
case M_PCPROTO:
@@ -132,7 +132,7 @@ tcp_wput(queue_t *q, mblk_t *mp)
"tcp_wput_proto, dropping one...");
}
freemsg(mp);
- return;
+ return (0);
}
if (type == T_SVR4_OPTMGMT_REQ) {
/*
@@ -147,14 +147,14 @@ tcp_wput(queue_t *q, mblk_t *mp)
ASSERT(cr != NULL);
if (cr == NULL) {
tcp_err_ack(tcp, mp, TSYSERR, EINVAL);
- return;
+ return (0);
}
if (snmpcom_req(q, mp, tcp_snmp_set, ip_snmp_get,
cr)) {
/*
* This was a SNMP request
*/
- return;
+ return (0);
} else {
output_proc = tcp_wput_proto;
}
@@ -175,12 +175,12 @@ tcp_wput(queue_t *q, mblk_t *mp)
switch (iocp->ioc_cmd) {
case TCP_IOC_ABORT_CONN:
tcp_ioctl_abort_conn(q, mp);
- return;
+ return (0);
case TI_GETPEERNAME:
case TI_GETMYNAME:
mi_copyin(q, mp, NULL,
SIZEOF_STRUCT(strbuf, iocp->ioc_flag));
- return;
+ return (0);
default:
output_proc = tcp_wput_ioctl;
@@ -195,6 +195,7 @@ tcp_wput(queue_t *q, mblk_t *mp)
CONN_INC_REF(connp);
SQUEUE_ENTER_ONE(connp->conn_sqp, mp, output_proc, connp,
NULL, tcp_squeue_flag, SQTAG_TCP_WPUT_OTHER);
+ return (0);
}
/*
@@ -572,7 +573,7 @@ done:;
* All further messages will also be handled by tcp_wput() because we cannot
* be sure that the above short cut is safe later.
*/
-void
+int
tcp_wput_sock(queue_t *wq, mblk_t *mp)
{
conn_t *connp = Q_TO_CONN(wq);
@@ -589,20 +590,22 @@ tcp_wput_sock(queue_t *wq, mblk_t *mp)
MBLKL(mp) == sizeof (struct T_capability_req) &&
car->PRIM_type == T_CAPABILITY_REQ) {
tcp_capability_req(tcp, mp);
- return;
+ return (0);
}
tcp_wput(wq, mp);
+ return (0);
}
/* ARGSUSED */
-void
+int
tcp_wput_fallback(queue_t *wq, mblk_t *mp)
{
#ifdef DEBUG
cmn_err(CE_CONT, "tcp_wput_fallback: Message during fallback \n");
#endif
freemsg(mp);
+ return (0);
}
/*
@@ -718,7 +721,7 @@ tcp_wput_iocdata(tcp_t *tcp, mblk_t *mp)
STRUCT_HANDLE(strbuf, sb);
uint_t addrlen;
conn_t *connp = tcp->tcp_connp;
- queue_t *q = connp->conn_wq;
+ queue_t *q = connp->conn_wq;
/* Make sure it is one of ours. */
switch (iocp->ioc_cmd) {
@@ -819,7 +822,7 @@ tcp_wput_iocdata(tcp_t *tcp, mblk_t *mp)
static void
tcp_wput_ioctl(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy)
{
- conn_t *connp = (conn_t *)arg;
+ conn_t *connp = (conn_t *)arg;
tcp_t *tcp = connp->conn_tcp;
queue_t *q = connp->conn_wq;
struct iocblk *iocp;
@@ -1680,7 +1683,7 @@ finish:
void
tcp_shutdown_output(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy)
{
- conn_t *connp = (conn_t *)arg;
+ conn_t *connp = (conn_t *)arg;
tcp_t *tcp = connp->conn_tcp;
freemsg(mp);
@@ -2686,8 +2689,8 @@ tcp_xmit_listeners_reset(mblk_t *mp, ip_recv_attr_t *ira, ip_stack_t *ipst,
uint32_t seg_seq;
uint32_t seg_ack;
uint_t flags;
- ipha_t *ipha;
- ip6_t *ip6h;
+ ipha_t *ipha;
+ ip6_t *ip6h;
boolean_t policy_present;
netstack_t *ns = ipst->ips_netstack;
tcp_stack_t *tcps = ns->netstack_tcp;
diff --git a/usr/src/uts/common/inet/tcp/tcp_tpi.c b/usr/src/uts/common/inet/tcp/tcp_tpi.c
index 2ce72e7daa..dbdc5b8dc7 100644
--- a/usr/src/uts/common/inet/tcp/tcp_tpi.c
+++ b/usr/src/uts/common/inet/tcp/tcp_tpi.c
@@ -1054,7 +1054,7 @@ tcp_accept_finish(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy)
tcp_t *tcp = connp->conn_tcp;
queue_t *q = connp->conn_rq;
tcp_stack_t *tcps = tcp->tcp_tcps;
- struct stroptions *stropt;
+ struct stroptions *stropt;
struct sock_proto_props sopp;
/* Should never be called for non-STREAMS sockets */
@@ -1685,7 +1685,7 @@ finish:
* Acceptor STREAM when sockfs listener does accept processing.
* Read the block comment on top of tcp_input_listener().
*/
-void
+int
tcp_tpi_accept(queue_t *q, mblk_t *mp)
{
queue_t *rq = RD(q);
@@ -1713,7 +1713,7 @@ tcp_tpi_accept(queue_t *q, mblk_t *mp)
mp = mi_tpi_err_ack_alloc(mp, TSYSERR, EINVAL);
if (mp != NULL)
putnext(rq, mp);
- return;
+ return (0);
}
conn_res = (struct T_conn_res *)mp->b_rptr;
ASSERT((uintptr_t)(mp->b_wptr - mp->b_rptr) <= (uintptr_t)INT_MAX);
@@ -1721,7 +1721,7 @@ tcp_tpi_accept(queue_t *q, mblk_t *mp)
mp = mi_tpi_err_ack_alloc(mp, TPROTO, 0);
if (mp != NULL)
putnext(rq, mp);
- return;
+ return (0);
}
switch (conn_res->PRIM_type) {
case O_T_CONN_RES:
@@ -1766,7 +1766,7 @@ tcp_tpi_accept(queue_t *q, mblk_t *mp)
mp = mi_tpi_err_ack_alloc(mp, TPROTO, 0);
if (mp != NULL)
putnext(rq, mp);
- return;
+ return (0);
}
eager->tcp_issocket = B_TRUE;
@@ -1854,13 +1854,14 @@ tcp_tpi_accept(queue_t *q, mblk_t *mp)
}
putnext(rq, mp);
- return;
+ break;
default:
mp = mi_tpi_err_ack_alloc(mp, TNOTSUPPORT, 0);
if (mp != NULL)
putnext(rq, mp);
- return;
+ break;
}
+ return (0);
}
/*
@@ -1908,7 +1909,7 @@ tcp_send_conn_ind(void *arg, mblk_t *mp, void *arg2)
tcp_t *listener = lconnp->conn_tcp;
tcp_t *tcp;
struct T_conn_ind *conn_ind;
- ipaddr_t *addr_cache;
+ ipaddr_t *addr_cache;
boolean_t need_send_conn_ind = B_FALSE;
tcp_stack_t *tcps = listener->tcp_tcps;
diff --git a/usr/src/uts/common/inet/tcp_impl.h b/usr/src/uts/common/inet/tcp_impl.h
index d45f7a66ac..4ef1886bae 100644
--- a/usr/src/uts/common/inet/tcp_impl.h
+++ b/usr/src/uts/common/inet/tcp_impl.h
@@ -108,7 +108,7 @@ extern sock_downcalls_t sock_tcp_downcalls;
/* TCP timers related data structures. Refer to tcp_timers.c. */
typedef struct tcp_timer_s {
conn_t *connp;
- void (*tcpt_proc)(void *);
+ void (*tcpt_proc)(void *);
callout_id_t tcpt_tid;
} tcp_timer_t;
@@ -626,7 +626,7 @@ extern void tcp_ipsec_cleanup(tcp_t *);
extern int tcp_maxpsz_set(tcp_t *, boolean_t);
extern void tcp_mss_set(tcp_t *, uint32_t);
extern void tcp_reinput(conn_t *, mblk_t *, ip_recv_attr_t *, ip_stack_t *);
-extern void tcp_rsrv(queue_t *);
+extern int tcp_rsrv(queue_t *);
extern uint_t tcp_rwnd_reopen(tcp_t *);
extern int tcp_rwnd_set(tcp_t *, uint32_t);
extern int tcp_set_destination(tcp_t *);
@@ -676,10 +676,10 @@ extern void tcp_send_synack(void *, mblk_t *, void *, ip_recv_attr_t *);
extern void tcp_shutdown_output(void *, mblk_t *, void *, ip_recv_attr_t *);
extern void tcp_ss_rexmit(tcp_t *);
extern void tcp_update_xmit_tail(tcp_t *, uint32_t);
-extern void tcp_wput(queue_t *, mblk_t *);
+extern int tcp_wput(queue_t *, mblk_t *);
extern void tcp_wput_data(tcp_t *, mblk_t *, boolean_t);
-extern void tcp_wput_sock(queue_t *, mblk_t *);
-extern void tcp_wput_fallback(queue_t *, mblk_t *);
+extern int tcp_wput_sock(queue_t *, mblk_t *);
+extern int tcp_wput_fallback(queue_t *, mblk_t *);
extern void tcp_xmit_ctl(char *, tcp_t *, uint32_t, uint32_t, int);
extern void tcp_xmit_listeners_reset(mblk_t *, ip_recv_attr_t *,
ip_stack_t *i, conn_t *);
@@ -734,7 +734,7 @@ extern void tcp_err_ack_prim(tcp_t *, mblk_t *, int, int, int);
extern void tcp_info_req(tcp_t *, mblk_t *);
extern void tcp_send_conn_ind(void *, mblk_t *, void *);
extern void tcp_send_pending(void *, mblk_t *, void *, ip_recv_attr_t *);
-extern void tcp_tpi_accept(queue_t *, mblk_t *);
+extern int tcp_tpi_accept(queue_t *, mblk_t *);
extern void tcp_tpi_bind(tcp_t *, mblk_t *);
extern int tcp_tpi_close(queue_t *, int, cred_t *);
extern int tcp_tpi_close_accept(queue_t *, int, cred_t *);
diff --git a/usr/src/uts/common/inet/udp/udp.c b/usr/src/uts/common/inet/udp/udp.c
index bce32cd82b..5f3e61b8cc 100644
--- a/usr/src/uts/common/inet/udp/udp.c
+++ b/usr/src/uts/common/inet/udp/udp.c
@@ -144,8 +144,8 @@ static void udp_icmp_error_ipv6(conn_t *connp, mblk_t *mp,
ip_recv_attr_t *ira);
static void udp_info_req(queue_t *q, mblk_t *mp);
static void udp_input(void *, mblk_t *, void *, ip_recv_attr_t *);
-static void udp_lrput(queue_t *, mblk_t *);
-static void udp_lwput(queue_t *, mblk_t *);
+static int udp_lrput(queue_t *, mblk_t *);
+static int udp_lwput(queue_t *, mblk_t *);
static int udp_open(queue_t *q, dev_t *devp, int flag, int sflag,
cred_t *credp, boolean_t isv6);
static int udp_openv4(queue_t *q, dev_t *devp, int flag, int sflag,
@@ -178,7 +178,7 @@ static in_port_t udp_update_next_port(udp_t *udp, in_port_t port,
boolean_t random);
static void udp_wput_other(queue_t *q, mblk_t *mp);
static void udp_wput_iocdata(queue_t *q, mblk_t *mp);
-static void udp_wput_fallback(queue_t *q, mblk_t *mp);
+static int udp_wput_fallback(queue_t *q, mblk_t *mp);
static size_t udp_set_rcv_hiwat(udp_t *udp, size_t size);
static void *udp_stack_init(netstackid_t stackid, netstack_t *ns);
@@ -258,12 +258,12 @@ static struct qinit udp_rinitv6 = {
};
static struct qinit udp_winit = {
- (pfi_t)udp_wput, (pfi_t)ip_wsrv, NULL, NULL, NULL, &udp_mod_info
+ udp_wput, ip_wsrv, NULL, NULL, NULL, &udp_mod_info
};
/* UDP entry point during fallback */
struct qinit udp_fallback_sock_winit = {
- (pfi_t)udp_wput_fallback, NULL, NULL, NULL, NULL, &udp_mod_info
+ udp_wput_fallback, NULL, NULL, NULL, NULL, &udp_mod_info
};
/*
@@ -271,11 +271,11 @@ struct qinit udp_fallback_sock_winit = {
* likes to use it as a place to hang the various streams.
*/
static struct qinit udp_lrinit = {
- (pfi_t)udp_lrput, NULL, udp_openv4, udp_tpi_close, NULL, &udp_mod_info
+ udp_lrput, NULL, udp_openv4, udp_tpi_close, NULL, &udp_mod_info
};
static struct qinit udp_lwinit = {
- (pfi_t)udp_lwput, NULL, udp_openv4, udp_tpi_close, NULL, &udp_mod_info
+ udp_lwput, NULL, udp_openv4, udp_tpi_close, NULL, &udp_mod_info
};
/* For AF_INET aka /dev/udp */
@@ -1618,7 +1618,7 @@ udp_do_opt_set(conn_opt_arg_t *coa, int level, int name,
udp_t *udp = connp->conn_udp;
udp_stack_t *us = udp->udp_us;
int *i1 = (int *)invalp;
- boolean_t onoff = (*i1 == 0) ? 0 : 1;
+ boolean_t onoff = (*i1 == 0) ? 0 : 1;
int error;
ASSERT(MUTEX_NOT_HELD(&coa->coa_connp->conn_lock));
@@ -1747,9 +1747,9 @@ udp_opt_set(conn_t *connp, uint_t optset_context, int level,
/*
* Note: Implies T_CHECK semantics for T_OPTCOM_REQ
* inlen != 0 implies value supplied and
- * we have to "pretend" to set it.
+ * we have to "pretend" to set it.
* inlen == 0 implies that there is no
- * value part in T_CHECK request and just validation
+ * value part in T_CHECK request and just validation
* done elsewhere should be enough, we just return here.
*/
if (inlen == 0) {
@@ -3365,7 +3365,7 @@ udp_ud_err_connected(conn_t *connp, t_scalar_t error)
* structure without the cumbersome T_UNITDATA_REQ interface for the case of
* connected endpoints.
*/
-void
+int
udp_wput(queue_t *q, mblk_t *mp)
{
sin6_t *sin6;
@@ -3396,7 +3396,7 @@ udp_wput(queue_t *q, mblk_t *mp)
UDP_DBGSTAT(us, udp_data_notconn);
UDP_STAT(us, udp_out_err_notconn);
freemsg(mp);
- return;
+ return (0);
}
/*
* All Solaris components should pass a db_credp
@@ -3409,7 +3409,7 @@ udp_wput(queue_t *q, mblk_t *mp)
if (cr == NULL) {
UDPS_BUMP_MIB(us, udpOutErrors);
freemsg(mp);
- return;
+ return (0);
}
ASSERT(udp->udp_issocket);
UDP_DBGSTAT(us, udp_data_conn);
@@ -3422,7 +3422,7 @@ udp_wput(queue_t *q, mblk_t *mp)
printf("udp_output_connected returned %d\n", error);
#endif
}
- return;
+ return (0);
case M_PROTO:
case M_PCPROTO:
@@ -3430,13 +3430,13 @@ udp_wput(queue_t *q, mblk_t *mp)
if (MBLKL(mp) < sizeof (*tudr) ||
((t_primp_t)mp->b_rptr)->type != T_UNITDATA_REQ) {
udp_wput_other(q, mp);
- return;
+ return (0);
}
break;
default:
udp_wput_other(q, mp);
- return;
+ return (0);
}
/* Handle valid T_UNITDATA_REQ here */
@@ -3586,7 +3586,7 @@ udp_wput(queue_t *q, mblk_t *mp)
}
if (error == 0) {
freeb(mp);
- return;
+ return (0);
}
break;
@@ -3648,7 +3648,7 @@ udp_wput(queue_t *q, mblk_t *mp)
}
if (error == 0) {
freeb(mp);
- return;
+ return (0);
}
break;
}
@@ -3656,7 +3656,7 @@ udp_wput(queue_t *q, mblk_t *mp)
ASSERT(mp != NULL);
/* mp is freed by the following routine */
udp_ud_err(q, mp, (t_scalar_t)error);
- return;
+ return (0);
ud_error2:
UDPS_BUMP_MIB(us, udpOutErrors);
@@ -3665,6 +3665,7 @@ ud_error2:
ASSERT(mp != NULL);
/* mp is freed by the following routine */
udp_ud_err(q, mp, (t_scalar_t)error);
+ return (0);
}
/*
@@ -4000,13 +4001,14 @@ ud_error:
}
/* ARGSUSED */
-static void
+static int
udp_wput_fallback(queue_t *wq, mblk_t *mp)
{
#ifdef DEBUG
cmn_err(CE_CONT, "udp_wput_fallback: Message in fallback \n");
#endif
freemsg(mp);
+ return (0);
}
@@ -4482,7 +4484,7 @@ udp_set_rcv_hiwat(udp_t *udp, size_t size)
* Nobody should be sending
* packets up this stream
*/
-static void
+static int
udp_lrput(queue_t *q, mblk_t *mp)
{
switch (mp->b_datap->db_type) {
@@ -4491,11 +4493,12 @@ udp_lrput(queue_t *q, mblk_t *mp)
if (*mp->b_rptr & FLUSHW) {
*mp->b_rptr &= ~FLUSHR;
qreply(q, mp);
- return;
+ return (0);
}
break;
}
freemsg(mp);
+ return (0);
}
/*
@@ -4503,10 +4506,11 @@ udp_lrput(queue_t *q, mblk_t *mp)
* Nobody should be sending packets down this stream.
*/
/* ARGSUSED */
-void
+int
udp_lwput(queue_t *q, mblk_t *mp)
{
freemsg(mp);
+ return (0);
}
/*
@@ -4537,9 +4541,9 @@ udp_do_open(cred_t *credp, boolean_t isv6, int flags, int *errorp)
{
udp_t *udp;
conn_t *connp;
- zoneid_t zoneid;
- netstack_t *ns;
- udp_stack_t *us;
+ zoneid_t zoneid;
+ netstack_t *ns;
+ udp_stack_t *us;
int len;
ASSERT(errorp != NULL);
@@ -4709,7 +4713,7 @@ void
udp_activate(sock_lower_handle_t proto_handle, sock_upper_handle_t sock_handle,
sock_upcalls_t *sock_upcalls, int flags, cred_t *cr)
{
- conn_t *connp = (conn_t *)proto_handle;
+ conn_t *connp = (conn_t *)proto_handle;
struct sock_proto_props sopp;
/* All Solaris components should pass a cred for this operation. */
@@ -5463,7 +5467,7 @@ udp_implicit_bind(conn_t *connp, cred_t *cr)
static int
udp_do_unbind(conn_t *connp)
{
- udp_t *udp = connp->conn_udp;
+ udp_t *udp = connp->conn_udp;
udp_fanout_t *udpf;
udp_stack_t *us = udp->udp_us;
@@ -5527,10 +5531,10 @@ udp_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len,
{
sin6_t *sin6;
sin_t *sin;
- in6_addr_t v6dst;
- ipaddr_t v4dst;
- uint16_t dstport;
- uint32_t flowinfo;
+ in6_addr_t v6dst;
+ ipaddr_t v4dst;
+ uint16_t dstport;
+ uint32_t flowinfo;
udp_fanout_t *udpf;
udp_t *udp, *udp1;
ushort_t ipversion;
@@ -6135,7 +6139,7 @@ udp_fallback(sock_lower_handle_t proto_handle, queue_t *q,
boolean_t issocket, so_proto_quiesced_cb_t quiesced_cb,
sock_quiesce_arg_t *arg)
{
- conn_t *connp = (conn_t *)proto_handle;
+ conn_t *connp = (conn_t *)proto_handle;
udp_t *udp;
struct T_capability_ack tca;
struct sockaddr_in6 laddr, faddr;
@@ -6380,7 +6384,7 @@ int
udp_ioctl(sock_lower_handle_t proto_handle, int cmd, intptr_t arg,
int mode, int32_t *rvalp, cred_t *cr)
{
- conn_t *connp = (conn_t *)proto_handle;
+ conn_t *connp = (conn_t *)proto_handle;
int error;
/* All Solaris components should pass a cred for this operation. */
diff --git a/usr/src/uts/common/inet/udp_impl.h b/usr/src/uts/common/inet/udp_impl.h
index 6a31ce5c22..1e5204bb15 100644
--- a/usr/src/uts/common/inet/udp_impl.h
+++ b/usr/src/uts/common/inet/udp_impl.h
@@ -242,7 +242,7 @@ extern void udp_ddi_g_init(void);
extern void udp_ddi_g_destroy(void);
extern void udp_output(conn_t *connp, mblk_t *mp, struct sockaddr *addr,
socklen_t addrlen);
-extern void udp_wput(queue_t *, mblk_t *);
+extern int udp_wput(queue_t *, mblk_t *);
extern void *udp_kstat_init(netstackid_t stackid);
extern void udp_kstat_fini(netstackid_t stackid, kstat_t *ksp);