summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-12-06 11:07:59 -0500
committerDan McDonald <danmcd@mnx.io>2022-12-06 11:07:59 -0500
commit519ebb012f55b339005b58a1bd1735e4969abf7e (patch)
tree4d7ae40c23048dee7896b44868ca669b74ccf108 /usr/src/lib
parent91d202bd4a855f8603d27f0cd32ed6d63525ff23 (diff)
parentd094b9b6950402cc8187f6a82d3d403d3892e7e7 (diff)
downloadillumos-joyent-519ebb012f55b339005b58a1bd1735e4969abf7e.tar.gz
[illumos-gate merge]
commit d094b9b6950402cc8187f6a82d3d403d3892e7e7 15201 bootadm list-menu segfaults for non-existent datasets commit eaf9751f5dce3a91368ffd99bccc978d5812e4fb 9293 bootadm: empty line between boot entries in menu.lst cause bootadm list-menu to segfault commit 0b49aa923f72d28badbed5f4d3ed43a816f07a39 15197 libdladm: enumeration values not handled in switch commit c8ed50c6d60fbb337f556eadef95cef18c28afa5 15193 libdladm: sizeof-pointer-memaccess commit 6fc1cd8d0240203842ead4a592ce7a8c4c3d65eb 15190 libofmt: comparison of integers of different signs
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libdladm/Makefile.com1
-rw-r--r--usr/src/lib/libdladm/common/libdliptun.c2
-rw-r--r--usr/src/lib/libdladm/common/libdlsim.c2
-rw-r--r--usr/src/lib/libdladm/common/libdlvnic.c2
-rw-r--r--usr/src/lib/libofmt/common/ofmt.c14
5 files changed, 12 insertions, 9 deletions
diff --git a/usr/src/lib/libdladm/Makefile.com b/usr/src/lib/libdladm/Makefile.com
index 0737012ec7..72f5a06d0f 100644
--- a/usr/src/lib/libdladm/Makefile.com
+++ b/usr/src/lib/libdladm/Makefile.com
@@ -44,7 +44,6 @@ SRCDIR = ../common
CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += $(CNOWARN_UNINIT)
CPPFLAGS += -I$(SRCDIR) -D_REENTRANT
diff --git a/usr/src/lib/libdladm/common/libdliptun.c b/usr/src/lib/libdladm/common/libdliptun.c
index 8e4855fff5..cf1ab20ba3 100644
--- a/usr/src/lib/libdladm/common/libdliptun.c
+++ b/usr/src/lib/libdladm/common/libdliptun.c
@@ -122,6 +122,8 @@ i_iptun_kparams(dladm_handle_t handle, const iptun_params_t *params,
case IPTUN_TYPE_IPV6:
hints.ai_family = AF_INET6;
break;
+ case IPTUN_TYPE_UNKNOWN:
+ return (DLADM_STATUS_BADIPTUNLADDR);
}
}
diff --git a/usr/src/lib/libdladm/common/libdlsim.c b/usr/src/lib/libdladm/common/libdlsim.c
index 7b8c515875..c4d52abe60 100644
--- a/usr/src/lib/libdladm/common/libdlsim.c
+++ b/usr/src/lib/libdladm/common/libdlsim.c
@@ -386,7 +386,7 @@ dladm_simnet_info(dladm_handle_t handle, datalink_id_t simnet_id,
if (class != DATALINK_CLASS_SIMNET)
return (DLADM_STATUS_BADARG);
- bzero(attrp, sizeof (attrp));
+ bzero(attrp, sizeof (*attrp));
attrp->sna_link_id = simnet_id;
if (flags & DLADM_OPT_ACTIVE) {
diff --git a/usr/src/lib/libdladm/common/libdlvnic.c b/usr/src/lib/libdladm/common/libdlvnic.c
index 27e856006c..f5b754b66f 100644
--- a/usr/src/lib/libdladm/common/libdlvnic.c
+++ b/usr/src/lib/libdladm/common/libdlvnic.c
@@ -148,6 +148,8 @@ i_dladm_vnic_create_sys(dladm_handle_t handle, dladm_vnic_attr_t *attr)
bcopy(ioc.vc_mac_addr, attr->va_mac_addr, MAXMACADDRLEN);
attr->va_mac_len = ioc.vc_mac_len;
break;
+ default:
+ break;
}
return (status);
}
diff --git a/usr/src/lib/libofmt/common/ofmt.c b/usr/src/lib/libofmt/common/ofmt.c
index 0b248b2b2d..eb3624a8c2 100644
--- a/usr/src/lib/libofmt/common/ofmt.c
+++ b/usr/src/lib/libofmt/common/ofmt.c
@@ -71,7 +71,7 @@ typedef struct ofmt_state_s {
struct winsize os_winsize;
int os_nrow;
uint_t os_flags;
- int os_nbad;
+ uint_t os_nbad;
char **os_badfields;
int os_maxnamelen; /* longest name (f. multiline) */
char os_fs; /* field seperator */
@@ -141,7 +141,7 @@ static split_t *
split_fields(const ofmt_field_t *template, uint_t maxfields, uint_t maxcols)
{
split_t *sp;
- int i, cols;
+ uint_t i, cols;
sp = calloc(sizeof (split_t), 1);
if (sp == NULL)
@@ -311,7 +311,7 @@ void
ofmt_close(ofmt_handle_t ofmt)
{
ofmt_state_t *os = ofmt;
- int i;
+ uint_t i;
if (os == NULL)
return;
@@ -402,7 +402,7 @@ ofmt_fit_width(split_t **spp, uint_t width, char *value, uint_t bufsize)
{
split_t *sp = *spp;
char *ptr = value, *lim = ptr + bufsize;
- int i, nextlen;
+ uint_t i, nextlen;
if (sp == NULL) {
sp = split_str(value, OFMT_MAX_ROWS);
@@ -436,7 +436,7 @@ void
ofmt_print(ofmt_handle_t ofmt, void *arg)
{
ofmt_state_t *os = ofmt;
- int i;
+ uint_t i;
char value[1024];
ofmt_field_t *of;
boolean_t escsep, more_rows;
@@ -525,7 +525,7 @@ void
ofmt_print_header(ofmt_handle_t ofmt)
{
ofmt_state_t *os = ofmt;
- int i;
+ uint_t i;
ofmt_field_t *of = os->os_fields;
boolean_t escsep = (os->os_nfields > 1);
@@ -560,7 +560,7 @@ ofmt_strerror(ofmt_handle_t ofmt, ofmt_status_t error, char *buf,
uint_t bufsize)
{
ofmt_state_t *os = ofmt;
- int i;
+ uint_t i;
const char *s;
char ebuf[OFMT_BUFSIZE];
boolean_t parsable;