diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-07-31 15:13:05 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-07-31 15:13:05 +0000 |
commit | 7cd3f4b8e082236e604a53fa1ab5dacb8d11c0c5 (patch) | |
tree | 2cf3b0977768b7a05a135733c7d58288079ee40c /usr/src | |
parent | f72f56d9727aa3ebd6798b5f109dbd3d1670cbe5 (diff) | |
parent | e5c421abb8bd517cb6964747b9ce23066e1a1cef (diff) | |
download | illumos-joyent-7cd3f4b8e082236e604a53fa1ab5dacb8d11c0c5.tar.gz |
[illumos-gate merge]
commit e5c421abb8bd517cb6964747b9ce23066e1a1cef
9266 ixgbe: this statement may fall through
commit 8a7aa2a592747bd90d85645126d80688e024a0e2
9673 move internet address manipulation functions to libc
commit 7e3488dc6cdcb0c04e1ce167a1a3bfef83b5f2e0
9610 qede: error: left shift of negative value
commit d972451485b9ccf8c5c4951e2d24f63da9ac2cc8
9609 qede: error: result of '983040 << 16' requires 37 bits to represent, but 'int' only has 32 bits
commit 3df3d01f9da8be5cdd1e81a5d050c24ccc55caa9
9608 qede: error: 'free_buffer_count' may be used uninitialized in this function
commit 0d7de619fa7b28e48c8e80fa26d724400f4f47a4
9607 qede: this statement may fall through
commit 77b62fe435d195b5a58f123e6c5ec9c9dffdc877
9606 qede: error: this 'for' clause does not guard
Conflicts:
usr/src/man/man1m/route.1m
usr/src/lib/libdladm/Makefile.com
Diffstat (limited to 'usr/src')
59 files changed, 749 insertions, 637 deletions
diff --git a/usr/src/Makefile.lint b/usr/src/Makefile.lint index b5f18f9ca1..f45971204a 100644 --- a/usr/src/Makefile.lint +++ b/usr/src/Makefile.lint @@ -296,7 +296,6 @@ COMMON_SUBDIRS = \ cmd/tabs \ cmd/tail \ cmd/th_tools \ - cmd/tip \ cmd/touch \ cmd/tr \ cmd/truss \ diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile index bc2815c8d7..e1277f4e1d 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile @@ -18,11 +18,11 @@ # # CDDL HEADER END # + +# # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/cmd-inet/usr.lib/in.ndpd/Makefile -# PROG= in.ndpd OBJS= config.o main.o ndp.o tables.o trace.o @@ -36,10 +36,10 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKROUTING) # in.ndpd uses the ancillary data feature which is available only through # UNIX 98 standards version of Socket interface. This interface is supposed to -# be accessed by -lxnet. In addition -lsocket and -lnsl are used to +# be accessed by -lxnet. In addition -lsocket is used to # capture new not-yet-standard interfaces. Someday -lxnet alone should be enough # when IPv6 inspired new interfaces are part of standards. -LDLIBS += -ldhcpagent -lxnet -lsocket -lnsl -lipadm +LDLIBS += -ldhcpagent -lxnet -lsocket -lipadm # these #defines are required to use UNIX 98 interfaces _D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile index 3a83bbdb9f..acb1a9e7be 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile @@ -18,14 +18,11 @@ # # CDDL HEADER END # + # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/cmd-inet/usr.lib/in.ripngd/Makefile -# SVCMETHOD= svc-ripng MANIFEST= ripng.xml @@ -48,10 +45,10 @@ LINTFLAGS += $(_D_UNIX98_EXTN) # in.ripngd uses the ancillary data feature which is available only through # UNIX 98 standards version of Socket interface. This interface is supposed to -# be accessed by -lxnet. In addition, -lsocket and -lnsl are used to +# be accessed by -lxnet. In addition, -lsocket is used to # capture new not-yet-standard interfaces. Someday -lxnet alone should be enough # when IPv6 inspired new interfaces are part of standards. -LDLIBS += -lxnet -lsocket -lnsl +LDLIBS += -lxnet -lsocket .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile index 905f389570..fbde8724c6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile @@ -33,10 +33,10 @@ $(ROOTUSRSBIN)/ping := FILEMODE= 04555 # Ping uses the ancillary data feature which is available only through # UNIX 98 standards version of Socket interface. This interface is supposed to -# be accessed by -lxnet. In addition -lsocket and -lnsl are used to +# be accessed by -lxnet. In addition -lsocket and is used to # capture new not-yet-standard interfaces. Someday -lxnet alone should be enough # when IPv6 inspired new interfaces are part of standards. -LDLIBS += -lxnet -lsocket -lnsl -lm -linetutil +LDLIBS += -lxnet -lsocket -lm -linetutil # These #defines are required to use SUSv3 interfaces CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ @@ -62,7 +62,7 @@ $(PROG): $(OBJS) install: all $(ROOTUSRSBINPROG) -clean: +clean: $(RM) $(OBJS) lint: lint_SRCS diff --git a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile index b3fa1a473a..dac6d08a21 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1995, 1996, 1997 -# The Regents of the University of California. All rights reserved. +# The Regents of the University of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that: (1) source code distributions @@ -22,7 +22,6 @@ # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#) $Header: Makefile.in,v 1.24 97/04/22 13:31:20 leres Exp $ (LBL) PROG= traceroute OBJS= traceroute.o traceroute_aux.o traceroute_aux6.o @@ -34,10 +33,10 @@ $(ROOTUSRSBIN)/traceroute := FILEMODE= 04555 # Traceroute uses the ancillary data feature which is available only through # UNIX 98 standards version of Socket interface. This interface is supposed to -# be accessed by -lxnet. In addition -lsocket and -lnsl are used to +# be accessed by -lxnet. In addition -lsocket is used to # capture new not-yet-standard interfaces. Someday -lxnet alone should be enough # when IPv6 inspired new interfaces are part of standards. -LDLIBS += -lxnet -lsocket -lnsl -linetutil +LDLIBS += -lxnet -lsocket -linetutil # These #defines are required to use UNIX 98 interfaces CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ @@ -65,7 +64,7 @@ $(PROG): $(OBJS) install: all $(ROOTUSRSBINPROG) -clean: +clean: $(RM) $(OBJS) lint: lint_SRCS diff --git a/usr/src/lib/libc/Makefile.targ b/usr/src/lib/libc/Makefile.targ index cd34c5ae91..31992a9ee8 100644 --- a/usr/src/lib/libc/Makefile.targ +++ b/usr/src/lib/libc/Makefile.targ @@ -183,6 +183,11 @@ pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) +# inet rules +pics/%.o %.o: $(LIBCBASE)/../port/inet/%.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) + # locale rules pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c $(COMPILE.c) -o $@ $< diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index 1c99dea417..550ece08fd 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -24,7 +24,7 @@ # Copyright (c) 2017, Joyent, Inc. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # LIBCBASE= . @@ -597,6 +597,14 @@ PORTGEN= \ xpg4.o \ xpg6.o +PORTINET= \ + inet_lnaof.o \ + inet_makeaddr.o \ + inet_network.o \ + inet_ntoa.o \ + inet_ntop.o \ + inet_pton.o + PORTPRINT_W= \ doprnt_w.o @@ -963,6 +971,7 @@ MOSTOBJS= \ $(PORTGEN64) \ $(PORTI18N) \ $(PORTI18N_COND) \ + $(PORTINET) \ $(PORTLOCALE) \ $(PORTPRINT) \ $(PORTPRINT_W) \ @@ -1096,6 +1105,7 @@ SRCS= \ $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \ $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \ $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \ + $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \ $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \ $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \ $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \ diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index 5b73bccc82..9b332269da 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -24,7 +24,7 @@ # Copyright (c) 2017, Joyent, Inc. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # LIBCDIR= $(SRC)/lib/libc @@ -629,6 +629,14 @@ PORTGEN= \ xpg4.o \ xpg6.o +PORTINET= \ + inet_lnaof.o \ + inet_makeaddr.o \ + inet_network.o \ + inet_ntoa.o \ + inet_ntop.o \ + inet_pton.o + PORTPRINT_W= \ doprnt_w.o @@ -1002,6 +1010,7 @@ MOSTOBJS= \ $(PORTGEN64) \ $(PORTI18N) \ $(PORTI18N_COND) \ + $(PORTINET) \ $(PORTLOCALE) \ $(PORTPRINT) \ $(PORTPRINT_C89) \ @@ -1159,6 +1168,7 @@ SRCS= \ $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \ $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \ $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \ + $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \ $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \ $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \ $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \ diff --git a/usr/src/lib/libc/inc/thr_uberdata.h b/usr/src/lib/libc/inc/thr_uberdata.h index 678f68895f..2c56e76f17 100644 --- a/usr/src/lib/libc/inc/thr_uberdata.h +++ b/usr/src/lib/libc/inc/thr_uberdata.h @@ -22,8 +22,10 @@ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. */ + /* * Copyright 2016 Joyent, Inc. + * Copyright 2018 Nexenta Systems, Inc. */ #ifndef _THR_UBERDATA_H @@ -681,6 +683,7 @@ typedef struct ulwp { #endif tumem_t ul_tmem; /* used only by umem */ uint_t ul_ptinherit; /* pthreads sched inherit value */ + char ul_ntoabuf[18]; /* thread-specific inet_ntoa buffer */ } ulwp_t; #define ul_cursig ul_cp.s.cursig /* deferred signal number */ @@ -863,7 +866,7 @@ typedef struct { typedef void (*_exithdlr_func_t) (void*); typedef struct _exthdlr { - struct _exthdlr *next; /* next in handler list */ + struct _exthdlr *next; /* next in handler list */ _exithdlr_func_t hdlr; /* handler itself */ void *arg; /* argument to handler */ void *dso; /* DSO associated with handler */ @@ -901,7 +904,7 @@ typedef struct { typedef void (*_quick_exithdlr_func_t)(void); typedef struct _qexthdlr { - struct _qexthdlr *next; /* next in handler list */ + struct _qexthdlr *next; /* next in handler list */ _quick_exithdlr_func_t hdlr; /* handler itself */ } _qexthdlr_t; diff --git a/usr/src/lib/libsocket/inet/inet_lnaof.c b/usr/src/lib/libc/port/inet/inet_lnaof.c index eeadb0d6cd..ff24f7fbaf 100644 --- a/usr/src/lib/libsocket/inet/inet_lnaof.c +++ b/usr/src/lib/libc/port/inet/inet_lnaof.c @@ -25,7 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -37,9 +37,10 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include "lint.h" #include <sys/types.h> + #include <netinet/in.h> /* @@ -47,7 +48,7 @@ * internet address; handles class a/b/c network * number formats. */ -int +in_addr_t inet_lnaof(struct in_addr in) { uint32_t i = ntohl(in.s_addr); diff --git a/usr/src/lib/libsocket/inet/inet_mkaddr.c b/usr/src/lib/libc/port/inet/inet_makeaddr.c index 6c0127264d..017f426b0e 100644 --- a/usr/src/lib/libsocket/inet/inet_mkaddr.c +++ b/usr/src/lib/libc/port/inet/inet_makeaddr.c @@ -25,7 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -37,9 +37,10 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include "lint.h" #include <sys/types.h> + #include <netinet/in.h> /* diff --git a/usr/src/lib/libsocket/inet/inet_network.c b/usr/src/lib/libc/port/inet/inet_network.c index b7512dc228..8205a4795a 100644 --- a/usr/src/lib/libsocket/inet/inet_network.c +++ b/usr/src/lib/libc/port/inet/inet_network.c @@ -25,7 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -37,12 +37,14 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include "lint.h" #include <sys/types.h> -#include <ctype.h> + #include <netinet/in.h> +#include <ctype.h> + /* * Internet network address interpretation routine. * The library routines call this routine to interpret @@ -69,7 +71,7 @@ again: while ((c = *cp) != NULL) { if (isdigit(c)) { if ((c - '0') >= base) - break; + break; val = (val * base) + (c - '0'); cp++; continue; diff --git a/usr/src/lib/libnsl/rpc/inet_ntoa.c b/usr/src/lib/libc/port/inet/inet_ntoa.c index f68ed15e39..8cc18cdc47 100644 --- a/usr/src/lib/libnsl/rpc/inet_ntoa.c +++ b/usr/src/lib/libc/port/inet/inet_ntoa.c @@ -46,8 +46,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * This product includes software developed by the University of + * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -102,8 +102,6 @@ * SOFTWARE. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Convert network-format internet address * to base 256 d.d.d.d representation. @@ -111,44 +109,34 @@ * Reentrant interface */ -#include "mt.h" -#include "rpc_mt.h" -#include <errno.h> +#include "lint.h" +#include "thr_uberdata.h" + #include <sys/types.h> -#include <ctype.h> + #include <netinet/in.h> + +#include <ctype.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> - char * -inet_ntoa_r(in, b) - struct in_addr in; - char b[]; /* Assumed >= 18 bytes */ +inet_ntoa_r(struct in_addr in, char b[]) { char *p; p = (char *)∈ #define UC(b) (((int)b)&0xff) (void) sprintf(b, "%d.%d.%d.%d", - UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3])); + UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3])); return (b); } char * -inet_ntoa(in) - struct in_addr in; +inet_ntoa(struct in_addr in) { - char *b; - static char b_main[18]; - static pthread_key_t ntoa_key = PTHREAD_ONCE_KEY_NP; - - if (thr_main()) - b = b_main; - else if ((b = thr_get_storage(&ntoa_key, 18, free)) == NULL) - b = b_main; - - return (inet_ntoa_r(in, b)); + return (inet_ntoa_r(in, curthread->ul_ntoabuf)); } /* @@ -167,7 +155,6 @@ inet_aton(const char *cp, struct in_addr *addr) unsigned int parts[4]; unsigned int *pp = parts; - c = *cp; for (;;) { /* @@ -273,7 +260,7 @@ inet_addr(const char *cp) * Return the network number from an internet * address; handles class a/b/c network #'s. */ -uint_t +in_addr_t inet_netof(struct in_addr in) { uint32_t i = ntohl(in.s_addr); diff --git a/usr/src/lib/libnsl/nss/inet_ntop.c b/usr/src/lib/libc/port/inet/inet_ntop.c index 28067cffa0..ef9cd8ea4b 100644 --- a/usr/src/lib/libnsl/nss/inet_ntop.c +++ b/usr/src/lib/libc/port/inet/inet_ntop.c @@ -1,9 +1,4 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* * Copyright (c) 1996 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -20,19 +15,25 @@ * SOFTWARE. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "lint.h" + +#include <sys/socket.h> -#include "mt.h" -#include <stdlib.h> -#include <ctype.h> -#include <string.h> -#include <strings.h> -#include <netdb.h> -#include <stdio.h> #include <arpa/inet.h> #include <netinet/in.h> -#include <sys/socket.h> + +#include <ctype.h> #include <errno.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <strings.h> static const char *inet_ntop4(const uchar_t *, char *, socklen_t); static const char *inet_ntop6(const uchar_t *, char *, socklen_t); @@ -70,20 +71,13 @@ inet_ntop(int af, const void *src, char *dst, socklen_t size) * (2) takes a uchar_t* not an in_addr as input */ -#ifdef SPRINTF_CHAR -/* CSTYLED */ -#define SPRINTF(x) strlen(sprintf/**/x) -#else -#define SPRINTF(x) ((size_t)sprintf x) -#endif - static const char * inet_ntop4(const uchar_t *src, char *dst, socklen_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof ("255.255.255.255")]; - if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) { + if (sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) > size) { errno = ENOSPC; return (NULL); } @@ -168,7 +162,7 @@ inet_ntop6(const uchar_t *src, char *dst, socklen_t size) tp += strlen(tp); break; } - tp += SPRINTF((tp, "%x", words[i])); + tp += sprintf(tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) diff --git a/usr/src/lib/libnsl/nss/inet_pton.c b/usr/src/lib/libc/port/inet/inet_pton.c index ec94b1f5e5..41497a6f19 100644 --- a/usr/src/lib/libnsl/nss/inet_pton.c +++ b/usr/src/lib/libc/port/inet/inet_pton.c @@ -1,9 +1,4 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* * Copyright (c) 1996 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -20,19 +15,25 @@ * SOFTWARE. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "lint.h" + +#include <sys/socket.h> -#include "mt.h" -#include <stdlib.h> -#include <ctype.h> -#include <string.h> -#include <strings.h> -#include <netdb.h> -#include <stdio.h> #include <arpa/inet.h> #include <netinet/in.h> -#include <sys/socket.h> + +#include <ctype.h> #include <errno.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <strings.h> static int inet_pton4(const char *src, uchar_t *dst); static int inet_pton6(const char *src, uchar_t *dst); @@ -131,13 +132,11 @@ inet_pton4(const char *src, uchar_t *dst) * inspired by Mark Andrews. * */ - - static int inet_pton6(const char *src, uchar_t *dst) { - static const char xdigits_l[] = "0123456789abcdef", - xdigits_u[] = "0123456789ABCDEF"; + static const char xdigits_l[] = "0123456789abcdef"; + static const char xdigits_u[] = "0123456789ABCDEF"; uchar_t tmp[IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; diff --git a/usr/src/lib/libc/port/llib-lc b/usr/src/lib/libc/port/llib-lc index f90788e427..5c0d397cbb 100644 --- a/usr/src/lib/libc/port/llib-lc +++ b/usr/src/lib/libc/port/llib-lc @@ -21,7 +21,7 @@ /* * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. + * Copyright 2018 Nexenta Systems, Inc. * Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved. * Copyright (c) 2013 Gary Mills * Copyright 2014 Garrett D'Amore <garrett@damore.org> @@ -172,6 +172,8 @@ #include <stack_unwind.h> #endif #include <xlocale.h> +#include <netinet/in.h> +#include <arpa/inet.h> /* * This really comes from the crt*.s startup modules. @@ -1430,7 +1432,6 @@ int pset_assign_forced(psetid_t pset, processorid_t cpu, psetid_t *opset); int pset_info(psetid_t pset, int *type, u_int *numcpus, processorid_t *cpulist); int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset); int pset_bind_lwp(psetid_t pset, id_t id, pid_t, psetid_t *opset); - /* rctlsys.c */ int getrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk, @@ -1442,7 +1443,6 @@ int setprojrctl(const char *name, rctlblk_t *new_rblk, size_t size, int flags); int rctlctl(const char *, rctlblk_t *, int); size_t rctllist(char *, size_t); - /* semsys.c */ int semctl(int semid, int semnum, int cmd, ...); int semget(key_t key, int nsems, int semflg); @@ -1533,7 +1533,7 @@ size_t wcsxfrm(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2, int wcscoll(const wchar_t *s1, const wchar_t *s2); /* wcsftime.c */ -#if !defined(__amd64) /* XX64 - fix me */ +#if !defined(__amd64) /* XX64 - fix me */ size_t wcsftime(wchar_t *wcs, size_t maxsize, const char *format, const struct tm *timeptr); #endif /* __amd64 */ @@ -1632,7 +1632,7 @@ long double wcstold(const wchar_t *_RESTRICT_KYWD cp, double wstod(const wchar_t *cp, wchar_t **ptr); /* wstok.c */ -#if !defined(__amd64) /* XX64 - fix me */ +#if !defined(__amd64) /* XX64 - fix me */ wchar_t *wcstok(wchar_t *string, const wchar_t *sepset); wchar_t *wstok(wchar_t *string, const wchar_t *sepset); #endif /* __amd64 */ @@ -1849,3 +1849,15 @@ extern size_t u8_textprep_str(char *, size_t *, char *, size_t *, int, size_t, /* private locale interfaces */ wint_t __nextwctype(wint_t, wctype_t); int __iswrune(wint_t); + +/* inet_ntop.c */ +const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); + +/* inet_pton.c */ +int inet_pton(int af, const char *src, void *dst); + +/* inet_ntoa.c */ +char *inet_ntoa_r(struct in_addr in, char b[]); +char *inet_ntoa(struct in_addr in); +in_addr_t inet_addr(const char *cp); +in_addr_t inet_netof(struct in_addr in); diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers index d70de892a1..616e5e8d45 100644 --- a/usr/src/lib/libc/port/mapfile-vers +++ b/usr/src/lib/libc/port/mapfile-vers @@ -21,7 +21,7 @@ # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2016 Joyent, Inc. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. @@ -52,21 +52,6 @@ $mapfile_version 2 # items and for the members of the malloc() family. # -# -# README README README README README README: how to update this file -# 1) each version of Solaris/OpenSolaris gets a version number. -# (Actually since Solaris is actually a series of OpenSolaris releases -# we'll just use OpenSolaris for this exercise.) -# OpenSolaris 2008.11 gets 1.23 -# OpenSolaris 2009.04 gets 1.24 -# etc. -# 2) each project integration uses a unique version number. -# PSARC/2008/123 gets 1.24.1 -# PSARC/2008/456 gets 1.24.2 -# etc. -# - - # Mnemonic conditional input identifiers: # # - amd64, i386, sparc32, sparcv9: Correspond to ISA subdirectories used to @@ -92,6 +77,20 @@ $if _x86 && _ELF64 $add amd64 $endif +SYMBOL_VERSION ILLUMOS_0.25 { # inet_* moved from libnsl/libsocket + protected: + inet_addr; + inet_aton; + inet_lnaof; + inet_makeaddr; + inet_netof; + inet_network; + inet_ntoa; + inet_ntoa_r; + inet_ntop; + inet_pton; +} ILLUMOS_0.24; + SYMBOL_VERSION ILLUMOS_0.24 { # openbsd compat protected: freezero; @@ -1021,7 +1020,7 @@ $if i386 # Note: atomic_add_64_nv is also defined above. Here, we add the # NODYNSORT attribute to it. On this platform, it is an aliases for # atomic_add_64. If that is changed, this line should be removed. - atomic_add_64_nv { FLAGS = NODYNSORT }; + atomic_add_64_nv { FLAGS = NODYNSORT }; $endif $if amd64 @@ -2778,7 +2777,7 @@ $endif $if amd64 } SYSVABI_1.3; -SYMBOL_VERSION SYSVABI_1.3 { +SYMBOL_VERSION SYSVABI_1.3 { $endif global: $if !_sparc @@ -2919,7 +2918,7 @@ $endif attr_to_data_type; attr_to_name; attr_to_option; - attr_to_xattr_view; + attr_to_xattr_view; _autofssys; _bufsync; _cladm; diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 8b0932d08f..dd6a170559 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -24,7 +24,7 @@ # Copyright 2016 Joyent, Inc. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # LIBCDIR= $(SRC)/lib/libc @@ -395,7 +395,7 @@ PORTFP= \ moddi3.o \ muldi3.o \ qdivrem.o \ - ucmpdi2.o \ + ucmpdi2.o \ udivdi3.o \ umoddi3.o @@ -657,6 +657,14 @@ PORTGEN= \ xpg4.o \ xpg6.o +PORTINET= \ + inet_lnaof.o \ + inet_makeaddr.o \ + inet_network.o \ + inet_ntoa.o \ + inet_ntop.o \ + inet_pton.o + PORTPRINT_W= \ doprnt_w.o @@ -1033,6 +1041,7 @@ MOSTOBJS= \ $(PORTGEN64) \ $(PORTI18N) \ $(PORTI18N_COND) \ + $(PORTINET) \ $(PORTLOCALE) \ $(PORTPRINT) \ $(PORTPRINT_C89) \ @@ -1183,6 +1192,7 @@ SRCS= \ $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \ $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \ $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \ + $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \ $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \ $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \ $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index 50f5bfde65..14b5711beb 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -25,7 +25,7 @@ # Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # LIBCDIR= $(SRC)/lib/libc @@ -615,6 +615,14 @@ PORTGEN= \ xpg4.o \ xpg6.o +PORTINET= \ + inet_lnaof.o \ + inet_makeaddr.o \ + inet_network.o \ + inet_ntoa.o \ + inet_ntop.o \ + inet_pton.o + PORTPRINT_W= \ doprnt_w.o @@ -976,6 +984,7 @@ MOSTOBJS= \ $(PORTGEN64) \ $(PORTI18N) \ $(PORTI18N_COND) \ + $(PORTINET) \ $(PORTLOCALE) \ $(PORTPRINT) \ $(PORTPRINT_W) \ @@ -1113,6 +1122,7 @@ SRCS= \ $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \ $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \ $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \ + $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \ $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \ $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \ $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \ diff --git a/usr/src/lib/libdhcputil/Makefile.com b/usr/src/lib/libdhcputil/Makefile.com index c8a695b368..b32dc645ce 100644 --- a/usr/src/lib/libdhcputil/Makefile.com +++ b/usr/src/lib/libdhcputil/Makefile.com @@ -37,7 +37,7 @@ include ../../Makefile.rootfs LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lc -lnsl -lgen -linetutil -ldlpi +LDLIBS += -lc -lgen -linetutil -ldlpi SRCDIR = ../common SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(COMOBJS:%.o=$(COMDIR)/%.c) diff --git a/usr/src/lib/libipadm/Makefile.com b/usr/src/lib/libipadm/Makefile.com index d195ea19c6..255dc3125b 100644 --- a/usr/src/lib/libipadm/Makefile.com +++ b/usr/src/lib/libipadm/Makefile.com @@ -35,8 +35,8 @@ include ../../Makefile.lib include ../../Makefile.rootfs LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lc -lnsl -linetutil -lsocket -ldlpi -lnvpair -ldhcpagent \ - -ldladm -lsecdb -ldhcputil +LDLIBS += -lc -linetutil -lsocket -ldlpi -lnvpair -ldhcpagent \ + -ldladm -lsecdb -ldhcputil SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libiscsit/Makefile.com b/usr/src/lib/libiscsit/Makefile.com index 3388c07123..007a52fb76 100644 --- a/usr/src/lib/libiscsit/Makefile.com +++ b/usr/src/lib/libiscsit/Makefile.com @@ -41,7 +41,7 @@ INCS += -I$(SRCDIR) CSTD= $(CSTD_GNU99) C99LMODE= -Xc99=%all -LDLIBS += -lc -lnvpair -lstmf -luuid -lnsl -lscf +LDLIBS += -lc -lnvpair -lstmf -luuid -lscf CPPFLAGS += $(INCS) -D_REENTRANT CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com index 792e1cd24f..876c3681e9 100644 --- a/usr/src/lib/libnsl/Makefile.com +++ b/usr/src/lib/libnsl/Makefile.com @@ -21,7 +21,7 @@ # # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. All rights reserved. # LIBRARY= libnsl.a @@ -43,7 +43,7 @@ NETDIR= netdir.o NSS= \ gethostbyname_r.o gethostent.o gethostent_r.o gethostent6.o gethostby_door.o \ getipnodeby_door.o getipnodeby.o getrpcent.o getrpcent_r.o inet_matchaddr.o \ -inet_pton.o inet_ntop.o netdir_inet.o netdir_inet_sundry.o \ +netdir_inet.o netdir_inet_sundry.o \ parse.o getauthattr.o getprofattr.o getexecattr.o getuserattr.o getauuser.o NETSELECT= netselect.o @@ -55,7 +55,7 @@ t_connect.o t_error.o t_free.o t_getinfo.o t_getname.o \ t_getstate.o t_listen.o t_look.o t_open.o t_optmgmt.o \ t_rcv.o t_rcvconnect.o t_rcvdis.o t_rcvrel.o t_rcvudata.o \ t_rcvuderr.o t_snd.o t_snddis.o t_sndrel.o t_sndudata.o \ -t_sndv.o t_sndreldata.o t_rcvv.o t_rcvreldata.o t_sysconf.o \ +t_sndv.o t_sndreldata.o t_rcvv.o t_rcvreldata.o t_sysconf.o \ t_sndvudata.o t_rcvvudata.o t_sync.o t_unbind.o t_strerror.o \ xti_wrappers.o @@ -67,7 +67,7 @@ auth_des.o auth_none.o auth_sys.o auth_time.o authdes_prot.o \ authsys_prot.o can_use_af.o \ clnt_bcast.o clnt_dg.o clnt_door.o clnt_generic.o clnt_perror.o \ clnt_raw.o clnt_simple.o clnt_vc.o fdsync.o getdname.o \ -inet_ntoa.o key_call.o key_prot.o mt_misc.o \ +key_call.o key_prot.o mt_misc.o \ netname.o netnamer.o pmap_clnt.o pmap_prot.o \ rpc_callmsg.o rpc_comdata.o rpc_generic.o rpc_prot.o rpc_sel2poll.o \ rpc_soc.o rpc_td.o rpcb_clnt.o rpcb_prot.o \ @@ -83,7 +83,7 @@ SAF= checkver.o doconfig.o YP= \ dbm.o yp_all.o yp_b_clnt.o yp_b_xdr.o yp_bind.o \ yp_enum.o yp_master.o yp_match.o yp_order.o yp_update.o \ -yperr_string.o yp_xdr.o ypprot_err.o ypupd.o \ +yperr_string.o yp_xdr.o ypprot_err.o ypupd.o \ yp_rsvd.o \ yppasswd_xdr.o diff --git a/usr/src/lib/libnsl/common/llib-lnsl b/usr/src/lib/libnsl/common/llib-lnsl index 46f74824eb..8a1fba5b94 100644 --- a/usr/src/lib/libnsl/common/llib-lnsl +++ b/usr/src/lib/libnsl/common/llib-lnsl @@ -22,8 +22,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * - * Copyright 2016 Nexenta Systems, Inc. + */ + +/* + * Copyright 2018 Nexenta Systems, Inc. */ @@ -442,12 +444,6 @@ struct rpcent *getrpcent_r(struct rpcent *result, char *buffer, int buflen); /* inet_matchaddr.c */ int inet_matchaddr(const void *, const char *); -/* inet_ntop.c */ -const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); - -/* inet_pton.c */ -int inet_pton(int af, const char *src, void *dst); - /* netdir_inet.c */ int _get_hostserv_inetnetdir_byname(struct netconfig *nconf, struct nss_netdirbyname_in *args, @@ -568,12 +564,6 @@ int setdomainname(char *domain, int len); /* gethostname.c */ int gethostname(char *hname, int hlen); -/* inet_ntoa.c */ -char *inet_ntoa_r(struct in_addr in, char b[]); -char *inet_ntoa(struct in_addr in); -in_addr_t inet_addr(const char *cp); -in_addr_t inet_netof(struct in_addr in); - /* key_call.c */ int key_setsecret(const char *secretkey); int key_secretkey_is_set(void); diff --git a/usr/src/lib/libnsl/common/mapfile-vers b/usr/src/lib/libnsl/common/mapfile-vers index aafb70af9f..bae1af4edc 100644 --- a/usr/src/lib/libnsl/common/mapfile-vers +++ b/usr/src/lib/libnsl/common/mapfile-vers @@ -18,10 +18,11 @@ # # CDDL HEADER END # + # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2015 Joyent, Inc. -# Copyright 2017 Nexenta Systems, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. # # @@ -40,7 +41,7 @@ $mapfile_version 2 -SYMBOL_VERSION ILLUMOS_0.1 { # Illumos additions +SYMBOL_VERSION ILLUMOS_0.1 { # illumos additions global: svc_tp_create_addr; } SUNW_1.10; @@ -52,7 +53,7 @@ SYMBOL_VERSION SUNW_1.10 { # SunOS 5.11 (Solaris 11) SYMBOL_VERSION SUNW_1.9.1 { # SunOS 5.10 (Solaris 10 update 5) global: - inet_aton; + inet_aton { TYPE = FUNCTION; FILTER = libc.so.1 }; } SUNW_1.9; SYMBOL_VERSION SUNW_1.9 { # SunOS 5.10 (Solaris 10) @@ -78,8 +79,8 @@ SYMBOL_VERSION SUNW_1.7 { # SunOS 5.8 (Solaris 8) freehostent; getipnodebyaddr; getipnodebyname; - inet_ntop; - inet_pton; + inet_ntop { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_pton { TYPE = FUNCTION; FILTER = libc.so.1 }; } SUNW_1.6; SYMBOL_VERSION SUNW_1.6 { # SunOS 5.7 (Solaris 7) @@ -235,16 +236,16 @@ SYMBOL_VERSION SUNW_0.7 { # SunOS 5.3 (Solaris 2.3) getrpcent; getrpcent_r; h_errno { FLAGS = NODIRECT }; - inet_ntoa_r; + inet_ntoa_r { TYPE = FUNCTION; FILTER = libc.so.1 }; key_secretkey_is_set; maxbno; nc_sperror; netdir_perror; netdir_sperror; nextkey; - nis_clone_object; - nis_destroy_object; - nis_dir_cmp; + nis_clone_object; + nis_destroy_object; + nis_dir_cmp; nis_domain_of; nis_leaf_of; nis_leaf_of_r; @@ -318,9 +319,9 @@ SYMBOL_VERSION SISCD_2.3 { $endif gethostbyaddr; gethostbyname; - inet_addr; - inet_netof; - inet_ntoa; + inet_addr { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_netof { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_ntoa { TYPE = FUNCTION; FILTER = libc.so.1 }; _null_auth; rpc_broadcast_exp; svc_fdset; @@ -579,8 +580,8 @@ SYMBOL_VERSION SUNWprivate_1.1 { __getnetnamebyuid; __getpublickey_cached; __getpublickey_cached_g; - __getpublickey_flush; - __getpublickey_flush_g; + __getpublickey_flush; + __getpublickey_flush_g; getpublickey_g; getsecretkey_g; hashinc; @@ -620,17 +621,17 @@ SYMBOL_VERSION SUNWprivate_1.1 { __nis_get_mechanism_library; __nis_get_mechanisms; __nis_get_mechanism_symbol; - nis_get_static_storage; + nis_get_static_storage; __nis_gssprin2netname; __nis_keyalg2authtype; __nis_keyalg2mechalias; __nis_mechalias2authtype; __nis_mechname2alias; - nis_read_obj; + nis_read_obj; __nis_release_mechanisms; __nis_rpc_domain; __nis_translate_mechanism; - nis_write_obj; + nis_write_obj; __nsl_dom; __nss2herrno; nss_ioctl; diff --git a/usr/src/lib/libnwam/Makefile.com b/usr/src/lib/libnwam/Makefile.com index 41b2af85d0..bce8452d4b 100644 --- a/usr/src/lib/libnwam/Makefile.com +++ b/usr/src/lib/libnwam/Makefile.com @@ -44,7 +44,7 @@ include ../../Makefile.lib include ../../Makefile.rootfs LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lbsm -lc -ldladm -lnsl -lnvpair -lscf -lsecdb -lsocket \ +LDLIBS += -lbsm -lc -ldladm -lnvpair -lscf -lsecdb -lsocket \ -lipadm SRCDIR = ../common diff --git a/usr/src/lib/libresolv2/common/mapfile-vers b/usr/src/lib/libresolv2/common/mapfile-vers index 28691e09c0..4eebdbb9ea 100644 --- a/usr/src/lib/libresolv2/common/mapfile-vers +++ b/usr/src/lib/libresolv2/common/mapfile-vers @@ -46,7 +46,7 @@ SYMBOL_VERSION SUNW_2.3 { # SunOS 5.11 (Solaris 11) SYMBOL_VERSION SUNW_2.2.2 { # SunOS 5.10 (Solaris 10 Update 5) global: - inet_aton { TYPE = FUNCTION; FILTER = libnsl.so.1 }; + inet_aton { TYPE = FUNCTION; FILTER = libc.so.1 }; } SUNW_2.2.1; SYMBOL_VERSION SUNW_2.2.1 { # SunOS 5.10 (Solaris 10 Update 4) diff --git a/usr/src/lib/libscf/Makefile.com b/usr/src/lib/libscf/Makefile.com index 9388f9cfb1..a6e2657925 100644 --- a/usr/src/lib/libscf/Makefile.com +++ b/usr/src/lib/libscf/Makefile.com @@ -44,7 +44,7 @@ $(NATIVE_BUILD)VERS = $(NATIVE_BUILD)LIBS = $(DYNLIB) LDLIBS_i386 += -lsmbios -LDLIBS += -luutil -lc -lgen -lnsl -lnvpair +LDLIBS += -luutil -lc -lgen -lnvpair LDLIBS += $(LDLIBS_$(MACH)) SRCDIR = ../common diff --git a/usr/src/lib/libsocket/Makefile.com b/usr/src/lib/libsocket/Makefile.com index 1d22540eee..ed741f39d8 100644 --- a/usr/src/lib/libsocket/Makefile.com +++ b/usr/src/lib/libsocket/Makefile.com @@ -27,12 +27,11 @@ LIBRARY = libsocket.a VERS = .1 INETOBJS = bindresvport.o bootparams_getbyname.o ether_addr.o \ - getaddrinfo.o getnameinfo.o getnetent.o getnetent_r.o \ + getaddrinfo.o getnameinfo.o getnetent.o getnetent_r.o \ getprotoent.o getprotoent_r.o getservbyname_r.o getservent.o \ - getservent_r.o inet_lnaof.o inet_mkaddr.o inet_network.o \ - inet6_opt.o inet6_rthdr.o interface_id.o link_addr.o \ - netmasks.o rcmd.o rexec.o ruserpass.o sourcefilter.o \ - getifaddrs.o + getservent_r.o inet6_opt.o inet6_rthdr.o interface_id.o \ + link_addr.o netmasks.o rcmd.o rexec.o ruserpass.o \ + sourcefilter.o getifaddrs.o SOCKOBJS = _soutil.o sockatmark.o socket.o socketpair.o weaks.o OBJECTS = $(INETOBJS) $(SOCKOBJS) diff --git a/usr/src/lib/libsocket/common/mapfile-vers b/usr/src/lib/libsocket/common/mapfile-vers index 471774b462..f44e54897a 100644 --- a/usr/src/lib/libsocket/common/mapfile-vers +++ b/usr/src/lib/libsocket/common/mapfile-vers @@ -18,10 +18,12 @@ # # CDDL HEADER END # + # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -# # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. +# # # MAPFILE HEADER START @@ -45,9 +47,9 @@ SYMBOL_VERSION ILLUMOS_0.2 { # reentrant ethers(3SOCKET) ether_ntoa_r; } ILLUMOS_0.1; -SYMBOL_VERSION ILLUMOS_0.1 { # Illumos additions +SYMBOL_VERSION ILLUMOS_0.1 { # illumos additions global: - accept4; + accept4; } SUNW_1.7; SYMBOL_VERSION SUNW_1.7 { @@ -183,9 +185,9 @@ $endif getservbyport; getsockname; getsockopt; - inet_lnaof; - inet_makeaddr; - inet_network; + inet_lnaof { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_makeaddr { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_network { TYPE = FUNCTION; FILTER = libc.so.1 }; listen; recv; recvfrom; @@ -203,7 +205,7 @@ $endif SYMBOL_VERSION SUNWprivate_1.3 { global: - _accept4; + _accept4; _link_aton; _link_ntoa; _nss_initf_ethers; diff --git a/usr/src/lib/libvscan/Makefile.com b/usr/src/lib/libvscan/Makefile.com index 8d856c1182..1f43359369 100644 --- a/usr/src/lib/libvscan/Makefile.com +++ b/usr/src/lib/libvscan/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libvscan.a VERS= .1 @@ -39,7 +37,7 @@ $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) # Reset the Makefile.lib macro ROOTLIBDIR to refer to usr/lib/vscan ROOTLIBDIR = $(ROOT)/usr/lib/vscan -LDLIBS += -lc -lscf -lsecdb -lnsl -lm +LDLIBS += -lc -lscf -lsecdb -lm CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) diff --git a/usr/src/lib/libxnet/common/mapfile-vers b/usr/src/lib/libxnet/common/mapfile-vers index a284ae3311..d4816d2093 100644 --- a/usr/src/lib/libxnet/common/mapfile-vers +++ b/usr/src/lib/libxnet/common/mapfile-vers @@ -48,8 +48,8 @@ SYMBOL_VERSION SUNW_1.3.1 { freeaddrinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 }; getaddrinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 }; getnameinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 }; - inet_ntop { TYPE = FUNCTION; FILTER = libnsl.so.1 }; - inet_pton { TYPE = FUNCTION; FILTER = libnsl.so.1 }; + inet_ntop { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_pton { TYPE = FUNCTION; FILTER = libc.so.1 }; } SUNW_1.3; SYMBOL_VERSION SUNW_1.3 { @@ -144,13 +144,13 @@ SYMBOL_VERSION SUNW_1.1 { }; htonl { TYPE = FUNCTION; FILTER = libc.so.1 }; htons { TYPE = FUNCTION; FILTER = libc.so.1 }; - inet_addr { TYPE = FUNCTION; FILTER = libnsl.so.1 }; - inet_lnaof { TYPE = FUNCTION; FILTER = libsocket.so.1 }; - inet_makeaddr { TYPE = FUNCTION; FILTER = libsocket.so.1 }; - inet_netof { TYPE = FUNCTION; FILTER = libnsl.so.1 }; - inet_network { TYPE = FUNCTION; FILTER = libsocket.so.1 }; - inet_ntoa { TYPE = FUNCTION; FILTER = libnsl.so.1 }; - listen { TYPE = FUNCTION; FILTER = libsocket.so.1 }; + inet_addr { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_lnaof { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_makeaddr { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_netof { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_network { TYPE = FUNCTION; FILTER = libc.so.1 }; + inet_ntoa { TYPE = FUNCTION; FILTER = libc.so.1 }; + listen { TYPE = FUNCTION; FILTER = libsocket.so.1 }; ntohl { TYPE = FUNCTION; FILTER = libc.so.1 }; ntohs { TYPE = FUNCTION; FILTER = libc.so.1 }; recv { TYPE = FUNCTION; FILTER = libsocket.so.1 }; diff --git a/usr/src/lib/libzonecfg/Makefile.com b/usr/src/lib/libzonecfg/Makefile.com index 6bec7141cb..de53f975e3 100644 --- a/usr/src/lib/libzonecfg/Makefile.com +++ b/usr/src/lib/libzonecfg/Makefile.com @@ -32,7 +32,7 @@ OBJECTS= $(LIB_OBJS) $(XML_OBJS) include ../../Makefile.lib LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lc -lsocket -lnsl -luuid -lnvpair -lsysevent -lsec -lbrand \ +LDLIBS += -lc -lsocket -luuid -lnvpair -lsysevent -lsec -lbrand \ -lpool -lscf -lproc -luutil -lbsm -lsecdb # DYNLIB libraries do not have lint libs and are not linted $(DYNLIB) := LDLIBS += -lxml2 diff --git a/usr/src/lib/ncad_addr/Makefile.com b/usr/src/lib/ncad_addr/Makefile.com index f7c5994bba..a918a1a3a6 100644 --- a/usr/src/lib/ncad_addr/Makefile.com +++ b/usr/src/lib/ncad_addr/Makefile.com @@ -31,7 +31,7 @@ include ../../Makefile.lib SRCDIR = ../common LIBS = $(DYNLIB) -LDLIBS += -lc -lnsl +LDLIBS += -lc CFLAGS += $(CCVERBOSE) .KEEP_STATE: diff --git a/usr/src/lib/nsswitch/files/Makefile.com b/usr/src/lib/nsswitch/files/Makefile.com index 0d011e7807..1489badee6 100644 --- a/usr/src/lib/nsswitch/files/Makefile.com +++ b/usr/src/lib/nsswitch/files/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libnss_files.a VERS = .1 @@ -59,9 +57,9 @@ include ../../../Makefile.rootfs CPPFLAGS += -I../../../common/inc LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2 -LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2 +LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2 -LDLIBS += -lsocket -lnsl +LDLIBS += -lnsl DYNLIB1 = nss_files.so$(VERS) all: $(DYNLIB1) diff --git a/usr/src/lib/nsswitch/ldap/Makefile.com b/usr/src/lib/nsswitch/ldap/Makefile.com index 9876ccc0f2..694bd5f023 100644 --- a/usr/src/lib/nsswitch/ldap/Makefile.com +++ b/usr/src/lib/nsswitch/ldap/Makefile.com @@ -18,15 +18,10 @@ # # CDDL HEADER END - -# -# -#ident "%Z%%M% %I% %E% SMI" # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# lib/nsswitch/ldap/Makefile.com LIBRARY = libnss_ldap.a VERS = .1 @@ -61,7 +56,7 @@ OBJECTS = getauthattr.o \ include ../../Makefile.com CPPFLAGS += -I../../../libsldap/common -LDLIBS += -lsldap -lnsl -lsocket -lldap -LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2 -LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2 +LDLIBS += -lsldap -lnsl -lldap +LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2 +LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2 DYNLIB1 = nss_ldap.so$(VERS) diff --git a/usr/src/lib/nsswitch/mdns/Makefile.com b/usr/src/lib/nsswitch/mdns/Makefile.com index dcd10ade20..aa246a9f73 100644 --- a/usr/src/lib/nsswitch/mdns/Makefile.com +++ b/usr/src/lib/nsswitch/mdns/Makefile.com @@ -18,10 +18,11 @@ # # CDDL HEADER END # + +# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# lib/nsswitch/mdns/Makefile.com LIBRARY = libnss_mdns.a VERS = .1 @@ -33,8 +34,8 @@ OBJECTS = gethostent.o \ # include common nsswitch library definitions. include ../../Makefile.com -CSTD = $(CSTD_GNU99) -LDLIBS += -lnsl -ldns_sd -lscf +CSTD= $(CSTD_GNU99) +LDLIBS += -ldns_sd -lscf DYNLIB1 = nss_mdns.so$(VERS) -lint := LDLIBS = $(LDLIBS.lib) -lc -lnsl -lscf -ldns_sd +lint := LDLIBS = $(LDLIBS.lib) -lc -lscf -ldns_sd diff --git a/usr/src/lib/nsswitch/nis/Makefile.com b/usr/src/lib/nsswitch/nis/Makefile.com index 2b0180d0d2..cbccdfb764 100644 --- a/usr/src/lib/nsswitch/nis/Makefile.com +++ b/usr/src/lib/nsswitch/nis/Makefile.com @@ -22,9 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# lib/nsswitch/nis/Makefile.com LIBRARY = libnss_nis.a VERS = .1 @@ -60,5 +57,5 @@ include ../../../Makefile.rootfs LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2 LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2 -LDLIBS += -lnsl -lsocket +LDLIBS += -lnsl DYNLIB1 = nss_nis.so$(VERS) diff --git a/usr/src/man/man1m/route.1m b/usr/src/man/man1m/route.1m index 2ba5c932e6..2f2bff558a 100644 --- a/usr/src/man/man1m/route.1m +++ b/usr/src/man/man1m/route.1m @@ -392,7 +392,7 @@ mask can be specified. This can be specified in one of the following ways: .ie t \(bu .el o IP address following the gateway address . This is typically specified in -\fIdecimal dot\fR notation as for \fBinet_addr\fR(3SOCKET) rather than in +\fIdecimal dot\fR notation as for \fBinet_addr\fR(3C) rather than in symbolic form. .RE .RS +4 @@ -661,8 +661,8 @@ List of network names and addresses .LP \fBuname\fR(1), \fBin.ripngd\fR(1M), \fBin.routed\fR(1M), \fBnetstat\fR(1M), \fBrouted\fR(1M), \fBioctl\fR(2), \fBgetipnodebyname\fR(3SOCKET), -\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3SOCKET), \fBdefaultrouter\fR(4), -\fBhosts\fR(4), \fBnetworks\fR(4), \fBattributes\fR(5), \fBzones\fR(5), \fBARP\fR(7P), +\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3C), \fBdefaultrouter\fR(4), +\fBhosts\fR(4), \fBnetworks\fR(4), \fBattributes\fR(5), \fBARP\fR(7P), \fBip\fR(7P), \fBroute\fR(7P), \fBrouting\fR(7P) .SH DIAGNOSTICS .ne 2 diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index b3387a412f..af8d381e02 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -11,7 +11,7 @@ # # Copyright 2011, Richard Lowe -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2014 Garrett D'Amore <garrett@damore.org> # Copyright 2016 Joyent, Inc. @@ -210,6 +210,7 @@ MANFILES= __fbufsize.3c \ imaxabs.3c \ imaxdiv.3c \ index.3c \ + inet.3c \ initgroups.3c \ inotify_init.3c \ inotify_add_watch.3c \ @@ -887,6 +888,16 @@ MANLINKS= FD_CLR.3c \ htole16.3c \ htole32.3c \ htole64.3c \ + inet6.3c \ + inet_addr.3c \ + inet_aton.3c \ + inet_lnaof.3c \ + inet_makeaddr.3c \ + inet_netof.3c \ + inet_network.3c \ + inet_ntoa.3c \ + inet_ntop.3c \ + inet_pton.3c \ initstate.3c \ innetgr.3c \ isalnum.3c \ @@ -1881,6 +1892,17 @@ hdestroy.3c := LINKSRC = hsearch.3c rindex.3c := LINKSRC = index.3c +inet6.3c := LINKSRC = inet.3c +inet_addr.3c := LINKSRC = inet.3c +inet_aton.3c := LINKSRC = inet.3c +inet_lnaof.3c := LINKSRC = inet.3c +inet_makeaddr.3c := LINKSRC = inet.3c +inet_netof.3c := LINKSRC = inet.3c +inet_network.3c := LINKSRC = inet.3c +inet_ntoa.3c := LINKSRC = inet.3c +inet_ntop.3c := LINKSRC = inet.3c +inet_pton.3c := LINKSRC = inet.3c + remque.3c := LINKSRC = insque.3c finite.3c := LINKSRC = isnand.3c diff --git a/usr/src/man/man3c/inet.3c b/usr/src/man/man3c/inet.3c new file mode 100644 index 0000000000..3f0f87b3b0 --- /dev/null +++ b/usr/src/man/man3c/inet.3c @@ -0,0 +1,440 @@ +.\" +.\" The contents of this file are subject to the terms of the +.\" Common Development and Distribution License (the "License"). +.\" You may not use this file except in compliance with the License. +.\" +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +.\" or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions +.\" and limitations under the License. +.\" +.\" When distributing Covered Code, include this CDDL HEADER in each +.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. +.\" If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying +.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" +.\" +.\" Copyright 1989 AT&T +.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright 2018 Nexenta Systems, Inc. +.\" +.Dd July 22, 2018 +.Dt INET 3C +.Os +.Sh NAME +.Nm inet , +.Nm inet6 , +.Nm inet_ntop , +.Nm inet_pton , +.Nm inet_aton , +.Nm inet_addr , +.Nm inet_network , +.Nm inet_makeaddr , +.Nm inet_lnaof , +.Nm inet_netof , +.Nm inet_ntoa +.Nd Internet address manipulation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In netinet/in.h +.In arpa/inet.h +.Ft const char * +.Fo inet_ntop +.Fa "int af" +.Fa "const void *addr" +.Fa "char *cp" +.Fa "size_t size" +.Fc +.Ft int +.Fo inet_pton +.Fa "int af" +.Fa "const char *cp" +.Fa "void *addr" +.Fc +.Ft int +.Fo inet_aton +.Fa "const char *cp" +.Fa "struct in_addr *addr" +.Fc +.Ft in_addr_t +.Fo inet_addr +.Fa "const char *cp" +.Fc +.Ft in_addr_t +.Fo inet_network +.Fa "const char *cp" +.Fc +.Ft struct in_addr +.Fo inet_makeaddr +.Fa "const int net" +.Fa "const int lna" +.Fc +.Ft in_addr_t +.Fo inet_lnaof +.Fa "const struct in_addr in" +.Fc +.Ft in_addr_t +.Fo inet_netof +.Fa "const struct in_addr in" +.Fc +.Ft char * +.Fo inet_ntoa +.Fa "const struct in_addr in" +.Fc +.Sh DESCRIPTION +The +.Fn inet_ntop +and +.Fn inet_pton +functions can manipulate both IPv4 and IPv6 addresses. +The +.Fn inet_aton , +.Fn inet_addr , +.Fn inet_network , +.Fn inet_makeaddr , +.Fn inet_lnaof , +.Fn inet_netof , +and +.Fn inet_ntoa +functions can only manipulate IPv4 addresses. +.Pp +The +.Fn inet_ntop +function converts a numeric address into a string suitable for presentation. +The +.Fa af +argument specifies the family of the address which can be +.Dv AF_INET +or +.Dv AF_INET6 . +The +.Fa addr +argument points to a buffer that holds an IPv4 address if the +.Fa af +argument is +.Dv AF_INET . +The +.Fa addr +argument points to a buffer that holds an IPv6 address if the +.Fa af +argument is +.Dv AF_INET6 . +The address must be in network byte order. +The +.Fa cp +argument points to a buffer where the function stores the resulting string. +The application must specify a non-NULL +.Fa cp +argument. +The +.Fa size +argument specifies the size of this buffer. +For IPv6 addresses, the buffer must be at least 46-octets. +For IPv4 addresses, the buffer must be at least 16-octets. +To allow applications to easily declare buffers of the proper size to store IPv4 +and IPv6 addresses in string form, the following two constants are defined in +.In netinet/in.h : +.Bd -literal +#define INET_ADDRSTRLEN 16 +#define INET6_ADDRSTRLEN 46 +.Ed +.Pp +The +.Fn inet_pton +function converts the standard text presentation form of a function to the +numeric binary form. +The +.Fa af +argument specifies the family of the address. +Currently, the +.Dv AF_INET +and +.Dv AF_INET6 +address families are supported. +The +.Fa cp +argument points to the string being passed in. +The +.Fa addr +argument points to a buffer where the function stores the numeric address. +The calling application must ensure that the buffer referred to by +.Fa addr +is large enough to hold the numeric address, at least 4 bytes for +.Dv AF_INET +or 16 bytes for +.Dv AF_INET6 . +.Pp +The +.Fn inet_aton , +.Fn inet_addr , +and +.Fn inet_network +functions interpret character strings that represent numbers expressed in the +IPv4 standard +.Ql \&. +notation, returning numbers suitable for use as IPv4 addresses and IPv4 network +numbers, respectively. +The +.Fn inet_makeaddr +function uses an IPv4 network number and a local network address to construct +an IPv4 address. +The +.Fn inet_netof +and +.Fn inet_lnaof +functions break apart IPv4 host addresses, then return the network number and +local network address, respectively. +.Pp +The +.Fn inet_ntoa +function returns a pointer to a string in the base 256 notation +.Ql d.d.d.d . +See the following section on IPv4 addresses. +.Pp +Internet addresses are returned in network order, bytes ordered from left to +right. +Network numbers and local address parts are returned as machine format integer +values. +.Ss IPv6 Addresses +There are three conventional forms for representing IPv6 addresses as strings: +.Bl -enum +.It +The preferred form is +.Ql x:x:x:x:x:x:x:x , +where the +.Li x No 's +are the +hexadecimal values of the eight 16-bit pieces of the address. +For example, +.Ql 1080:0:0:0:8:800:200C:417A . +.Pp +It is not necessary to write the leading zeros in an individual field. +There must be at least one numeral in every field, except when the special +syntax described in the following is used. +.It +It is common for addresses to contain long strings of zero bits in some +methods used to allocate certain IPv6 address styles. +A special syntax is available to compress the zeros. +The use of +.Ql :: +indicates multiple groups of 16 bits of zeros. +The +.Ql :: +may only appear once in an address. +The +.Ql :: +can also be used to compress the leading and trailing zeros in an address. +For example, +.Ql 1080::8:800:200C:417A . +.It +The alternative form +.Ql x:x:x:x:x:x:d.d.d.d +is sometimes more convenient when dealing with a mixed environment of IPv4 and +IPv6 nodes. +The +.Li x No 's +in this form represent the hexadecimal values of the six high-order 16-bit +pieces of the address. +The +.Li d No 's +represent the decimal values of the four low-order 8-bit pieces of the standard +IPv4 address. +For example: +.Bd -literal +::FFFF:129.144.52.38 . +::129.144.52.38 +.Ed +.Pp +The +.Ql ::FFFF:d.d.d.d +and +.Ql ::d.d.d.d +pieces are the general forms of an IPv4-mapped IPv6 address and an +IPv4-compatible IPv6 address. +.Pp +The IPv4 portion must be in the +.Ql d.d.d.d +form. +The following forms are invalid: +.Bd -literal +::FFFF:d.d.d +::FFFF:d.d +::d.d.d +::d.d +.Ed +.Pp +The +.Ql ::FFFF:d +form is a valid but unconventional representation of the IPv4-compatible IPv6 +address +.Ql ::255.255.0.d . +.Pp +The +.Ql ::d +form corresponds to the general IPv6 address +.Ql 0:0:0:0:0:0:0:d . +.El +.Ss IPv4 Addresses +Values specified using +.Ql \&. +notation take one of the following forms: +.Bd -literal +d.d.d.d +d.d.d +d.d +d +.Ed +.Pp +When four parts are specified, each part is interpreted as a byte of data and +assigned from left to right to the four bytes of an IPv4 address. +.Pp +When a three-part address is specified, the last part is interpreted as a +16-bit quantity and placed in the right most two bytes of the network address. +The three part address format is convenient for specifying Class B network +addresses such as +.Ql 128.net.host . +.Pp +When a two-part address is supplied, the last part is interpreted as a 24-bit +quantity and placed in the right most three bytes of the network address. +The two part address format is convenient for specifying Class A network +addresses such as +.Ql net.host . +.Pp +When only one part is given, the value is stored directly in the network +address without any byte rearrangement. +.Pp +With the exception of +.Fn inet_pton , +numbers supplied as parts in +.Ql \&. +notation may be decimal, octal, or hexadecimal, as specified in C language. +For example, a leading +.Ql 0x +or +.Ql 0X +implies hexadecimal. +A leading +.Ql 0 +implies octal. +Otherwise, the number is interpreted as decimal. +.Pp +For IPv4 addresses, +.Fn inet_pton +accepts only a string in standard IPv4 dot notation +.Ql d.d.d.d . +.Pp +Each number has one to three digits with a decimal value between 0 and 255. +.Pp +The +.Fn inet_addr +function has been obsoleted by +.Fn inet_aton . +.Sh RETURN VALUES +The +.Fn inet_aton +function returns nonzero if the address is valid, +.Li 0 +if the address is invalid. +.Pp +The +.Fn inet_ntop +function returns a pointer to the buffer that contains a string if the +conversion succeeds. +Otherwise, +.Dv NULL +is returned. +Upon failure, +.Va errno +is set to +.Er EAFNOSUPPORT +if the +.Fa af +argument is invalid or +.Er ENOSPC +if the size of the result buffer is inadequate. +.Pp +The +.Fn inet_pton +function returns +.Li 1 +if the conversion succeeds, +.Li 0 +if the input is not a valid IPv4 dotted-decimal string or a valid IPv6 +address string. +The function returns +.Li -1 +with +.Va errno +set to +.Er EAFNOSUPPORT +if the +.Fa af +argument is unknown. +.Pp +The value +.Dv INADDR_NONE , +which is equivalent to +.Li (in_addr_t)(-1) , +is returned by +.Fn inet_addr +and +.Fn inet_network +for malformed requests. +.Pp +The functions +.Fn inet_netof +and +.Fn inet_lnaof +break apart IPv4 host addresses, returning the network number and local network +address part, respectively. +.Pp +The function +.Fn inet_ntoa +returns a pointer to a string in the base 256 notation +.Ql d.d.d.d , +described in the section on IPv4 addresses. +.Sh MT-LEVEL +.Sy Safe +.Sh INTERFACE STABILITY +The +.Fn inet_ntop , +.Fn inet_pton , +.Fn inet_aton , +.Fn inet_addr , +and +.Fn inet_network +functions are +.Sy Committed . +The +.Fn inet_lnaof , +.Fn inet_makeaddr , +.Fn inet_netof , +and +.Fn inet_network +functions are +.Sy Obsolete Committed . +.Sh SEE ALSO +.Xr inet.h 3HEAD , +.Xr gethostbyname 3NSL , +.Xr getipnodebyname 3SOCKET , +.Xr getnetbyname 3SOCKET , +.Xr hosts 4 , +.Xr networks 4 , +.Xr attributes 5 +.Sh NOTES +The return value from +.Fn inet_ntoa +points to a buffer which is overwritten on each call. +This buffer is implemented as thread-specific data in multithreaded +applications. +.Pp +IPv4-mapped addresses are not recommended. +.Sh BUGS +The problem of host byte ordering versus network byte ordering is confusing. +.Pp +A simple way to specify Class C network addresses in a manner similar to that +for Class B and Class A is needed. diff --git a/usr/src/man/man3head/inet.h.3head b/usr/src/man/man3head/inet.h.3head index 063b42d7ca..b0f2e257bd 100644 --- a/usr/src/man/man3head/inet.h.3head +++ b/usr/src/man/man3head/inet.h.3head @@ -53,7 +53,6 @@ inet.h, inet \- definitions for internet operations .fi .SH DESCRIPTION -.sp .LP The <\fBarpa/inet.h\fR> header defines the type \fBin_port_t\fR, the type \fBin_addr_t\fR, and the \fBin_addr\fR structure, as described in @@ -78,7 +77,6 @@ char *inet_ntoa(struct in_addr); .in -2 .SS "Default" -.sp .LP For applications that do not require standard-conforming behavior (those that use the socket interfaces described in section 3N of the reference manual; see @@ -95,7 +93,6 @@ uint16_t ntohs(uint16_t); .in -2 .SS "Standard conforming" -.sp .LP For applications that require standard-conforming behavior (those that use the socket interfaces described in section 3XN of the reference manual; see @@ -112,7 +109,6 @@ in_port_t ntohs(in_port_t); .in -2 .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -128,8 +124,7 @@ Interface Stability Standard .TE .SH SEE ALSO -.sp .LP -\fBIntro\fR(3), \fBhtonl\fR(3SOCKET), \fBhtonl\fR(3XNET), -\fBinet_addr\fR(3SOCKET), \fBinet_addr\fR(3XNET), \fBin.h\fR(3HEAD), +\fBIntro\fR(3), \fBhtonl\fR(3C), \fBhtonl\fR(3XNET), +\fBinet_addr\fR(3C), \fBinet_addr\fR(3XNET), \fBin.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5) diff --git a/usr/src/man/man3lib/libnsl.3lib b/usr/src/man/man3lib/libnsl.3lib index 4d257f2ad9..226446caa2 100644 --- a/usr/src/man/man3lib/libnsl.3lib +++ b/usr/src/man/man3lib/libnsl.3lib @@ -13,7 +13,6 @@ cc [ \fIflag\fR... ] \fIfile\fR... \fB-lnsl\fR [ \fIlibrary\fR... ] .fi .SH DESCRIPTION -.sp .LP Functions in this library provide routines that provide a transport-level interface to networking services for applications, facilities for @@ -27,7 +26,6 @@ example is the set of symbols beginning with the \fB_xti\fR prefix. Those symbols are used in implementing the X/Open Transport Interface (\fBXTI)\fR interfaces documented in \fBlibxnet\fR. See \fBlibxnet\fR(3LIB). .SH INTERFACES -.sp .LP The shared object \fBlibnsl.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object @@ -97,9 +95,6 @@ l l . \fBgetrpcent\fR \fBgetrpcent_r\fR \fBgetrpcport\fR \fBgetsecretkey\fR \fBh_errno\fR \fBhost2netname\fR -\fBinet_addr\fR \fBinet_netof\fR -\fBinet_ntoa\fR \fBinet_ntoa_r\fR -\fBinet_ntop\fR \fBinet_pton\fR \fBkey_decryptsession\fR \fBkey_encryptsession\fR \fBkey_gendes\fR \fBkey_secretkey_is_set\fR \fBkey_setsecret\fR \fBmaxbno\fR @@ -234,7 +229,7 @@ l l . \fByp_match\fR \fByp_next\fR \fByp_order\fR \fByp_unbind\fR \fByp_update\fR \fByperr_string\fR -\fBypprot_err\fR +\fBypprot_err\fR .TE .sp @@ -245,11 +240,10 @@ The following interface is unique to the 32-bit version of this library: .sp .TS l l . -\fB_new_svc_fdset\fR +\fB_new_svc_fdset\fR .TE .SH FILES -.sp .ne 2 .na \fB\fB/lib/libnsl.so.1\fR\fR @@ -268,7 +262,6 @@ shared object .RE .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -284,7 +277,6 @@ MT-Level Safe with exceptions .TE .SH SEE ALSO -.sp .LP \fBpvs\fR(1), \fBIntro\fR(2), \fBIntro\fR(3), \fBlibxnet\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3socket/Makefile b/usr/src/man/man3socket/Makefile index 5174020548..3422782a2a 100644 --- a/usr/src/man/man3socket/Makefile +++ b/usr/src/man/man3socket/Makefile @@ -11,15 +11,15 @@ # # Copyright 2011, Richard Lowe -# Copyright 2013 Nexenta Systems, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. # Copyright 2013, OmniTI Computer Consulting, Inc. # include $(SRC)/Makefile.master -MANSECT= 3socket +MANSECT= 3socket -MANFILES= accept.3socket \ +MANFILES= accept.3socket \ bind.3socket \ byteorder.3socket \ connect.3socket \ @@ -36,7 +36,6 @@ MANFILES= accept.3socket \ getsourcefilter.3socket \ icmp6_filter.3socket \ if_nametoindex.3socket \ - inet.3socket \ inet6_opt.3socket \ inet6_rth.3socket \ listen.3socket \ @@ -97,7 +96,6 @@ MANLINKS= accept4.3socket \ if_freenameindex.3socket \ if_indextoname.3socket \ if_nameindex.3socket \ - inet6.3socket \ inet6_opt_append.3socket \ inet6_opt_find.3socket \ inet6_opt_finish.3socket \ @@ -111,15 +109,6 @@ MANLINKS= accept4.3socket \ inet6_rth_reverse.3socket \ inet6_rth_segments.3socket \ inet6_rth_space.3socket \ - inet_addr.3socket \ - inet_aton.3socket \ - inet_lnaof.3socket \ - inet_makeaddr.3socket \ - inet_netof.3socket \ - inet_network.3socket \ - inet_ntoa.3socket \ - inet_ntop.3socket \ - inet_pton.3socket \ ntohl.3socket \ ntohll.3socket \ ntohs.3socket \ @@ -207,17 +196,6 @@ if_freenameindex.3socket := LINKSRC = if_nametoindex.3socket if_indextoname.3socket := LINKSRC = if_nametoindex.3socket if_nameindex.3socket := LINKSRC = if_nametoindex.3socket -inet6.3socket := LINKSRC = inet.3socket -inet_addr.3socket := LINKSRC = inet.3socket -inet_aton.3socket := LINKSRC = inet.3socket -inet_lnaof.3socket := LINKSRC = inet.3socket -inet_makeaddr.3socket := LINKSRC = inet.3socket -inet_netof.3socket := LINKSRC = inet.3socket -inet_network.3socket := LINKSRC = inet.3socket -inet_ntoa.3socket := LINKSRC = inet.3socket -inet_ntop.3socket := LINKSRC = inet.3socket -inet_pton.3socket := LINKSRC = inet.3socket - inet6_opt_append.3socket := LINKSRC = inet6_opt.3socket inet6_opt_find.3socket := LINKSRC = inet6_opt.3socket inet6_opt_finish.3socket := LINKSRC = inet6_opt.3socket diff --git a/usr/src/man/man3socket/getipnodebyname.3socket b/usr/src/man/man3socket/getipnodebyname.3socket index 9b68ea15ff..7eca1e3892 100644 --- a/usr/src/man/man3socket/getipnodebyname.3socket +++ b/usr/src/man/man3socket/getipnodebyname.3socket @@ -29,7 +29,6 @@ getipnodebyname, getipnodebyaddr, freehostent \- get IP node entry .fi .SH PARAMETERS -.sp .ne 2 .na \fB\fIaf\fR\fR @@ -93,7 +92,6 @@ Pointer to \fBhostent\fR structure .RE .SH DESCRIPTION -.sp .LP The \fBgetipnodebyname()\fR function searches the \fBipnodes\fR database from the beginning. The function finds the first \fBh_name\fR member that matches @@ -254,7 +252,7 @@ The special flags value, \fBAI_DEFAULT\fR, is defined as .LP The \fBgetipnodebyname()\fR function allows the \fIname\fR argument to be a node name or a literal address string: a dotted-decimal IPv4 address or an IPv6 -hex address. Applications do not have to call \fBinet_pton\fR(3SOCKET) to +hex address. Applications do not have to call \fBinet_pton\fR(3C) to handle literal address strings. .sp .LP @@ -310,7 +308,6 @@ terminated by a \fINULL\fR pointer. .RE .SH RETURN VALUES -.sp .LP Upon successful completion, \fBgetipnodebyname()\fR and \fBgetipnodebyaddr()\fR return a \fBhostent\fR structure. Otherwise they return \fINULL\fR. @@ -489,7 +486,6 @@ hostname. .in -2 .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -507,13 +503,11 @@ MT-Level Safe .TE .SH SEE ALSO -.sp .LP \fBgetaddrinfo\fR(3SOCKET), \fBgethostbyname\fR(3NSL), \fBhtonl\fR(3SOCKET), \fBinet\fR(3SOCKET), \fBnetdb.h\fR(3HEAD), \fBhosts\fR(4), \fBnsswitch.conf\fR(4), \fBattributes\fR(5) .SH NOTES -.sp .LP No enumeration functions are provided for IPv6. Existing enumeration functions such as \fBsethostent\fR(3NSL) do not work in combination with the @@ -544,6 +538,6 @@ addresses. The form for an address of type \fBAF_INET\fR is a \fBstruct in_addr\fR defined in <\fBnetinet/in.h\fR>. The form for an address of type \fBAF_INET6\fR is a \fBstruct in6_addr\fR, also defined in <\fBnetinet/in.h\fR>. The functions -described in \fBinet_ntop\fR(3SOCKET) and \fBinet_pton\fR(3SOCKET) that are +described in \fBinet_ntop\fR(3C) and \fBinet_pton\fR(3C) that are illustrated in the EXAMPLES section are helpful in constructing and manipulating addresses in either of these forms. diff --git a/usr/src/man/man3socket/inet.3socket b/usr/src/man/man3socket/inet.3socket deleted file mode 100644 index 818fb98fdd..0000000000 --- a/usr/src/man/man3socket/inet.3socket +++ /dev/null @@ -1,330 +0,0 @@ -'\" te -.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved -.\" Copyright 1989 AT&T -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. -.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH INET 3SOCKET "Nov 28, 2007" -.SH NAME -inet, inet6, inet_ntop, inet_pton, inet_aton, inet_addr, inet_network, -inet_makeaddr, inet_lnaof, inet_netof, inet_ntoa \- Internet address -manipulation -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR [ \fIlibrary\fR... ] -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -\fBconst char *\fR\fBinet_ntop\fR(\fBint\fR \fIaf\fR, \fBconst void *\fR\fIaddr\fR, \fBchar *\fR\fIcp\fR, - \fBsize_t\fR \fIsize\fR); -.fi - -.LP -.nf -\fBint\fR \fBinet_pton\fR(\fBint\fR \fIaf\fR, \fBconst char *\fR\fIcp\fR, \fBvoid *\fR\fIaddr\fR); -.fi - -.LP -.nf -\fBint\fR \fBinet_aton\fR(\fBconst char *\fR\fIcp\fR, \fBstruct in_addr *\fR\fIaddr\fR); -.fi - -.LP -.nf -\fBin_addr_t\fR \fBinet_addr\fR(\fBconst char *\fR\fIcp\fR); -.fi - -.LP -.nf -\fBin_addr_t\fR \fBinet_network\fR(\fBconst char *\fR\fIcp\fR); -.fi - -.LP -.nf -\fBstruct in_addr\fR \fBinet_makeaddr\fR(\fBconst int\fR \fInet\fR, \fBconst int\fR \fIlna\fR); -.fi - -.LP -.nf -\fBint\fR \fBinet_lnaof\fR(\fBconst struct in_addr\fR \fIin\fR); -.fi - -.LP -.nf -\fBint\fR \fBinet_netof\fR(\fBconst struct in_addr\fR \fIin\fR); -.fi - -.LP -.nf -\fBchar *\fR\fBinet_ntoa\fR(\fBconst struct in_addr\fR \fIin\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBinet_ntop()\fR and \fBinet_pton()\fR functions can manipulate both IPv4 -and IPv6 addresses. The \fBinet_aton()\fR, \fBinet_addr()\fR, -\fBinet_network()\fR, \fBinet_makeaddr()\fR, \fBinet_lnaof()\fR, -\fBinet_netof()\fR, and \fBinet_ntoa()\fR functions can only manipulate IPv4 -addresses. -.sp -.LP -The \fBinet_ntop()\fR function converts a numeric address into a string -suitable for presentation. The \fIaf\fR argument specifies the family of the -address which can be \fBAF_INET\fR or \fBAF_INET6\fR. The \fIaddr\fR argument -points to a buffer that holds an IPv4 address if the \fIaf\fR argument is -\fBAF_INET\fR. The \fIaddr\fR argument points to a buffer that holds an IPv6 -address if the \fIaf\fR argument is \fBAF_INET6\fR. The address must be in -network byte order. The \fIcp\fR argument points to a buffer where the function -stores the resulting string. The application must specify a non-\fINULL\fR -\fIcp\fR argument. The \fIsize\fR argument specifies the size of this buffer. -For IPv6 addresses, the buffer must be at least 46-octets. For IPv4 addresses, -the buffer must be at least 16-octets. To allow applications to easily declare -buffers of the proper size to store IPv4 and IPv6 addresses in string form, the -following two constants are defined in <\fBnetinet/in.h\fR>: -.sp -.in +2 -.nf -#define INET_ADDRSTRLEN 16 -#define INET6_ADDRSTRLEN 46 -.fi -.in -2 - -.sp -.LP -The \fBinet_pton()\fR function converts the standard text presentation form of -a function to the numeric binary form. The \fIaf\fR argument specifies the -family of the address. Currently, the \fBAF_INET\fR and \fBAF_INET6\fR address -families are supported. The \fIcp\fR argument points to the string being passed -in. The \fIaddr\fR argument points to a buffer where the function stores the -numeric address. The calling application must ensure that the buffer referred -to by \fIaddr\fR is large enough to hold the numeric address, at least 4 bytes -for \fBAF_INET\fR or 16 bytes for \fBAF_INET6\fR. -.sp -.LP -The \fBinet_aton()\fR, \fBinet_addr()\fR, and \fBinet_network()\fR functions -interpret character strings that represent numbers expressed in the IPv4 -standard '\fB\&.\fR' notation, returning numbers suitable for use as IPv4 -addresses and IPv4 network numbers, respectively. The \fBinet_makeaddr()\fR -function uses an IPv4 network number and a local network address to construct -an IPv4 address. The \fBinet_netof()\fR and \fBinet_lnaof()\fR functions break -apart IPv4 host addresses, then return the network number and local network -address, respectively. -.sp -.LP -The \fBinet_ntoa()\fR function returns a pointer to a string in the base 256 -notation \fBd.d.d.d\fR. See the following section on IPv4 addresses. -.sp -.LP -Internet addresses are returned in network order, bytes ordered from left to -right. Network numbers and local address parts are returned as machine format -integer values. -.SS "IPv6 Addresses" -.sp -.LP -There are three conventional forms for representing IPv6 addresses as strings: -.RS +4 -.TP -1. -The preferred form is \fBx:x:x:x:x:x:x:x\fR, where the 'x's are the -hexadecimal values of the eight 16-bit pieces of the address. For example: -.sp -.in +2 -.nf -1080:0:0:0:8:800:200C:417A -.fi -.in -2 - -It is not necessary to write the leading zeros in an individual field. There -must be at least one numeral in every field, except when the special syntax -described in the following is used. -.RE -.RS +4 -.TP -2. -It is common for addresses to contain long strings of zero bits in some -methods used to allocate certain IPv6 address styles. A special syntax is -available to compress the zeros. The use of "\fB::\fR" indicates multiple -groups of 16 bits of zeros. The \fB::\fR may only appear once in an address. -The \fB::\fR can also be used to compress the leading and trailing zeros in an -address. For example: -.sp -.in +2 -.nf -1080::8:800:200C:417A -.fi -.in -2 - -.RE -.RS +4 -.TP -3. -The alternative form \fBx:x:x:x:x:x:d.d.d.d\fR is sometimes more convenient -when dealing with a mixed environment of IPv4 and IPv6 nodes. The \fBx\fR's in -this form represent the hexadecimal values of the six high-order 16-bit pieces -of the address. The \fBd\fR's represent the decimal values of the four -low-order 8-bit pieces of the standard IPv4 address. For example: -.sp -.in +2 -.nf -::FFFF:129.144.52.38 -::129.144.52.38 -.fi -.in -2 - -The \fB::FFFF:d.d.d.d\fR and \fB::d.d.d.d\fR pieces are the general forms of an -IPv4-mapped IPv6 address and an IPv4-compatible IPv6 address. -.sp -The IPv4 portion must be in the \fBd.d.d.d\fR form. The following forms are -invalid: -.sp -.in +2 -.nf -::FFFF:d.d.d -::FFFF:d.d -::d.d.d -::d.d -.fi -.in -2 - -The \fB::FFFF:d\fR form is a valid but unconventional representation of the -IPv4-compatible IPv6 address \fB::255.255.0.d\fR. -.sp -The \fB::d\fR form corresponds to the general IPv6 address -\fB0:0:0:0:0:0:0:d\fR. -.RE -.SS "IPv4 Addresses" -.sp -.LP -Values specified using `\fB\&.\fR' notation take one of the following forms: -.sp -.in +2 -.nf -d.d.d.d -d.d.d -d.d -d -.fi -.in -2 - -.sp -.LP -When four parts are specified, each part is interpreted as a byte of data and -assigned from left to right to the four bytes of an IPv4 address. -.sp -.LP -When a three-part address is specified, the last part is interpreted as a -16-bit quantity and placed in the right most two bytes of the network address. -The three part address format is convenient for specifying Class B network -addresses such as \fB128.net.host\fR. -.sp -.LP -When a two-part address is supplied, the last part is interpreted as a 24-bit -quantity and placed in the right most three bytes of the network address. The -two part address format is convenient for specifying Class A network addresses -such as \fBnet.host\fR. -.sp -.LP -When only one part is given, the value is stored directly in the network -address without any byte rearrangement. -.sp -.LP -With the exception of \fBinet_pton()\fR, numbers supplied as \fIparts\fR -in '\fB\&.\fR' notation may be decimal, octal, or hexadecimal, as specified in C -language. For example, a leading \fB0x\fR or \fB0X\fR implies hexadecimal. A -leading \fB0\fR implies octal. Otherwise, the number is interpreted as decimal. -.sp -.LP -For IPv4 addresses, \fBinet_pton()\fR accepts only a string in standard IPv4 -dot notation: -.sp -.in +2 -.nf -d.d.d.d -.fi -.in -2 - -.sp -.LP -Each number has one to three digits with a decimal value between 0 and 255. -.sp -.LP -The \fBinet_addr()\fR function has been obsoleted by \fBinet_aton()\fR. -.SH RETURN VALUES -.sp -.LP -The \fBinet_aton()\fR function returns nonzero if the address is valid, \fB0\fR -if the address is invalid. -.sp -.LP -The \fBinet_ntop()\fR function returns a pointer to the buffer that contains a -string if the conversion succeeds. Otherwise, \fINULL\fR is returned. Upon -failure, \fIerrno\fR is set to \fBEAFNOSUPPORT\fR if the \fIaf\fR argument is -invalid or \fBENOSPC\fR if the size of the result buffer is inadequate. -.sp -.LP -The \fBinet_pton()\fR function returns \fB1\fR if the conversion succeeds, -\fB0\fR if the input is not a valid IPv4 dotted-decimal string or a valid IPv6 -address string. The function returns \fB-1\fR with \fIerrno\fR set to -\fBEAFNOSUPPORT\fR if the af argument is unknown. -.sp -.LP -The value \fBINADDR_NONE\fR, which is equivalent to \fB(in_addr_t)(-1)\fR, is -returned by \fBinet_addr()\fR and \fBinet_network()\fR for malformed requests. -.sp -.LP -The functions \fBinet_netof()\fR and \fBinet_lnaof()\fR break apart IPv4 host -addresses, returning the network number and local network address part, -respectively. -.sp -.LP -The function \fBinet_ntoa()\fR returns a pointer to a string in the base 256 -notation \fBd.d.d.d\fR, described in the section on IPv4 addresses. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability See below. -_ -MT-Level Safe -.TE - -.sp -.LP -The \fBinet_ntop()\fR, \fBinet_pton()\fR, \fBinet_aton()\fR, \fBinet_addr()\fR, -and \fBinet_network()\fR functions are Committed. The \fBinet_lnaof()\fR, -\fBinet_makeaddr()\fR, \fBinet_netof()\fR, and \fBinet_network()\fR functions -are Committed (Obsolete). -.SH SEE ALSO -.sp -.LP -\fBgethostbyname\fR(3NSL), \fBgetipnodebyname\fR(3SOCKET), -\fBgetnetbyname\fR(3SOCKET), \fBinet.h\fR(3HEAD), \fBhosts\fR(4), -\fBnetworks\fR(4), \fBattributes\fR(5) -.SH NOTES -.sp -.LP -The return value from \fBinet_ntoa()\fR points to a buffer which is overwritten -on each call. This buffer is implemented as thread-specific data in -multithreaded applications. -.sp -.LP -IPv4-mapped addresses are not recommended. -.SH BUGS -.sp -.LP -The problem of host byte ordering versus network byte ordering is confusing. A -simple way to specify Class C network addresses in a manner similar to that for -Class B and Class A is needed. diff --git a/usr/src/man/man3socket/sockaddr.3socket b/usr/src/man/man3socket/sockaddr.3socket index 372721f461..740b80e4dd 100644 --- a/usr/src/man/man3socket/sockaddr.3socket +++ b/usr/src/man/man3socket/sockaddr.3socket @@ -206,7 +206,7 @@ The member is the four byte IPv4 address. It is also stored in network byte order. The common way to write out the address is to use the function -.Xr inet_pton 3SOCKET +.Xr inet_pton 3C which converts between a human readable IP address such as "10.1.2.3" and the corresponding representation. .Lp @@ -271,7 +271,7 @@ The member .Em sin6_addr describes the 16-byte IPv6 address. In addition to the function -.Xr inet_pton 3SOCKET , +.Xr inet_pton 3C , the header file .In netinet/in.h defines many macros for manipulating and testing IPv6 addresses. diff --git a/usr/src/man/man4/ncaport.conf.4 b/usr/src/man/man4/ncaport.conf.4 index be865fb174..1c85142dd9 100644 --- a/usr/src/man/man4/ncaport.conf.4 +++ b/usr/src/man/man4/ncaport.conf.4 @@ -13,14 +13,13 @@ ncaport.conf \- ncaport configuration file .fi .SH DESCRIPTION -.sp .LP The \fBncaport.conf\fR file is used to configure the IP addresses and ports that the Solaris Network Cache and Acceleration (NCA) kernel module services. The file contains two fields, key and value, in the format of \fBncaport=\fIipaddress\fR/\fIport\fR\fR. IPv4 addresses must be in the dot notation \fId\fR.\fId\fR.\fId\fR.\fId\fR. IPv6 addresses must be in one of the -three conventional forms (see \fBinet_pton\fR(3SOCKET)). If an asterisk +three conventional forms (see \fBinet_pton\fR(3C)). If an asterisk (\fB*\fR) is used for an IP address, it is interpreted as \fBINADDR_ANY\fR, which matches any IP address. .sp @@ -54,12 +53,10 @@ ncaport=*/9000 .sp .SH SEE ALSO -.sp .LP -\fBnca\fR(1), \fBbind\fR(3SOCKET), \fBinet_pton\fR(3SOCKET), +\fBnca\fR(1), \fBbind\fR(3SOCKET), \fBinet_pton\fR(3C), \fBncad_addr\fR(4), \fBattributes\fR(5) .SH NOTES -.sp .LP For those web servers that use \fBAF_NCA\fR sockets, the NCA port configuration described here has no effect. diff --git a/usr/src/pkg/manifests/system-library.man3c.inc b/usr/src/pkg/manifests/system-library.man3c.inc index ce84471c6a..f5a26a2072 100644 --- a/usr/src/pkg/manifests/system-library.man3c.inc +++ b/usr/src/pkg/manifests/system-library.man3c.inc @@ -11,7 +11,7 @@ # # Copyright 2011, Richard Lowe -# Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018 Nexenta Systems, Inc. # Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2014 Garrett D'Amore <garrett@damore.org> # @@ -205,6 +205,7 @@ file path=usr/share/man/man3c/iconv_open.3c file path=usr/share/man/man3c/imaxabs.3c file path=usr/share/man/man3c/imaxdiv.3c file path=usr/share/man/man3c/index.3c +file path=usr/share/man/man3c/inet.3c file path=usr/share/man/man3c/initgroups.3c file path=usr/share/man/man3c/insque.3c file path=usr/share/man/man3c/is_system_labeled.3c @@ -884,6 +885,16 @@ link path=usr/share/man/man3c/htobe64.3c target=endian.3c link path=usr/share/man/man3c/htole16.3c target=endian.3c link path=usr/share/man/man3c/htole32.3c target=endian.3c link path=usr/share/man/man3c/htole64.3c target=endian.3c +link path=usr/share/man/man3c/inet6.3c target=inet.3c +link path=usr/share/man/man3c/inet_addr.3c target=inet.3c +link path=usr/share/man/man3c/inet_aton.3c target=inet.3c +link path=usr/share/man/man3c/inet_lnaof.3c target=inet.3c +link path=usr/share/man/man3c/inet_makeaddr.3c target=inet.3c +link path=usr/share/man/man3c/inet_netof.3c target=inet.3c +link path=usr/share/man/man3c/inet_network.3c target=inet.3c +link path=usr/share/man/man3c/inet_ntoa.3c target=inet.3c +link path=usr/share/man/man3c/inet_ntop.3c target=inet.3c +link path=usr/share/man/man3c/inet_pton.3c target=inet.3c link path=usr/share/man/man3c/initstate.3c target=random.3c link path=usr/share/man/man3c/innetgr.3c target=getnetgrent.3c link path=usr/share/man/man3c/isalnum.3c target=ctype.3c diff --git a/usr/src/pkg/manifests/system-library.man3socket.inc b/usr/src/pkg/manifests/system-library.man3socket.inc index 6b1ea6641b..20a32905cb 100644 --- a/usr/src/pkg/manifests/system-library.man3socket.inc +++ b/usr/src/pkg/manifests/system-library.man3socket.inc @@ -11,7 +11,7 @@ # # Copyright 2011, Richard Lowe -# Copyright 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. # Copyright 2013, OmniTI Computer Consulting, Inc. # @@ -32,7 +32,6 @@ file path=usr/share/man/man3socket/getsockopt.3socket file path=usr/share/man/man3socket/getsourcefilter.3socket file path=usr/share/man/man3socket/icmp6_filter.3socket file path=usr/share/man/man3socket/if_nametoindex.3socket -file path=usr/share/man/man3socket/inet.3socket file path=usr/share/man/man3socket/inet6_opt.3socket file path=usr/share/man/man3socket/inet6_rth.3socket file path=usr/share/man/man3socket/listen.3socket @@ -120,7 +119,6 @@ link path=usr/share/man/man3socket/if_indextoname.3socket \ target=if_nametoindex.3socket link path=usr/share/man/man3socket/if_nameindex.3socket \ target=if_nametoindex.3socket -link path=usr/share/man/man3socket/inet6.3socket target=inet.3socket link path=usr/share/man/man3socket/inet6_opt_append.3socket \ target=inet6_opt.3socket link path=usr/share/man/man3socket/inet6_opt_find.3socket \ @@ -147,15 +145,6 @@ link path=usr/share/man/man3socket/inet6_rth_segments.3socket \ target=inet6_rth.3socket link path=usr/share/man/man3socket/inet6_rth_space.3socket \ target=inet6_rth.3socket -link path=usr/share/man/man3socket/inet_addr.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_aton.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_lnaof.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_makeaddr.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_netof.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_network.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_ntoa.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_ntop.3socket target=inet.3socket -link path=usr/share/man/man3socket/inet_pton.3socket target=inet.3socket link path=usr/share/man/man3socket/ntohl.3socket target=byteorder.3socket link path=usr/share/man/man3socket/ntohll.3socket target=byteorder.3socket link path=usr/share/man/man3socket/ntohs.3socket target=byteorder.3socket diff --git a/usr/src/uts/common/io/ixgbe/core/ixgbe_82599.c b/usr/src/uts/common/io/ixgbe/core/ixgbe_82599.c index 109ed95544..92fdcb7045 100644 --- a/usr/src/uts/common/io/ixgbe/core/ixgbe_82599.c +++ b/usr/src/uts/common/io/ixgbe/core/ixgbe_82599.c @@ -1740,6 +1740,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, case 0x0000: /* mask VLAN ID, fall through to mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANID; + /* FALLTHROUGH */ case 0x0FFF: /* mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANP; @@ -2013,6 +2014,7 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, DEBUGOUT(" Error on src/dst port\n"); return IXGBE_ERR_CONFIG; } + /* FALLTHROUGH */ case IXGBE_ATR_FLOW_TYPE_TCPV4: case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4: case IXGBE_ATR_FLOW_TYPE_UDPV4: diff --git a/usr/src/uts/common/io/ixgbe/core/ixgbe_common.c b/usr/src/uts/common/io/ixgbe/core/ixgbe_common.c index 0c403486c2..656534862c 100644 --- a/usr/src/uts/common/io/ixgbe/core/ixgbe_common.c +++ b/usr/src/uts/common/io/ixgbe/core/ixgbe_common.c @@ -250,7 +250,8 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - /* only backplane uses autoc so fall though */ + /* only backplane uses autoc */ + /* FALLTHROUGH */ case ixgbe_media_type_fiber_fixed: case ixgbe_media_type_fiber_qsfp: case ixgbe_media_type_fiber: @@ -4543,7 +4544,8 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb, u32 headroom, rxpktsize <<= IXGBE_RXPBSIZE_SHIFT; for (; i < (num_pb / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); - /* Fall through to configure remaining packet buffers */ + /* Configure remaining packet buffers. */ + /* FALLTHROUGH */ case PBA_STRATEGY_EQUAL: rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; for (; i < num_pb; i++) diff --git a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore.h b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore.h index 1434c81cd1..a8e3034a58 100644 --- a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore.h +++ b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore.h @@ -111,7 +111,7 @@ enum ecore_nvm_cmd { #define SET_FIELD(value, name, flag) \ do { \ - (value) &= ~(name##_MASK << name##_SHIFT); \ + (value) &= ~((u64)name##_MASK << (u64)name##_SHIFT); \ (value) |= ((((u64)flag) & (u64)name##_MASK) << (name##_SHIFT));\ } while (0) @@ -124,10 +124,11 @@ do { \ #define ECORE_MFW_SET_FIELD(name, field, value) \ do { \ - (name) &= ~((field ## _MASK) << (field ## _SHIFT)); \ + (name) &= ~(((u64)field ## _MASK) << ((u64)field ## _SHIFT)); \ (name) |= (((value) << (field ## _SHIFT)) & (field ## _MASK)); \ } while (0) + static OSAL_INLINE u32 DB_ADDR(u32 cid, u32 DEMS) { u32 db_addr = FIELD_VALUE(DB_LEGACY_ADDR_DEMS, DEMS) | diff --git a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_cxt.c b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_cxt.c index 49c96990bd..54a9170b10 100644 --- a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_cxt.c +++ b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_cxt.c @@ -2225,13 +2225,12 @@ enum _ecore_status_t ecore_cxt_set_pf_params(struct ecore_hwfn *p_hwfn, case ECORE_PCI_ETH_RDMA: case ECORE_PCI_ETH_IWARP: case ECORE_PCI_ETH_ROCE: - { ecore_rdma_set_pf_params(p_hwfn, &p_hwfn->pf_params.rdma_pf_params, rdma_tasks); /* no need for break since RoCE coexist with Ethernet */ - } + /* FALLTHROUGH */ case ECORE_PCI_ETH: { struct ecore_eth_pf_params *p_params = diff --git a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dbg_fw_funcs.c b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dbg_fw_funcs.c index 383deaa32e..62c6a7ada4 100644 --- a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dbg_fw_funcs.c +++ b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dbg_fw_funcs.c @@ -5444,12 +5444,13 @@ enum dbg_status ecore_dbg_bus_add_constraint(struct ecore_hwfn *p_hwfn, if (!data_mask) return DBG_STATUS_INVALID_ARGS; - for (lsb = 0; lsb < 32 && !(data_mask & 1); lsb++, data_mask >>= 1); - for (width = 0; - width < 32 - lsb && (data_mask & 1); - width++, data_mask >>= 1); - if (data_mask) - return DBG_STATUS_INVALID_ARGS; + for (lsb = 0; lsb < 32 && !(data_mask & 1); lsb++) + data_mask >>= 1; + + for (width = 0; width < 32 - lsb && (data_mask & 1); width++) + data_mask >>= 1; + if (data_mask) + return DBG_STATUS_INVALID_ARGS; range = (lsb << 5) | (width - 1); } diff --git a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dev.c b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dev.c index 9c769f3e71..f8f7d1a396 100644 --- a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dev.c +++ b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_dev.c @@ -2218,13 +2218,13 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev, p_hwfn->hw_info.hw_mode); if (rc != ECORE_SUCCESS) break; - /* Fall into */ + /* FALLTHROUGH */ case FW_MSG_CODE_DRV_LOAD_PORT: rc = ecore_hw_init_port(p_hwfn, p_hwfn->p_main_ptt, p_hwfn->hw_info.hw_mode); if (rc != ECORE_SUCCESS) break; - /* Fall into */ + /* FALLTHROUGH */ case FW_MSG_CODE_DRV_LOAD_FUNCTION: rc = ecore_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt, p_params->p_tunn, diff --git a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c index de48000d32..ea80dc31da 100644 --- a/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c +++ b/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c @@ -142,7 +142,7 @@ static u16 task_region_offsets[1][E4_NUM_OF_CONNECTION_TYPES] = { #define QM_STOP_CMD_STRUCT_SIZE 2 #define QM_STOP_CMD_PAUSE_MASK_OFFSET 0 #define QM_STOP_CMD_PAUSE_MASK_SHIFT 0 -#define QM_STOP_CMD_PAUSE_MASK_MASK -1 +#define QM_STOP_CMD_PAUSE_MASK_MASK UINT_MAX #define QM_STOP_CMD_GROUP_ID_OFFSET 1 #define QM_STOP_CMD_GROUP_ID_SHIFT 16 #define QM_STOP_CMD_GROUP_ID_MASK 15 diff --git a/usr/src/uts/common/io/qede/qede_fp.c b/usr/src/uts/common/io/qede/qede_fp.c index 6148b486b4..fe7cb7a6cd 100644 --- a/usr/src/uts/common/io/qede/qede_fp.c +++ b/usr/src/uts/common/io/qede/qede_fp.c @@ -493,7 +493,7 @@ qede_reg_jumbo_cqe(qede_rx_ring_t *rx_ring, int i; qede_rx_buffer_t *rx_buf, *rx_buffer[ETH_RX_MAX_BUFF_PER_PKT]; mblk_t *mp = NULL, *head = NULL, *tail = NULL; - uint32_t free_buffer_count; + uint32_t free_buffer_count = 0; uint16_t work_length; uint32_t rx_buf_size = rx_ring->rx_buf_size, bd_len; qede_dma_info_t *dma_info; diff --git a/usr/src/uts/common/io/qede/qede_version.h b/usr/src/uts/common/io/qede/qede_version.h index 59ac6cdd65..54678600c9 100644 --- a/usr/src/uts/common/io/qede/qede_version.h +++ b/usr/src/uts/common/io/qede/qede_version.h @@ -38,7 +38,7 @@ #define _QEDE_VERSION_H #define MAJVERSION 8 -#define MINVERSION 0 +#define MINVERSION 1 #define REVVERSION 23 #endif /* !_QEDE_VERSION_H */ |