summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c97
-rw-r--r--usr/src/cmd/fm/eversholt/eftinfo/common/eftinfo.c3
-rw-r--r--usr/src/cmd/fm/eversholt/esc/common/escmain.c3
-rw-r--r--usr/src/cmd/fm/modules/common/eversholt/eval.c1
-rw-r--r--usr/src/cmd/policykit/polkit-is-privileged.c1
-rw-r--r--usr/src/cmd/pools/poolstat/poolstat.c2
-rw-r--r--usr/src/cmd/refer/refer2.c4
-rw-r--r--usr/src/cmd/tbl/t4.c6
-rw-r--r--usr/src/cmd/tbl/t6.c4
-rw-r--r--usr/src/cmd/tbl/t7.c1
-rw-r--r--usr/src/cmd/tbl/t8.c3
-rw-r--r--usr/src/cmd/tcpd/safe_finger.c10
-rw-r--r--usr/src/cmd/tr/tr.c2
-rw-r--r--usr/src/cmd/tsol/updatehome/updatehome.c1
-rw-r--r--usr/src/common/bzip2/decompress.c1
-rw-r--r--usr/src/lib/libmvec/common/__vcos.c1
-rw-r--r--usr/src/lib/libmvec/common/__vsin.c1
-rw-r--r--usr/src/lib/pam_modules/tsol_acct/tsol_acct.c6
-rw-r--r--usr/src/man/man1m/netstat.1m20
-rw-r--r--usr/src/tools/scripts/bldenv.sh3
-rw-r--r--usr/src/uts/common/fs/fdbuffer.c3
-rw-r--r--usr/src/uts/common/inet/ip/ip.c34
-rw-r--r--usr/src/uts/common/inet/ip/ip6.c8
-rw-r--r--usr/src/uts/common/inet/ip/ip_output.c2
-rw-r--r--usr/src/uts/common/inet/sctp/sctp_conn.c2
-rw-r--r--usr/src/uts/common/io/audio/impl/audio_sun.c1
-rw-r--r--usr/src/uts/common/syscall/auditsys.c1
-rw-r--r--usr/src/uts/common/syscall/uadmin.c3
28 files changed, 157 insertions, 67 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
index 2607c5cde6..475e915b2e 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
@@ -23,7 +23,7 @@
* Copyright (c) 1990 Mentat Inc.
* netstat.c 2.2, last change 9/9/91
* MROUTING Revision 3.5
- * Copyright (c) 2017, Joyent, Inc.
+ * Copyright 2018, Joyent, Inc.
*/
/*
@@ -236,6 +236,7 @@ static void fatal(int errcode, char *str1, ...);
static boolean_t Aflag = B_FALSE; /* All sockets/ifs/rtng-tbls */
+static boolean_t CIDRflag = B_FALSE; /* CIDR for IPv4 -i/-r addrs */
static boolean_t Dflag = B_FALSE; /* DCE info */
static boolean_t Iflag = B_FALSE; /* IP Traffic Interfaces */
static boolean_t Mflag = B_FALSE; /* STREAMS Memory Statistics */
@@ -446,12 +447,16 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "adimnrspMgvxf:P:I:DRT:")) != -1) {
+ while ((c = getopt(argc, argv, "acdimnrspMgvxf:P:I:DRT:")) != -1) {
switch ((char)c) {
case 'a': /* all connections */
Aflag = B_TRUE;
break;
+ case 'c':
+ CIDRflag = B_TRUE;
+ break;
+
case 'd': /* DCE info */
Dflag = B_TRUE;
IFLAGMOD(Iflag_only, 1, 0); /* see macro def'n */
@@ -3340,7 +3345,7 @@ if_report_ip4(mib2_ipAddrEntry_t *ap,
boolean_t ksp_not_null)
{
- char abuf[MAXHOSTNAMELEN + 1];
+ char abuf[MAXHOSTNAMELEN + 4]; /* Include /<num> for CIDR-printing. */
char dstbuf[MAXHOSTNAMELEN + 1];
if (ksp_not_null) {
@@ -4439,7 +4444,7 @@ static boolean_t
ire_report_item_v4(const mib2_ipRouteEntry_t *rp, boolean_t first,
const sec_attr_list_t *attrs)
{
- char dstbuf[MAXHOSTNAMELEN + 1];
+ char dstbuf[MAXHOSTNAMELEN + 4]; /* + "/<num>" */
char maskbuf[MAXHOSTNAMELEN + 1];
char gwbuf[MAXHOSTNAMELEN + 1];
char ifname[LIFNAMSIZ + 1];
@@ -5557,7 +5562,7 @@ mrt_report(mib_item_t *item)
struct mfcctl *mfccp;
int numvifs = 0;
int nmfc = 0;
- char abuf[MAXHOSTNAMELEN + 1];
+ char abuf[MAXHOSTNAMELEN + 4]; /* Include CIDR /<num>. */
if (!(family_selected(AF_INET)))
return;
@@ -5976,6 +5981,57 @@ pr_ap6(const in6_addr_t *addr, uint_t port, char *proto,
}
/*
+ * Returns -2 to indicate a discontiguous mask. Otherwise returns between
+ * 0 and 32.
+ */
+static int
+v4_cidr_len(uint_t mask)
+{
+ int rc = 0;
+ int i;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & 0x1)
+ rc++;
+ else if (rc > 0)
+ return (-2); /* Discontiguous IPv4 netmask. */
+
+ mask >>= 1;
+ }
+
+ return (rc);
+}
+
+static void
+append_v4_cidr_len(char *dst, uint_t dstlen, int prefixlen)
+{
+ char *prefixptr;
+
+ /* 4 bytes leaves room for '/' 'N' 'N' '\0' */
+ if (strlen(dst) <= dstlen - 4) {
+ prefixptr = dst + strlen(dst);
+ } else {
+ /*
+ * Cut off last 3 chars of very-long DNS name. All callers
+ * should give us enough room, but name services COULD give us
+ * a way-too-big name (see above).
+ */
+ prefixptr = dst + strlen(dst) - 3;
+ }
+ /* At this point "prefixptr" is guaranteed to point to 4 bytes. */
+
+ if (prefixlen >= 0) {
+ if (prefixlen > 32) /* Shouldn't happen, but... */
+ prefixlen = 32;
+ (void) snprintf(prefixptr, 4, "/%d", prefixlen);
+ } else if (prefixlen == -2) {
+ /* "/NM" == Noncontiguous Mask. */
+ (void) strcat(prefixptr, "/NM");
+ }
+ /* Else print nothing extra. */
+}
+
+/*
* Return the name of the network whose address is given. The address is
* assumed to be that of a net or subnet, not a host.
*/
@@ -5988,13 +6044,17 @@ pr_net(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
uint_t net;
int subnetshift;
int error_num;
+ int prefixlen = -1; /* -1 == Don't print prefix! */
+ /* -2 == Noncontiguous mask... */
if (addr == INADDR_ANY && mask == INADDR_ANY) {
- (void) strncpy(dst, "default", dstlen);
- dst[dstlen - 1] = 0;
+ (void) strlcpy(dst, "default", dstlen);
return (dst);
}
+ if (CIDRflag)
+ prefixlen = v4_cidr_len(ntohl(mask));
+
if (!Nflag && addr) {
if (mask == 0) {
if (IN_CLASSA(addr)) {
@@ -6016,6 +6076,8 @@ pr_net(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
while (addr & ~mask)
/* compiler doesn't sign extend! */
mask = (mask | ((int)mask >> subnetshift));
+ if (CIDRflag)
+ prefixlen = v4_cidr_len(mask);
}
net = addr & mask;
while ((mask & 1) == 0)
@@ -6038,11 +6100,13 @@ pr_net(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
}
}
if (cp != NULL) {
- (void) strncpy(dst, cp, dstlen);
- dst[dstlen - 1] = 0;
+ (void) strlcpy(dst, cp, dstlen);
} else {
(void) inet_ntop(AF_INET, (char *)&addr, dst, dstlen);
}
+
+ append_v4_cidr_len(dst, dstlen, prefixlen);
+
if (hp != NULL)
freehostent(hp);
return (dst);
@@ -6064,15 +6128,19 @@ pr_netaddr(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
struct in_addr in;
int error_num;
uint_t nbo_addr = addr; /* network byte order */
+ int prefixlen = -1; /* -1 == Don't print prefix! */
+ /* -2 == Noncontiguous mask... */
addr = ntohl(addr);
mask = ntohl(mask);
if (addr == INADDR_ANY && mask == INADDR_ANY) {
- (void) strncpy(dst, "default", dstlen);
- dst[dstlen - 1] = 0;
+ (void) strlcpy(dst, "default", dstlen);
return (dst);
}
+ if (CIDRflag)
+ prefixlen = v4_cidr_len(mask);
+
/* Figure out network portion of address (with host portion = 0) */
if (addr) {
/* Try figuring out mask if unknown (all 0s). */
@@ -6096,6 +6164,8 @@ pr_netaddr(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
while (addr & ~mask)
/* compiler doesn't sign extend! */
mask = (mask | ((int)mask >> subnetshift));
+ if (CIDRflag)
+ prefixlen = v4_cidr_len(mask);
}
net = netshifted = addr & mask;
while ((mask & 1) == 0)
@@ -6124,8 +6194,8 @@ pr_netaddr(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
}
if (cp != NULL) {
- (void) strncpy(dst, cp, dstlen);
- dst[dstlen - 1] = 0;
+ (void) strlcpy(dst, cp, dstlen);
+ append_v4_cidr_len(dst, dstlen, prefixlen);
if (hp != NULL)
freehostent(hp);
return (dst);
@@ -6138,6 +6208,7 @@ pr_netaddr(uint_t addr, uint_t mask, char *dst, uint_t dstlen)
in.s_addr = htonl(net);
(void) inet_ntop(AF_INET, (char *)&in, dst, dstlen);
+ append_v4_cidr_len(dst, dstlen, prefixlen);
if (hp != NULL)
freehostent(hp);
return (dst);
diff --git a/usr/src/cmd/fm/eversholt/eftinfo/common/eftinfo.c b/usr/src/cmd/fm/eversholt/eftinfo/common/eftinfo.c
index 68332725d6..03f06dfae7 100644
--- a/usr/src/cmd/fm/eversholt/eftinfo/common/eftinfo.c
+++ b/usr/src/cmd/fm/eversholt/eftinfo/common/eftinfo.c
@@ -29,8 +29,6 @@
* modules is driven by this file.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <string.h>
#ifdef sun
@@ -161,6 +159,7 @@ main(int argc, char *argv[])
VERSION_MAJOR, VERSION_MINOR);
out(O_DIE|O_USAGE, "%s\n%s", Usage, Help);
/*NOTREACHED*/
+ break;
case 'p':
pflag++;
diff --git a/usr/src/cmd/fm/eversholt/esc/common/escmain.c b/usr/src/cmd/fm/eversholt/esc/common/escmain.c
index eec47214ba..8b68098fc5 100644
--- a/usr/src/cmd/fm/eversholt/esc/common/escmain.c
+++ b/usr/src/cmd/fm/eversholt/esc/common/escmain.c
@@ -29,8 +29,6 @@
* modules is driven by this file.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <string.h>
#ifdef sun
@@ -165,6 +163,7 @@ main(int argc, char *argv[])
VERSION_MAJOR, VERSION_MINOR);
out(O_DIE|O_USAGE, "%s\n%s", Usage, Help);
/*NOTREACHED*/
+ break;
case 'o':
outfile = optarg;
diff --git a/usr/src/cmd/fm/modules/common/eversholt/eval.c b/usr/src/cmd/fm/modules/common/eversholt/eval.c
index 8e05ae0bc1..a3c47f91dc 100644
--- a/usr/src/cmd/fm/modules/common/eversholt/eval.c
+++ b/usr/src/cmd/fm/modules/common/eversholt/eval.c
@@ -1698,6 +1698,7 @@ eval_expr(struct node *np, struct lut *ex, struct node *events[],
out(O_ALTFP|O_DIE, "eval_expr: wrong context for operation %s",
ptree_nodetype2str(np->t));
/*NOTREACHED*/
+ break;
case T_NE:
if (!eval_expr(np->u.expr.left, ex, events, globals, croot,
diff --git a/usr/src/cmd/policykit/polkit-is-privileged.c b/usr/src/cmd/policykit/polkit-is-privileged.c
index 85116cf3d0..b1a2006a95 100644
--- a/usr/src/cmd/policykit/polkit-is-privileged.c
+++ b/usr/src/cmd/policykit/polkit-is-privileged.c
@@ -181,6 +181,7 @@ main (int argc, char *argv[])
case LIBPOLKIT_RESULT_NOT_PRIVILEGED:
g_print ("Not privileged.\n");
+ goto out;
case LIBPOLKIT_RESULT_NO_SUCH_PRIVILEGE:
g_print ("No such privilege '%s'.\n", privilege);
diff --git a/usr/src/cmd/pools/poolstat/poolstat.c b/usr/src/cmd/pools/poolstat/poolstat.c
index b52b68427f..a809a7fd45 100644
--- a/usr/src/cmd/pools/poolstat/poolstat.c
+++ b/usr/src/cmd/pools/poolstat/poolstat.c
@@ -160,6 +160,8 @@ static void sa_update(statistic_bag_t *, int);
/* statistics printing function */
static void prt_pool_stats(poolstat_list_element_t *);
+static void usage(void) __NORETURN;
+
static void
usage(void)
{
diff --git a/usr/src/cmd/refer/refer2.c b/usr/src/cmd/refer/refer2.c
index f6fe088d3c..f8605e227b 100644
--- a/usr/src/cmd/refer/refer2.c
+++ b/usr/src/cmd/refer/refer2.c
@@ -12,8 +12,6 @@
* specifies the terms and conditions for redistribution.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "refer..c"
#include <locale.h>
#define NFLD 30
@@ -137,6 +135,8 @@ again:
while (*p != '\n')
p++;
*++p = 0;
+ /* FALLTHROUGH */
+
case 1:
if (endpush)
if (nr = chkdup(answer)) {
diff --git a/usr/src/cmd/tbl/t4.c b/usr/src/cmd/tbl/t4.c
index 262ff12ca2..e2cec8e533 100644
--- a/usr/src/cmd/tbl/t4.c
+++ b/usr/src/cmd/tbl/t4.c
@@ -13,8 +13,6 @@
* specifies the terms and conditions for redistribution.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* t4.c: read table specification */
# include "t..c"
int oncol;
@@ -62,10 +60,12 @@ while (c=get1char())
default:
if (c != tab)
error(gettext("bad table specification character"));
+ /* FALLTHROUGH */
case ' ': /* note this is also case tab */
continue;
case '\n':
if(sawchar==0) continue;
+ /* FALLTHROUGH */
case ',':
case '.': /* end of table specification */
ncol = max(ncol, icol);
@@ -96,7 +96,9 @@ while (c=get1char())
continue;
case 'C': case 'S': case 'R': case 'N': case 'L': case 'A':
c += ('a'-'A');
+ /* FALLTHROUGH */
case '_': if (c=='_') c= '-';
+ /* FALLTHROUGH */
case '=': case '-':
case '^':
case 'c': case 's': case 'n': case 'r': case 'l': case 'a':
diff --git a/usr/src/cmd/tbl/t6.c b/usr/src/cmd/tbl/t6.c
index e862b71de1..db4d2ae3b3 100644
--- a/usr/src/cmd/tbl/t6.c
+++ b/usr/src/cmd/tbl/t6.c
@@ -13,8 +13,6 @@
* specifies the terms and conditions for redistribution.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* t6.c: compute tab stops */
# define tx(a) (a>(char *)0 && a<(char *)128)
# include "t..c"
@@ -58,6 +56,7 @@ for(icol=0; icol <ncol; icol++)
doubled[icol]=1;
fprintf(tabout, ".if \\n(%c->\\n(%d .nr %d \\n(%c-\n",s,S2,S2,s);
}
+ /* FALLTHROUGH */
case 'n':
if (table[ilin][icol].rcol!=0)
{
@@ -78,6 +77,7 @@ for(icol=0; icol <ncol; icol++)
}
continue;
}
+ /* FALLTHROUGH */
case 'r':
case 'c':
case 'l':
diff --git a/usr/src/cmd/tbl/t7.c b/usr/src/cmd/tbl/t7.c
index 5cdd9fc316..d1327eb89f 100644
--- a/usr/src/cmd/tbl/t7.c
+++ b/usr/src/cmd/tbl/t7.c
@@ -62,6 +62,7 @@ for(c=0; c<ncol; c++)
if (table[ldata][c].rcol)
if (lused[c]) /*Zero field width*/
fprintf(tabout, "\\n(%du ",c+CMID);
+ /* FALLTHROUGH */
case 'c':
case 'l':
case 'r':
diff --git a/usr/src/cmd/tbl/t8.c b/usr/src/cmd/tbl/t8.c
index 0b05b43b4f..8d859622e2 100644
--- a/usr/src/cmd/tbl/t8.c
+++ b/usr/src/cmd/tbl/t8.c
@@ -12,8 +12,6 @@
* specifies the terms and conditions for redistribution.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* t8.c: write out one line of output table */
# include "t..c"
# include <locale.h>
@@ -173,6 +171,7 @@ for(c=0; c<ncol; c++)
form=1;
break;
}
+ /* FALLTHROUGH */
case 'c':
form=3; break;
case 'r':
diff --git a/usr/src/cmd/tcpd/safe_finger.c b/usr/src/cmd/tcpd/safe_finger.c
index be41d9bc0f..fcf4a22084 100644
--- a/usr/src/cmd/tcpd/safe_finger.c
+++ b/usr/src/cmd/tcpd/safe_finger.c
@@ -14,16 +14,13 @@
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
-#ifndef lint
-static char sccsid[] = "@(#) safe_finger.c 1.4 94/12/28 17:42:41";
-#endif
-
/* System libraries */
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <pwd.h>
@@ -40,6 +37,7 @@ char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
#define UNPRIV_NAME "nobody" /* Preferred privilege level */
#define UNPRIV_UGID 32767 /* Default uid and gid */
+void perror_exit(char *text) __NORETURN;
int finger_pid;
void cleanup(sig)
@@ -136,8 +134,8 @@ char **argv;
/* perror_exit - report system error text and terminate */
-void perror_exit(text)
-char *text;
+void
+perror_exit(char *text)
{
perror(text);
exit(1);
diff --git a/usr/src/cmd/tr/tr.c b/usr/src/cmd/tr/tr.c
index 4627e590a6..49a8ccb1a8 100644
--- a/usr/src/cmd/tr/tr.c
+++ b/usr/src/cmd/tr/tr.c
@@ -52,7 +52,7 @@ STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
static struct cset *setup(char *, STR *, int, int);
-static void usage(void);
+static void usage(void) __NORETURN;
static wint_t
cmap_lookup(struct cmap *cm, wint_t from)
diff --git a/usr/src/cmd/tsol/updatehome/updatehome.c b/usr/src/cmd/tsol/updatehome/updatehome.c
index 45225fc7e8..9cb43dce04 100644
--- a/usr/src/cmd/tsol/updatehome/updatehome.c
+++ b/usr/src/cmd/tsol/updatehome/updatehome.c
@@ -139,6 +139,7 @@ main(int argc, char **argv)
case '?': /* switch error */
(void) fprintf(stderr, gettext("Bad option -%c.\n"),
(char)optopt);
+ /* FALLTHROUGH */
default:
(void) fprintf(stderr, gettext("usage: %s [-cirs].\n"),
diff --git a/usr/src/common/bzip2/decompress.c b/usr/src/common/bzip2/decompress.c
index dd7eead372..d1da427b26 100644
--- a/usr/src/common/bzip2/decompress.c
+++ b/usr/src/common/bzip2/decompress.c
@@ -41,6 +41,7 @@ void makeMaps_d ( DState* s )
{ retVal = rrr; goto save_state_and_return; }
#define GET_BITS(lll,vvv,nnn) \
+ /* FALLTHROUGH */ \
case lll: s->state = lll; \
while (True) { \
if (s->bsLive >= nnn) { \
diff --git a/usr/src/lib/libmvec/common/__vcos.c b/usr/src/lib/libmvec/common/__vcos.c
index cf2b5fee55..8d27b1bcf7 100644
--- a/usr/src/lib/libmvec/common/__vcos.c
+++ b/usr/src/lib/libmvec/common/__vcos.c
@@ -110,6 +110,7 @@ __vcos(int n, double * restrict x, int stridex, double * restrict y,
sysave = stridey;
biguns = 0;
+ x0 = *x; /* 'x0' may be used uninitialized */
do /* MAIN LOOP */
{
/* Gotos here so _break_ exits MAIN LOOP. */
diff --git a/usr/src/lib/libmvec/common/__vsin.c b/usr/src/lib/libmvec/common/__vsin.c
index 04e3c0a4a6..f679b8089d 100644
--- a/usr/src/lib/libmvec/common/__vsin.c
+++ b/usr/src/lib/libmvec/common/__vsin.c
@@ -90,6 +90,7 @@ __vsin(int n, double * restrict x, int stridex, double * restrict y,
sysave = stridey;
biguns = 0;
+ x0 = *x; /* error: 'x0' may be used uninitialized */
do
{
LOOP0:
diff --git a/usr/src/lib/pam_modules/tsol_acct/tsol_acct.c b/usr/src/lib/pam_modules/tsol_acct/tsol_acct.c
index d9fabd9fc7..d4ef23c908 100644
--- a/usr/src/lib/pam_modules/tsol_acct/tsol_acct.c
+++ b/usr/src/lib/pam_modules/tsol_acct/tsol_acct.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libtsnet.h>
#include <stdlib.h>
#include <string.h>
@@ -89,9 +87,9 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv)
"pam_tsol_account: allowed_unlabeled = %d, user %s, "
"rhost %s",
allow_unlabeled,
- (user == NULL) ? "NULL" : (user == '\0') ? "ZERO" :
+ (user == NULL) ? "NULL" : (*user == '\0') ? "ZERO" :
user,
- (rhost == NULL) ? "NULL" : (rhost == '\0') ? "ZERO" :
+ (rhost == NULL) ? "NULL" : (*rhost == '\0') ? "ZERO" :
rhost);
}
if (user == NULL || *user == '\0') {
diff --git a/usr/src/man/man1m/netstat.1m b/usr/src/man/man1m/netstat.1m
index fa8be7c4ed..5b119fbb43 100644
--- a/usr/src/man/man1m/netstat.1m
+++ b/usr/src/man/man1m/netstat.1m
@@ -1,4 +1,5 @@
'\" te
+.\" Copyright 2018, Joyent, Inc.
.\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 1989 AT&T
.\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
@@ -34,18 +35,18 @@ netstat \- show network status
.LP
.nf
-\fBnetstat\fR \fB-i\fR [\fB-I\fR \fIinterface\fR] [\fB-an\fR] [\fB-f\fR \fIaddress_family\fR]
+\fBnetstat\fR \fB-i\fR [\fB-I\fR \fIinterface\fR] [\fB-acn\fR] [\fB-f\fR \fIaddress_family\fR]
[\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
.fi
.LP
.nf
-\fBnetstat\fR \fB-r\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR | \fIfilter\fR]
+\fBnetstat\fR \fB-r\fR [\fB-acnvR\fR] [\fB-f\fR \fIaddress_family\fR | \fIfilter\fR]
.fi
.LP
.nf
-\fBnetstat\fR \fB-M\fR [\fB-ns\fR] [\fB-f\fR \fIaddress_family\fR]
+\fBnetstat\fR \fB-M\fR [\fB-cns\fR] [\fB-f\fR \fIaddress_family\fR]
.fi
.LP
@@ -127,6 +128,19 @@ default routes are shown and only the status of physical interfaces is shown.
.sp
.ne 2
.na
+\fB\fB-c\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print IPv4 networks using CIDR (x.y.z.a/NN) notation with the \fB-i\fR,
+\fB-r\fR, and \fB-M\fR options. IPv6 networks default to this, but due to
+backward compatibility, IPv4 ones do not without this flag. A noncontiguous
+IPv4 netmask will print "/NM" if this flag is enabled.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-f\fR \fIaddress_family\fR\fR
.ad
.sp .6
diff --git a/usr/src/tools/scripts/bldenv.sh b/usr/src/tools/scripts/bldenv.sh
index 71987a44b5..b9b71d908d 100644
--- a/usr/src/tools/scripts/bldenv.sh
+++ b/usr/src/tools/scripts/bldenv.sh
@@ -290,6 +290,9 @@ if "${flags.t}" ; then
export STABS="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/stabs"
export CTFSTABS="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfstabs"
export GENOFFSETS="${TOOLS_PROTO}/opt/onbld/bin/genoffsets"
+ export CTFCONVERT="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfconvert"
+ export CTFMERGE="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfmerge"
+ export NDRGEN="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ndrgen"
PATH="${TOOLS_PROTO}/opt/onbld/bin/${MACH}:${PATH}"
PATH="${TOOLS_PROTO}/opt/onbld/bin:${PATH}"
diff --git a/usr/src/uts/common/fs/fdbuffer.c b/usr/src/uts/common/fs/fdbuffer.c
index 7260abe9f7..d90bbc89b0 100644
--- a/usr/src/uts/common/fs/fdbuffer.c
+++ b/usr/src/uts/common/fs/fdbuffer.c
@@ -25,8 +25,6 @@
*
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/cmn_err.h>
#include <sys/kmem.h>
@@ -332,6 +330,7 @@ fdb_zero_holes(fdbuffer_t *fdb)
fdh = fdh->next_hole;
kmem_free(pfdh, sizeof (fdb_holes_t));
}
+ break;
default:
panic("fdb_zero_holes: Unknown fdb type.");
break;
diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c
index abc3ee0e60..aef71717b3 100644
--- a/usr/src/uts/common/inet/ip/ip.c
+++ b/usr/src/uts/common/inet/ip/ip.c
@@ -1655,7 +1655,7 @@ icmp_inbound_v4(mblk_t *mp, ip_recv_attr_t *ira)
/* Update DCE and adjust MTU is icmp header if needed */
icmp_inbound_too_big_v4(icmph, ira);
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
icmp_inbound_error_fanout_v4(mp, icmph, ira);
break;
@@ -2283,8 +2283,8 @@ icmp_inbound_error_fanout_v4(mblk_t *mp, icmph_t *icmph, ip_recv_attr_t *ira)
return;
}
/* No self-encapsulated */
- /* FALLTHRU */
}
+ /* FALLTHROUGH */
case IPPROTO_IPV6:
if ((connp = ipcl_iptun_classify_v4(&ripha.ipha_src,
&ripha.ipha_dst, ipst)) != NULL) {
@@ -2298,7 +2298,7 @@ icmp_inbound_error_fanout_v4(mblk_t *mp, icmph_t *icmph, ip_recv_attr_t *ira)
* No IP tunnel is interested, fallthrough and see
* if a raw socket will want it.
*/
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
ira->ira_flags |= IRAF_ICMP_ERROR;
ip_fanout_proto_v4(mp, &ripha, ira);
@@ -6326,7 +6326,7 @@ ip_opt_set_multicast_group(conn_t *connp, t_scalar_t name,
case IP_ADD_MEMBERSHIP:
case IPV6_JOIN_GROUP:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_JOIN_GROUP:
fmode = MODE_IS_EXCLUDE;
optfn = ip_opt_add_group;
@@ -6335,7 +6335,7 @@ ip_opt_set_multicast_group(conn_t *connp, t_scalar_t name,
case IP_DROP_MEMBERSHIP:
case IPV6_LEAVE_GROUP:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_LEAVE_GROUP:
fmode = MODE_IS_INCLUDE;
optfn = ip_opt_delete_group;
@@ -6440,7 +6440,7 @@ ip_opt_set_multicast_sources(conn_t *connp, t_scalar_t name,
switch (name) {
case IP_BLOCK_SOURCE:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_BLOCK_SOURCE:
fmode = MODE_IS_EXCLUDE;
optfn = ip_opt_add_group;
@@ -6448,7 +6448,7 @@ ip_opt_set_multicast_sources(conn_t *connp, t_scalar_t name,
case IP_UNBLOCK_SOURCE:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_UNBLOCK_SOURCE:
fmode = MODE_IS_EXCLUDE;
optfn = ip_opt_delete_group;
@@ -6456,7 +6456,7 @@ ip_opt_set_multicast_sources(conn_t *connp, t_scalar_t name,
case IP_ADD_SOURCE_MEMBERSHIP:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_JOIN_SOURCE_GROUP:
fmode = MODE_IS_INCLUDE;
optfn = ip_opt_add_group;
@@ -6464,7 +6464,7 @@ ip_opt_set_multicast_sources(conn_t *connp, t_scalar_t name,
case IP_DROP_SOURCE_MEMBERSHIP:
mcast_opt = B_FALSE;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case MCAST_LEAVE_SOURCE_GROUP:
fmode = MODE_IS_INCLUDE;
optfn = ip_opt_delete_group;
@@ -7963,7 +7963,7 @@ ip_rput_notdata(ill_t *ill, mblk_t *mp)
putnext(ill->ill_rq, mp);
return;
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
case M_ERROR:
case M_HANGUP:
mutex_enter(&ill->ill_lock);
@@ -7990,7 +7990,7 @@ ip_rput_notdata(ill_t *ill, mblk_t *mp)
default:
break;
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
putnext(ill->ill_rq, mp);
return;
@@ -9095,7 +9095,7 @@ ip_forward_options(mblk_t *mp, ipha_t *ipha, ill_t *dst_ill,
/* Not for us */
break;
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSANDADDR:
off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
break;
@@ -9131,7 +9131,7 @@ ip_forward_options(mblk_t *mp, ipha_t *ipha, ill_t *dst_ill,
}
bcopy(&ifaddr, (char *)opt + off, IP_ADDR_LEN);
opt[IPOPT_OFFSET] += IP_ADDR_LEN;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSONLY:
off = opt[IPOPT_OFFSET] - 1;
/* Compute # of milliseconds since midnight */
@@ -9322,7 +9322,7 @@ ip_input_local_options(mblk_t *mp, ipha_t *ipha, ip_recv_attr_t *ira)
/* Not for us */
break;
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSANDADDR:
off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
break;
@@ -9357,7 +9357,7 @@ ip_input_local_options(mblk_t *mp, ipha_t *ipha, ip_recv_attr_t *ira)
}
bcopy(&ifaddr, (char *)opt + off, IP_ADDR_LEN);
opt[IPOPT_OFFSET] += IP_ADDR_LEN;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSONLY:
off = opt[IPOPT_OFFSET] - 1;
/* Compute # of milliseconds since midnight */
@@ -12010,7 +12010,7 @@ ip_output_local_options(ipha_t *ipha, ip_stack_t *ipst)
/* Not for us */
break;
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSANDADDR:
off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
break;
@@ -12039,7 +12039,7 @@ ip_output_local_options(ipha_t *ipha, ip_stack_t *ipst)
dst = htonl(INADDR_LOOPBACK);
bcopy(&dst, (char *)opt + off, IP_ADDR_LEN);
opt[IPOPT_OFFSET] += IP_ADDR_LEN;
- /* FALLTHRU */
+ /* FALLTHROUGH */
case IPOPT_TS_TSONLY:
off = opt[IPOPT_OFFSET] - 1;
/* Compute # of milliseconds since midnight */
diff --git a/usr/src/uts/common/inet/ip/ip6.c b/usr/src/uts/common/inet/ip/ip6.c
index 3796690972..7f30aaa81d 100644
--- a/usr/src/uts/common/inet/ip/ip6.c
+++ b/usr/src/uts/common/inet/ip/ip6.c
@@ -414,7 +414,7 @@ icmp_inbound_v6(mblk_t *mp, ip_recv_attr_t *ira)
case ICMP6_PACKET_TOO_BIG:
/* Update DCE and adjust MTU is icmp header if needed */
icmp_inbound_too_big_v6(icmp6, ira);
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
icmp_inbound_error_fanout_v6(mp, icmp6, ira);
break;
@@ -962,8 +962,8 @@ icmp_inbound_error_fanout_v6(mblk_t *mp, icmp6_t *icmp6, ip_recv_attr_t *ira)
icmp_inbound_error_fanout_v6(mp, icmp6, ira);
return;
}
- /* FALLTHRU */
}
+ /* FALLTHROUGH */
case IPPROTO_ENCAP:
if ((connp = ipcl_iptun_classify_v6(&rip6h.ip6_src,
&rip6h.ip6_dst, ipst)) != NULL) {
@@ -977,7 +977,7 @@ icmp_inbound_error_fanout_v6(mblk_t *mp, icmp6_t *icmp6, ip_recv_attr_t *ira)
* No IP tunnel is interested, fallthrough and see
* if a raw socket will want it.
*/
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
ira->ira_flags |= IRAF_ICMP_ERROR;
ASSERT(ira->ira_protocol == nexthdr);
@@ -4072,7 +4072,7 @@ ip_source_routed_v6(ip6_t *ip6h, mblk_t *mp, ip_stack_t *ipst)
ip1dbg(("ip_source_routed_v6: Not local\n"));
}
}
- /* FALLTHRU */
+ /* FALLTHROUGH */
default:
ip2dbg(("ip_source_routed_v6: Not source routed here\n"));
return (B_FALSE);
diff --git a/usr/src/uts/common/inet/ip/ip_output.c b/usr/src/uts/common/inet/ip/ip_output.c
index 02a59e69c5..169859707e 100644
--- a/usr/src/uts/common/inet/ip/ip_output.c
+++ b/usr/src/uts/common/inet/ip/ip_output.c
@@ -245,8 +245,8 @@ conn_ip_output(mblk_t *mp, ip_xmit_attr_t *ixa)
break;
}
- /* FALLTHROUGH */
}
+ /* FALLTHROUGH */
default:
ip_drop_output("ipIfStatsOutDiscards - verify nce",
mp, NULL);
diff --git a/usr/src/uts/common/inet/sctp/sctp_conn.c b/usr/src/uts/common/inet/sctp/sctp_conn.c
index 3845f24c32..1306ed14db 100644
--- a/usr/src/uts/common/inet/sctp/sctp_conn.c
+++ b/usr/src/uts/common/inet/sctp/sctp_conn.c
@@ -493,8 +493,8 @@ sctp_connect(sctp_t *sctp, const struct sockaddr *dst, uint32_t addrlen,
return (err);
}
RUN_SCTP(sctp);
- /* FALLTHRU */
}
+ /* FALLTHROUGH */
case SCTPS_BOUND:
ASSERT(sctp->sctp_nsaddrs > 0);
diff --git a/usr/src/uts/common/io/audio/impl/audio_sun.c b/usr/src/uts/common/io/audio/impl/audio_sun.c
index ec6e8aa5d9..cee3f6ace4 100644
--- a/usr/src/uts/common/io/audio/impl/audio_sun.c
+++ b/usr/src/uts/common/io/audio/impl/audio_sun.c
@@ -1250,7 +1250,6 @@ devaudioctl_wput(audio_client_t *c, mblk_t *mp)
/*
* No audio data on control nodes!
*/
- freemsg(mp);
default:
freemsg(mp);
diff --git a/usr/src/uts/common/syscall/auditsys.c b/usr/src/uts/common/syscall/auditsys.c
index 61116dffd2..d7cb94258f 100644
--- a/usr/src/uts/common/syscall/auditsys.c
+++ b/usr/src/uts/common/syscall/auditsys.c
@@ -79,6 +79,7 @@ auditsys(struct auditcalls *uap, rval_t *rvp)
result = auditdoor((int)uap->a1);
break;
}
+ /* FALLTHROUGH */
default:
if (audit_active == C2AUDIT_LOADED) {
result = EINVAL;
diff --git a/usr/src/uts/common/syscall/uadmin.c b/usr/src/uts/common/syscall/uadmin.c
index 7aac5b52a7..bf31c3dcd6 100644
--- a/usr/src/uts/common/syscall/uadmin.c
+++ b/usr/src/uts/common/syscall/uadmin.c
@@ -298,9 +298,8 @@ kadmin(int cmd, int fcn, void *mdep, cred_t *credp)
dump_messages();
invoke_cb = B_TRUE;
-
- /* FALLTHROUGH */
}
+ /* FALLTHROUGH */
case A_REBOOT:
if ((mdep != NULL) && (*(char *)mdep == '/')) {