diff options
author | Gordon Ross <gwr@nexenta.com> | 2017-05-08 10:08:35 -0400 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2017-06-12 17:37:36 -0400 |
commit | 336970851eecf9c4348b3de7bbea0687059dd216 (patch) | |
tree | 579c9033c63d2514aab66cb00468a4591fa26766 | |
parent | a4b8c9aa65a0a735aba318024a424a90d7b06c37 (diff) | |
download | illumos-joyent-336970851eecf9c4348b3de7bbea0687059dd216.tar.gz |
6856 sys/stream.h exposes unnecessary macros to userland
Portions contributed by: Lauri Tirkkonen <lotheac@iki.fi>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r-- | usr/src/uts/common/fs/smbclnt/netsmb/smb_subr.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/fs/smbclnt/netsmb/smb_tran.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ilb/ilb_alg_rr.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/netinet/in.h | 3 | ||||
-rw-r--r-- | usr/src/uts/common/sys/hook_event.h | 8 | ||||
-rw-r--r-- | usr/src/uts/common/sys/ksocket.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac_flow.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/neti.h | 12 | ||||
-rw-r--r-- | usr/src/uts/common/sys/netstack.h | 2 | ||||
-rw-r--r-- | usr/src/uts/common/sys/scsi/adapters/iscsi_if.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/socket.h | 10 | ||||
-rw-r--r-- | usr/src/uts/common/sys/socket_proto.h | 1 |
12 files changed, 36 insertions, 14 deletions
diff --git a/usr/src/uts/common/fs/smbclnt/netsmb/smb_subr.h b/usr/src/uts/common/fs/smbclnt/netsmb/smb_subr.h index 601c78ac7c..df0f28ec05 100644 --- a/usr/src/uts/common/fs/smbclnt/netsmb/smb_subr.h +++ b/usr/src/uts/common/fs/smbclnt/netsmb/smb_subr.h @@ -45,11 +45,13 @@ #include <sys/note.h> #include <netsmb/smb_conn.h> +struct msgb; /* avoiding sys/stream.h here */ + /* Helper function for SMBERROR */ /*PRINTFLIKE3*/ extern void smb_errmsg(int, const char *, const char *, ...) __KPRINTFLIKE(3); -void m_dumpm(mblk_t *m); +void m_dumpm(struct msgb *); /* * Let's use C99 standard variadic macros! diff --git a/usr/src/uts/common/fs/smbclnt/netsmb/smb_tran.h b/usr/src/uts/common/fs/smbclnt/netsmb/smb_tran.h index 052759f333..f954056a79 100644 --- a/usr/src/uts/common/fs/smbclnt/netsmb/smb_tran.h +++ b/usr/src/uts/common/fs/smbclnt/netsmb/smb_tran.h @@ -41,6 +41,7 @@ #define _NETSMB_SMB_TRAN_H_ #include <sys/socket.h> +#include <sys/stream.h> /* * Known transports diff --git a/usr/src/uts/common/inet/ilb/ilb_alg_rr.c b/usr/src/uts/common/inet/ilb/ilb_alg_rr.c index e88712e19f..c22d7eb027 100644 --- a/usr/src/uts/common/inet/ilb/ilb_alg_rr.c +++ b/usr/src/uts/common/inet/ilb/ilb_alg_rr.c @@ -26,6 +26,8 @@ #include <sys/errno.h> #include <sys/sysmacros.h> +#include <sys/debug.h> +#include <sys/kmem.h> #include <sys/list.h> #include <net/if.h> #include <netinet/in.h> diff --git a/usr/src/uts/common/netinet/in.h b/usr/src/uts/common/netinet/in.h index d77d014e0c..9ac3066362 100644 --- a/usr/src/uts/common/netinet/in.h +++ b/usr/src/uts/common/netinet/in.h @@ -63,9 +63,6 @@ typedef void *Psocklen_t; #endif /* _SOCKLEN_T */ -#if !defined(_XPG4_2) || defined(__EXTENSIONS__) -#include <sys/stream.h> -#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ /* * Symbols such as htonl() are required to be exposed through this file, * per XNS Issue 5. This is achieved by inclusion of <sys/byteorder.h> diff --git a/usr/src/uts/common/sys/hook_event.h b/usr/src/uts/common/sys/hook_event.h index 131460343b..193d1f65d4 100644 --- a/usr/src/uts/common/sys/hook_event.h +++ b/usr/src/uts/common/sys/hook_event.h @@ -39,6 +39,8 @@ extern "C" { #endif +struct msgb; /* avoiding sys/stream.h here */ + /* * The hook_pkt_event_t structure is supplied with packet events on * associated network interfaces. @@ -57,8 +59,8 @@ typedef struct hook_pkt_event { phy_if_t hpe_ifp; phy_if_t hpe_ofp; void *hpe_hdr; - mblk_t **hpe_mp; - mblk_t *hpe_mb; + struct msgb **hpe_mp; + struct msgb *hpe_mb; int hpe_flags; void *hpe_reserved[2]; } hook_pkt_event_t; @@ -145,7 +147,7 @@ typedef struct hook_pkt_observe_s { /* * Fields used internally are below. */ - mblk_t *hpo_pkt; + struct msgb *hpo_pkt; void *hpo_ctx; } hook_pkt_observe_t; diff --git a/usr/src/uts/common/sys/ksocket.h b/usr/src/uts/common/sys/ksocket.h index dfe25eec76..5d8827f1ae 100644 --- a/usr/src/uts/common/sys/ksocket.h +++ b/usr/src/uts/common/sys/ksocket.h @@ -33,6 +33,7 @@ extern "C" { /* Opaque kernel socket type */ typedef struct __ksocket *ksocket_t; struct nmsghdr; +struct msgb; /* avoiding sys/stream.h here */ /* flag bit for each Callback Event */ #define KSOCKET_CB_CONNECTED 0x00000001 @@ -96,8 +97,8 @@ extern int ksocket_sendto(ksocket_t, void *, size_t, int, struct sockaddr *, socklen_t, size_t *, struct cred *); extern int ksocket_sendmsg(ksocket_t, struct nmsghdr *, int, size_t *, struct cred *); -extern int ksocket_sendmblk(ksocket_t, struct nmsghdr *, int, mblk_t **, - struct cred *); +extern int ksocket_sendmblk(ksocket_t, struct nmsghdr *, int, + struct msgb **, struct cred *); extern int ksocket_recv(ksocket_t, void *, size_t, int, size_t *, struct cred *); extern int ksocket_recvfrom(ksocket_t, void *, size_t, int, diff --git a/usr/src/uts/common/sys/mac_flow.h b/usr/src/uts/common/sys/mac_flow.h index d43186f2b0..e290ba7dbe 100644 --- a/usr/src/uts/common/sys/mac_flow.h +++ b/usr/src/uts/common/sys/mac_flow.h @@ -37,6 +37,7 @@ extern "C" { #endif #include <sys/types.h> +#include <sys/param.h> /* for MAXPATHLEN */ #include <netinet/in.h> /* for IPPROTO_* constants */ #include <sys/ethernet.h> diff --git a/usr/src/uts/common/sys/neti.h b/usr/src/uts/common/sys/neti.h index 93b5fc3e01..b21504109c 100644 --- a/usr/src/uts/common/sys/neti.h +++ b/usr/src/uts/common/sys/neti.h @@ -36,6 +36,8 @@ extern "C" { #endif +struct msgb; /* avoiding sys/stream.h here */ + #define NETINFO_VERSION 1 /* @@ -109,7 +111,7 @@ typedef enum inject { typedef struct net_inject { int ni_version; netid_t ni_netid; - mblk_t *ni_packet; + struct msgb *ni_packet; struct sockaddr_storage ni_addr; phy_if_t ni_physical; } net_inject_t; @@ -138,8 +140,8 @@ struct net_protocol_s { int (*netp_inject)(net_handle_t, inject_t, net_inject_t *); phy_if_t (*netp_routeto)(net_handle_t, struct sockaddr *, struct sockaddr *); - int (*netp_ispartialchecksum)(net_handle_t, mblk_t *); - int (*netp_isvalidchecksum)(net_handle_t, mblk_t *); + int (*netp_ispartialchecksum)(net_handle_t, struct msgb *); + int (*netp_isvalidchecksum)(net_handle_t, struct msgb *); }; typedef struct net_protocol_s net_protocol_t; @@ -286,8 +288,8 @@ extern phy_if_t net_phylookup(net_handle_t, const char *); extern lif_if_t net_lifgetnext(net_handle_t, phy_if_t, lif_if_t); extern phy_if_t net_routeto(net_handle_t, struct sockaddr *, struct sockaddr *); -extern int net_ispartialchecksum(net_handle_t, mblk_t *); -extern int net_isvalidchecksum(net_handle_t, mblk_t *); +extern int net_ispartialchecksum(net_handle_t, struct msgb *); +extern int net_isvalidchecksum(net_handle_t, struct msgb *); #ifdef __cplusplus } diff --git a/usr/src/uts/common/sys/netstack.h b/usr/src/uts/common/sys/netstack.h index edf703f2ef..b8b46ca350 100644 --- a/usr/src/uts/common/sys/netstack.h +++ b/usr/src/uts/common/sys/netstack.h @@ -32,6 +32,8 @@ #define _SYS_NETSTACK_H #include <sys/kstat.h> +#include <sys/cred.h> +#include <sys/mutex.h> #ifdef __cplusplus extern "C" { diff --git a/usr/src/uts/common/sys/scsi/adapters/iscsi_if.h b/usr/src/uts/common/sys/scsi/adapters/iscsi_if.h index 501ea9bab1..7043dc6dd9 100644 --- a/usr/src/uts/common/sys/scsi/adapters/iscsi_if.h +++ b/usr/src/uts/common/sys/scsi/adapters/iscsi_if.h @@ -35,6 +35,7 @@ extern "C" { #include <sys/socket.h> #include <sys/socketvar.h> /* for struct sonode */ #endif +#include <sys/param.h> /* for MAXPATHLEN */ #include <netinet/in.h> #include <sys/scsi/impl/uscsi.h> #include <sys/iscsi_protocol.h> diff --git a/usr/src/uts/common/sys/socket.h b/usr/src/uts/common/sys/socket.h index 179c64473b..61afedb8ce 100644 --- a/usr/src/uts/common/sys/socket.h +++ b/usr/src/uts/common/sys/socket.h @@ -50,6 +50,16 @@ #ifndef _KERNEL #include <sys/netconfig.h> #endif /* !_KERNEL */ +/* + * Historically, netinet/in.h included sys/stream.h, which pulled in + * several things. The more troublesome namespace pollution was from + * sys/stream.h so that was removed. To avoid having to fix lots of + * programs, pull in a few things that are now (for better or worse) + * expected by programs that include sys/socket.h + */ +#include <sys/param.h> +#include <sys/cred.h> +#include <sys/poll.h> #include <netinet/in.h> #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ diff --git a/usr/src/uts/common/sys/socket_proto.h b/usr/src/uts/common/sys/socket_proto.h index 6bc968be1b..cbb3beddaa 100644 --- a/usr/src/uts/common/sys/socket_proto.h +++ b/usr/src/uts/common/sys/socket_proto.h @@ -30,6 +30,7 @@ extern "C" { #endif #include <sys/socket.h> +#include <sys/stream.h> /* * Generation count |