components/network/isc-dhcp/Makefile
@@ -18,66 +18,58 @@ # # CDDL HEADER END # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2019, Michal Nowak # include ../../../make-rules/shared-macros.mk COMPONENT_NAME= isc-dhcp COMPONENT_VERSION= 4.3.6-P1 IPS_COMPONENT_VERSION= 4.3.6.1 COMPONENT_VERSION= 4.4.1 IPS_COMPONENT_VERSION= 4.4.1.0.0 COMPONENT_FMRI= service/network/dhcp/isc-dhcp COMPONENT_SUMMARY= ISC DHCP Server and Relay Agent COMPONENT_CLASSIFICATION=System/Services COMPONENT_CLASSIFICATION= System/Services COMPONENT_SRC_NAME= dhcp COMPONENT_SRC= $(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION) COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz COMPONENT_PROJECT_URL= http://www.isc.org/software/dhcp/ COMPONENT_PROJECT_URL= https://www.isc.org/software/dhcp/ COMPONENT_ARCHIVE_URL= \ http://ftp.isc.org/isc/dhcp/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) http://ftp.isc.org/isc/dhcp/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) COMPONENT_ARCHIVE_HASH= \ sha256:2fd177bef02856f05fe17713ced9bfcc7d94f14c933c15f2f2fbedc9cc57a3c3 COMPONENT_BUGDB= service/dhcp-server sha256:2a22508922ab367b4af4664a0472dc220cc9603482cf3c16d9aff14f3a76b608 COMPONENT_LICENSE= MPL v2.0 COMPONENT_LICENSE_FILE= LICENSE include $(WS_MAKE_RULES)/prep.mk include $(WS_MAKE_RULES)/configure.mk include $(WS_MAKE_RULES)/ips.mk # Parallel build fails LDFLAGS += -lnsl -lsocket # Parallel build fails in bind COMPONENT_BUILD_ARGS = CONFIGURE_SCRIPT = $(@D)/configure COMPONENT_PRE_CONFIGURE_ACTION+= $(CP) -R $(SOURCE_DIR)/* $(@D)/ CFLAGS+= -std=gnu89 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ COMPONENT_PRE_CONFIGURE_ACTION = \ ($(CLONEY) $(SOURCE_DIR) $(@D)) CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)/inet CONFIGURE_OPTIONS += --sbindir=$(USRLIBDIR)/inet CONFIGURE_OPTIONS += --bindir=$(USRSBINDIR) CONFIGURE_OPTIONS += --enable-use-sockets CONFIGURE_OPTIONS += --enable-ipv4-pktinfo # Disable message in omapip/errwarn.c. CPPFLAGS += -DNOMINUM CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" LDFLAGS += -lnsl -lsocket # ISC dhcp contains bind tarball. As it is configured in build stage # we have to pass CFLAGS and LDFLAGS to its configure at build time. COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)" COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS)" COMPONENT_TEST_DIR = $(@D) CONFIGURE_OPTIONS += --srcdir=$(BUILD_DIR_$(BITS)) build: $(BUILD_64) install: build $(INSTALL_64) $(PROTO_DIR)/dhcpd.leases test: $(TEST_64) $(PROTO_DIR)/dhcpd.leases: $(INSTALL_64) $(TOUCH) $@ # We don't ship ATF/Kyua test: $(NO_TESTS) # Auto-generated dependencies REQUIRED_PACKAGES += SUNWcs REQUIRED_PACKAGES += system/library components/network/isc-dhcp/dhcp.p5m
@@ -27,22 +27,26 @@ set name=info.source-url value=$(COMPONENT_ARCHIVE_URL) set name=org.opensolaris.consolidation value=$(CONSOLIDATION) license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)' # # # isc-dhcp lease database directory with mode 0755 to allow isc-dhcp # start method to create empty lease files if needed and is world # readable to allow any user scripts to parse the lease db files. dir path=var/db/isc-dhcp group=netadm mode=0755 owner=dhcpserv file dhcp_auths path=etc/security/auth_attr.d/service%2Fnetwork%2Fisc-dhcp file isc-dhcp-relay.xml path=lib/svc/manifest/network/dhcp/isc-dhcp-relay.xml \ file files/dhcp_auths path=etc/security/auth_attr.d/service%2Fnetwork%2Fisc-dhcp file files/isc-dhcp-relay.xml path=lib/svc/manifest/network/dhcp/isc-dhcp-relay.xml \ group=sys mode=0444 file isc-dhcp-server.xml \ file files/isc-dhcp-server.xml \ path=lib/svc/manifest/network/dhcp/isc-dhcp-server.xml group=sys \ mode=0444 file isc-dhcp path=lib/svc/method/isc-dhcp mode=0555 file SmfDHCPStates.html path=usr/lib/help/auths/locale/SmfDHCPStates.html file SmfValueDHCP.html path=usr/lib/help/auths/locale/SmfValueDHCP.html file files/isc-dhcp.sh path=lib/svc/method/isc-dhcp mode=0555 file files/SmfDHCPStates.html path=usr/lib/help/auths/locale/SmfDHCPStates.html file files/SmfValueDHCP.html path=usr/lib/help/auths/locale/SmfValueDHCP.html file files/isc-dhcp.5 path=usr/share/man/man5/isc-dhcp.5 file path=etc/inet/dhcpd.conf.example group=sys file path=usr/lib/inet/dhcpd file path=usr/lib/inet/dhcrelay file path=usr/sbin/omshell @@ -51,7 +55,6 @@ file path=usr/share/man/man5/dhcp-options.5 file path=usr/share/man/man5/dhcpd.conf.5 file path=usr/share/man/man5/dhcpd.leases.5 file isc-dhcp.5 path=usr/share/man/man5/isc-dhcp.5 file path=usr/share/man/man8/dhcpd.8 file path=usr/share/man/man8/dhcrelay.8 file dhcpd.leases path=var/db/isc-dhcp/dhcpd4.leases group=netadm mode=0644 \ @@ -62,7 +65,7 @@ owner=dhcpserv preserve=true file dhcpd.leases path=var/db/isc-dhcp/dhcpd6.leases~ group=netadm mode=0644 \ owner=dhcpserv preserve=true license isc-dhcp.license license="ISC BSD" user username=dhcpserv ftpuser=false gcos-field="DHCP Configuration Admin" \ group=netadm uid=18 depend fmri=__TBD pkg.debug.depend.file=lib/svc/share/net_include.sh \ components/network/isc-dhcp/files/SmfDHCPStates.html
components/network/isc-dhcp/files/SmfValueDHCP.html
components/network/isc-dhcp/files/dhcp_auths
components/network/isc-dhcp/files/isc-dhcp-relay.xml
File was renamed from components/network/isc-dhcp/isc-dhcp-relay.xml @@ -28,7 +28,7 @@ Service manifest for the ISC DHCP Relay service. --> <!-- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. --> <service_bundle type='manifest' name='isc-dhcp:relay'> @@ -69,7 +69,7 @@ <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'/> <exec_method type='method' name='refresh' exec=':kill -HUP' <exec_method type='method' name='refresh' exec=':true' timeout_seconds='60'/> <property_group name='firewall_context' type='com.sun,fw_definition'> components/network/isc-dhcp/files/isc-dhcp-server.xml
File was renamed from components/network/isc-dhcp/isc-dhcp-server.xml @@ -28,7 +28,7 @@ Service manifest for the ISC DHCP Server service. --> <!-- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. --> <service_bundle type='manifest' name='isc-dhcp:server'> @@ -70,7 +70,7 @@ <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'/> <exec_method type='method' name='refresh' exec=':kill -HUP' <exec_method type='method' name='refresh' exec=':true' timeout_seconds='60'/> <property_group name='firewall_context' type='com.sun,fw_definition'> @@ -96,6 +96,8 @@ <instance name='ipv4' enabled='false'> <property_group name='config' type='application'> <propval name='debug' type='boolean' value='false'/> <propval name='omapi_conn_limit' type='integer' value='200'/> <propval name='config_file' type='astring' value='/etc/inet/dhcpd4.conf'/> <propval name='lease_file' type='astring' @@ -113,6 +115,8 @@ <instance name='ipv6' enabled='false'> <property_group name='config' type='application'> <propval name='debug' type='boolean' value='false'/> <propval name='omapi_conn_limit' type='integer' value='200'/> <propval name='config_file' type='astring' value='/etc/inet/dhcpd6.conf'/> <propval name='lease_file' type='astring' components/network/isc-dhcp/files/isc-dhcp.5
New file @@ -0,0 +1,308 @@ '\" te .\" Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. .TH isc-dhcp 5 "28 Feb 2018" "Oracle Solaris 11.4" .SH NAME isc\-dhcp \- ISC Dynamic Host Configuration Protocol Software .SH DESCRIPTION .LP The Internet Systems Consortium (ISC) DHCP Server (dhcpd) implements the Dynamic Host Configuration Protocol (DHCPv4 and DHCPv6), and the Internet Bootstrap Protocol (BOOTP). DHCP allows hosts on a TCP/IP network to request and be assigned IP addresses, and also to discover information about the network to which they are attached. BOOTP provides similar functionality, with certain restrictions. .LP ISC Relay Agent (dhcrelay) provides a means for relaying DHCP and BOOTP requests from a subnet to which no DHCP server is directly connected to one or more DHCP servers on other subnets. .LP The services above (dhcpd and dhcrelay) are managed using the Service Management Facility (SMF) on Solaris, and should be administered by the \fIsvcadm\fP(1M) command using the following fault management resource identifiers (FMRIs): .LP .in +2 .nf svc:/network/dhcp/server:ipv4 svc:/network/dhcp/server:ipv6 svc:/network/dhcp/relay:ipv4 svc:/network/dhcp/relay:ipv6 .fi .LP After making property changes to the above FMRIs it is necessary to refresh the service and restart as appropriate for the changes to take effect. .LP The following dhcpd service configuration properties can be viewed with \fIsvcprop\fP(1) and modified via \fIsvccfg\fP(1M): .sp .ne 2 .mk .na \fBdebug\fR\ =\ \fIboolean:\fR\ false .ad .sp .6 .RS 4n Send log messages from the DHCP daemon to the standard error descriptor. Setting this property to true ensures the \fI-d\fR command-line option is used when starting dhcpd. This property is set to false by default. .RE .sp .ne 2 .mk .na \fBconfig_file\fR\ =\ astring: \fIpath\fR .ad .sp .6 .RS 4n Path to alternate configuration file. The value of this property is passed as an argument to the \fI-cf\fR command-line option of dhcpd. The default is set to /etc/inet/dhcpd6.conf and /etc/inet/dhcpd4.conf for DHCP v6 and v4 servers respectively. .RE .sp .ne 2 .mk .na \fBlease_file\fR\ =\ astring:\ \fIpath\fR .ad .sp .6 .RS 4n Path to alternate lease file. The value of this property is passed as an argument to the \fI-lf\fR command-line option of dhcpd. The default value is set to /var/db/isc-dhcp/v4.leases for DHCPv4 and /var/db/isc-dhcp/v6.leases for DHCPv6. .RE .sp .ne 2 .mk .na \fBlisten_ifnames\fR\ =\ astring:\ \fI()\fR .ad .sp .6 .RS 4n An optional property to specify one or more network interfaces on which dhcpd should serve DHCP requests. The property values are appended to the dhcpd command-line. Care must be taken when setting this property to multiple interfaces as it is a list-of-string-values, and not a single comma separated string. .sp See Example 4. .RE .sp .ne 2 .mk .na \fBomapi_conn_limit\fR\ =\ \fIinteger:\fR 200 .ad .sp .6 .RS 4n Value used to limit the number of failover and control connections accepted by the server - the default is 200. Only positive integer values are permissible; a value of 0 means there is no limit. .sp See Example 5. .LP NOTE: This property will be removed in the event ISC removes the underlying functionality. The ISC recommends that customers implement one or more of the workarounds documented in ISC's Knowledge Base article \fB\fIAA-01354\fR (\fIhttps://kb.isc.org/article/AA-01354\fP). .RE .LP The following dhcrelay options are available as service configuration properties and can be viewed with \fIsvcprop\fP(1) and modified via \fIsvccfg\fP(8): .sp .ne 2 .mk .na \fBappend_agent_option\fR\ =\ \fIboolean:\fR false (v4 only) .ad .sp .6 .RS 4n Setting this option to true ensures the DHCP relay appends an agent option field to each request before forwarding the request to the DHCP server. When this property is set to true, the \fI-a\fR command-line option is used when launching dhcrelay. The default value of this property is false. This option is only applicable to the svc:/network/dhcp/relay:ipv4 service. .RE .sp .ne 2 .mk .na \fBlisten_ifnames\fR\ =\ astring:\ \fI()\fR (v4 only) .ad .sp .6 .RS 4n This property is used to specify one or more interfaces on which the DHCP relay should listen for DHCPv4/BOOTP queries. The property value is passed as the argument for, one or more, \fI-i\fR command-line option(s) of the dhcrelay program. Care must be taken when setting this property to multiple interfaces as it is a list-of-string-values, and not a single comma separated string. This option is only applicable to the svc:/network/dhcp/relay:ipv4 service. .sp See Examples section for how to set list-of-string-values. .RE .sp .ne 2 .mk .na \fBservers\fR\ =\ astring:\ \fI()\fR (v4 only) .ad .sp .6 .RS 4n This property must be set to the IP addresses of one or more servers before enabling the relay service (svc:/network/dhcp/relay:ipv4). Care must be taken when setting this property to multiple values as it is a list-of-string-values, and not a single comma separated string. This option is only applicable to the svc:/network/dhcp/relay:ipv4 service. .RE .sp .ne 2 .mk .na \fBreceive_query_links\fR\ =\ astring:\ \fI()\fR (v6 only) .ad .sp .6 .RS 4n This property must be set to specify the interface(s) on which queries will be received from clients or from other relay agents before enabling the relay service (svc:/network/dhcp/relay:ipv6). The property value is passed as the argument for, one or more, \fI-l\fR command-line option(s) to the dhcrelay program. Care must be taken when setting this property to multiple interfaces as it is a list-of-string-values, and not a single comma separated string. This option is only applicable to the svc:/network/dhcp/relay:ipv6 service. .sp See Example 3. .RE .sp .ne 2 .mk .na \fBforward_query_links\fR\ =\ astring:\ \fI()\fR (v6 only) .ad .sp .6 .RS 4n This property must be set to specify the interface(s) on which queries from clients and other relay agents should be forwarded before enabling the relay service (svc:/network/dhcp/relay:ipv6). The property value is passed as the argument for, one or more, \fI-u\fR command-line option(s) to the dhcrelay program. Care must be taken when setting this property to multiple interfaces as it is a list-of-string-values, and not a single comma separated string. This option is only applicable to the svc:/network/dhcp/relay:ipv6 service. .RE .LP Since dhcpd and dhcrelay are managed using SMF no pid files are created. .SH EXAMPLES .LP In the following examples, property changes have been made on the command-line where often it is necessary to use the shell escape character (\\) to pass-in values correctly. An alternative option is to use svccfg's \fBeditprop\fR feature to edit the values in an editor, where escaping is then not necessary. For example, the shell-escaped value of \fB\\(\\"10.0.0.1%e10000g#0\\"\\"bge0\\"\\"iprb#1\\"\\)\fR can be entered as \fB("10.0.0.1%e10000g#0" "bge0" "iprb#1")\fR. Refer to \fIsvccfg\fP(8) for further details. .LP \fBExample\ 1\fR Enabling DHCPv4 Server. .sp ISC DHCPv4 server service is disabled by default. The following command enables the ISC DHCPv4 service: .sp .in +2 .nf example# \fBsvcadm enable svc:/network/dhcp/server:ipv4\fR .fi .in -2 .LP \fBExample\ 2\fR Displaying the configurable properties of DHCPv6 Relay Agent service. .sp The following command displays all configurable properties of DHCPv6 Relay Agent Service: .sp .in +2 .nf example# \fBsvccfg -s dhcp/relay:ipv6 listprop config\fR config application config/forward_query_links astring config/listen_ifnames astring config/receive_query_links astring config/value_authorization astring solaris.smf.value.dhcp .fi .in -2 .LP \fBExample\ 3\fR Setting the receive_query_links property value of DHCPv6 Relay Agent service. .sp The following commands will set the receive_query_links property value, for which the service will append to the dhcrelay command-line "\fI-l 10.0.0.1%e10000g#0 -l bge0 -l iprb#1\fR". .sp .in +2 .nf example# \fBsvccfg -s dhcp/relay:ipv6 setprop \\\fR \fBconfig/receive_query_links= \\\fR \fB\\(\\"10.0.0.1%e10000g#0\\"\\"bge0\\"\\"iprb#1\\"\\)\fR example# \fBsvccfg -s dhcp/relay:ipv6 refresh\fR NOTE: spaces are not allowed in the string within quotes in the setprop command. To verify that the property values are set execute either the svccfg command or the svcprop command as given below: example# \fBsvccfg -s dhcp/relay:ipv6 listprop config/receive_query_links\fR config/receive_query_links astring "10.0.0.1%e10000g#0" "bge0" "iprb#1" example# \fBsvcprop -p config/receive_query_links dhcp/relay:ipv6\fR 10.0.0.1%e10000g#0 bge0 iprb#1 .fi .in -2 .LP \fBExample\ 4\fR Setting the listen_ifnames property value for dhcpd. The following commands will set the listen_ifnames property to \fIbge0\fR and \fIbge1\fR and then display the updated values. .sp .in +2 .nf example# \fBsvccfg -s dhcp/server:ipv4 setprop \\\fR \fBconfig/listen_ifnames = \\(\\"bge0\\"\\"bge1\\"\\)\fR example# \fBsvccfg -s dhcp/server:ipv4 refresh\fR NOTE: spaces are not allowed in the string within quotes in the setprop command. To verify that the property values are set type: example# \fBsvccfg -s dhcp/server:ipv4 listprop config/listen_ifnames\fR config/listen_ifnames astring "bge0" "bge1" .fi .in -2 .LP \fBExample\ 5\fR Limiting the number of failover and control connections in dhcpd to 1000 and restarting the service so that the modified property comes into effect. .sp .in +2 .nf example# \fBsvccfg -s dhcp/server:ipv4 setprop config/omapi_conn_limit = 1000\fR example# \fBsvccfg -s dhcp/server:ipv4 refresh\fR example# \fBsvcadm restart dhcp/server:ipv4\fR .fi .in -2 .SH SEE ALSO .LP .[ svccfg(8), svcprop(1), svcadm(8), dhcpd(8), dhcrelay(8) .] components/network/isc-dhcp/files/isc-dhcp.sh
File was renamed from components/network/isc-dhcp/isc-dhcp @@ -21,7 +21,7 @@ # # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # . /lib/svc/share/smf_include.sh @@ -29,7 +29,9 @@ SVCPROP=/usr/bin/svcprop CHMOD=/usr/bin/chmod CHOWN=/usr/bin/chown TOUCH=/usr/bin/touch ID=/usr/bin/id DHCPD_IPV4="svc:/network/dhcp/server:ipv4" DHCPD_IPV6="svc:/network/dhcp/server:ipv6" @@ -148,9 +150,17 @@ errlog "No lease_file specified, exiting" return 1 fi LEASEFILE_PERMS="u=rw,go=r" if [ ! -f "$LEASEFILE" ]; then $TOUCH $LEASEFILE $CHMOD u=rw,go=r $LEASEFILE $CHMOD $LEASEFILE_PERMS $LEASEFILE fi if [ ! -w "$LEASEFILE" ]; then errlog "Lease file '$LEASEFILE' is not writable. You should:" errlog "$CHOWN $($ID -u -n) '$LEASEFILE'" errlog "$CHMOD $LEASEFILE_PERMS '$LEASEFILE'" return 1 fi export OPTIONS="$OPTIONS -cf $CONFIGFILE -lf $LEASEFILE $LISTENIFNAMES" @@ -226,6 +236,9 @@ case "$SMF_FMRI" in "$DHCPD_IPV4"|"$DHCPD_IPV6") # get omapi_conn_limit property value. export OMAPI_CONN_LIMIT=`get_prop omapi_conn_limit` get_common_options if [ "$?" != "0" ]; then exit $SMF_EXIT_ERR_CONFIG components/network/isc-dhcp/isc-dhcp.5
File was deleted components/network/isc-dhcp/isc-dhcp.license
File was deleted components/network/isc-dhcp/manifests/sample-manifest.p5m
@@ -10,7 +10,7 @@ # # # Copyright 2017 <contributor> # Copyright 2018 <contributor> # set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) @@ -26,7 +26,6 @@ file path=etc/inet/dhclient.conf.example file path=etc/inet/dhcpd.conf.example file path=usr/include/dhcpctl/dhcpctl.h file path=usr/include/isc-dhcp/dst.h file path=usr/include/omapip/alloc.h file path=usr/include/omapip/buffer.h file path=usr/include/omapip/convert.h @@ -36,6 +35,7 @@ file path=usr/include/omapip/omapip_p.h file path=usr/include/omapip/result.h file path=usr/include/omapip/trace.h file path=usr/lib/$(MACH64)/libdhcp.a file path=usr/lib/$(MACH64)/libdhcpctl.a file path=usr/lib/$(MACH64)/libomapi.a file path=usr/lib/inet/dhclient components/network/isc-dhcp/patches/002-dhcp_broadcast_offer_bug.patch
New file @@ -0,0 +1,179 @@ This patch file was developed in-house to fix a Solaris specific bug. We are working with upstream, but it is unclear at this point whether or not they are going to accept it. This is a highly visible bug which many customers have encountered. diff -r 1680283c6725 common/socket.c --- a/common/socket.c Tue Jan 16 13:35:26 2018 -0800 +++ b/common/socket.c Tue Jan 16 17:55:37 2018 -0800 @@ -39,6 +39,9 @@ #include <sys/ioctl.h> #include <sys/uio.h> #include <sys/uio.h> +#if defined (sun) +#include <sys/ethernet.h> +#endif #if defined(sun) && defined(USE_V4_PKTINFO) #include <sys/sysmacros.h> @@ -87,6 +90,33 @@ static int once = 0; #endif /* !defined(SO_BINDTODEVICE) && !defined(USE_FALLBACK) */ +#if defined (sun) +int +setup_arp(struct interface_info *interface, struct in_addr ip_addr, + unsigned char *macaddr) +{ + struct xarpreq ar; + struct sockaddr_in *sin; + + (void) memset(&ar, 0, sizeof (ar)); + sin = (struct sockaddr_in *)&ar.xarp_pa; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = ip_addr.s_addr; + + ar.xarp_ha.sdl_alen = ETHERADDRL; + (void) memcpy(LLADDR(&ar.xarp_ha), macaddr, ar.xarp_ha.sdl_alen); + ar.xarp_ha.sdl_family = AF_LINK; + if (ioctl(interface->set_arp_socket, SIOCSXARP, (caddr_t)&ar) < 0) { + log_error("setup_arp: ioctl error for IP %s MAC %s", + inet_ntoa(ip_addr), ether_ntoa((const struct ether_addr *) + macaddr)); + return (1); + } + return (0); +} +#endif + + /* Reinitializes the specified interface after an address change. This is not required for packet-filter APIs. */ @@ -340,6 +370,9 @@ #else info->wfdesc = info->rfdesc; #endif +#if defined(sun) + info->set_arp_socket = socket(AF_INET, SOCK_DGRAM, 0); +#endif if (!quiet_interface_discovery) log_info ("Sending on Socket/%s%s%s", info->name, @@ -356,6 +389,9 @@ close (info -> wfdesc); #endif info -> wfdesc = -1; +#if defined (sun) + close (info -> set_arp_socket); +#endif if (!quiet_interface_discovery) log_info ("Disabling output on Socket/%s%s%s", @@ -1091,7 +1127,11 @@ int can_unicast_without_arp (ip) struct interface_info *ip; { +#if defined (sun) + return 1; +#else return 0; +#endif } int can_receive_unicast_unconfigured (ip) diff -r 1680283c6725 includes/dhcpd.h --- a/includes/dhcpd.h Tue Jan 16 13:35:26 2018 -0800 +++ b/includes/dhcpd.h Tue Jan 16 17:55:37 2018 -0800 @@ -1378,6 +1378,9 @@ int configured; /* If set to 1, interface has at least * one valid IP address. */ +#if defined (sun) + int set_arp_socket; /* IOCTL socket to set entry in cache */ +#endif u_int32_t flags; /* Control flags... */ #define INTERFACE_REQUESTED 1 #define INTERFACE_AUTOMATIC 2 @@ -2608,6 +2611,10 @@ struct sockaddr_in6 *, struct hardware *); #endif +#if defined (sun) +int setup_arp(struct interface_info *, struct in_addr, unsigned char *); +#endif + #ifdef USE_SOCKET_SEND void if_reinitialize_send (struct interface_info *); void if_register_send (struct interface_info *); diff -r 1680283c6725 relay/dhcrelay.c --- a/relay/dhcrelay.c Tue Jan 16 13:35:26 2018 -0800 +++ b/relay/dhcrelay.c Tue Jan 16 17:55:37 2018 -0800 @@ -759,6 +759,13 @@ to.sin_addr = packet->yiaddr; to.sin_port = remote_port; +#if defined (sun) + if (setup_arp(out, packet->yiaddr, packet->chaddr)) { + log_error("do_relay4 : Set arp entry failed"); + return; + } +#endif + /* and hardware address is not broadcast */ htop = &hto; } else { diff -r 1680283c6725 server/bootp.c --- a/server/bootp.c Tue Jan 16 13:35:26 2018 -0800 +++ b/server/bootp.c Tue Jan 16 17:55:37 2018 -0800 @@ -437,7 +437,12 @@ can_unicast_without_arp (packet -> interface)) { to.sin_addr = raw.yiaddr; to.sin_port = remote_port; - +#if defined (__sun) + if (setup_arp(packet->interface, raw.yiaddr, raw.chaddr)) { + log_error("bootp : Set arp entry failed"); + goto out; + } +#endif /* Otherwise, broadcast it on the local network. */ } else { to.sin_addr = limited_broadcast; diff -r 1680283c6725 server/dhcp.c --- a/server/dhcp.c Tue Jan 16 13:35:26 2018 -0800 +++ b/server/dhcp.c Tue Jan 16 17:55:37 2018 -0800 @@ -30,6 +30,8 @@ #include <errno.h> #include <limits.h> #include <sys/time.h> +#include <sys/sockio.h> +#include <sys/ioccom.h> static void maybe_return_agent_options(struct packet *packet, struct option_state *options); @@ -3991,7 +3993,12 @@ can_unicast_without_arp (state -> ip)) { to.sin_addr = raw.yiaddr; to.sin_port = remote_port; - +#if defined (sun) + if (setup_arp(state->ip, raw.yiaddr, raw.chaddr)) { + log_error("dhcp_reply : Set arp entry failed"); + goto err_out; + } +#endif /* Otherwise, broadcast it on the local network. */ } else { to.sin_addr = limited_broadcast; @@ -4013,7 +4020,9 @@ /* Free all of the entries in the option_state structure now that we're done with them. */ - +#if defined (sun) +err_out: +#endif free_lease_state (state, MDL); lease -> state = (struct lease_state *)0; } components/network/isc-dhcp/patches/003-Manage_41845.patch
New file @@ -0,0 +1,97 @@ This patch adds a method to manage the resource limit which was introduced by the fix for ISC-Bugs #41845. This patch was developed in-house. ISC did not express any interest in incorporating this patch into their code since they consider the limit to be a mitigating solution. diff -r 1680283c6725 includes/omapip/omapip.h --- a/includes/omapip/omapip.h Tue Jan 16 13:35:26 2018 -0800 +++ b/includes/omapip/omapip.h Tue Jan 16 18:01:14 2018 -0800 @@ -467,6 +467,9 @@ extern omapi_object_type_t *omapi_object_types; +#if defined (sun) +void omapi_set_max_fd_value (void); +#endif void omapi_type_relinquish (void); isc_result_t omapi_init (void); isc_result_t omapi_object_type_register (omapi_object_type_t **, diff -r 1680283c6725 omapip/listener.c --- a/omapip/listener.c Tue Jan 16 13:35:26 2018 -0800 +++ b/omapip/listener.c Tue Jan 16 18:01:14 2018 -0800 @@ -40,6 +40,10 @@ trace_type_t *trace_listener_accept; #endif +#if defined (sun) +static int conn_limit = MAX_FD_VALUE; /* max number of open sockets allowed */ +#endif + OMAPI_OBJECT_ALLOC (omapi_listener, omapi_listener_object_t, omapi_type_listener) @@ -209,6 +213,35 @@ return l -> socket; } +#if defined (sun) +/* If OMAPI_CONN_LIMIT environment variable is set, obtain value. */ +const char *fname = "omapi_set_max_fd_value"; +void omapi_set_max_fd_value (void) +{ + const char *env; + char *end = NULL; + int envval = conn_limit; + + env = getenv("OMAPI_CONN_LIMIT"); + if (env != NULL) { + errno = 0; + envval = (int)strtol(env, &end, 10); + if (errno != 0 || env == end || *end != '\0' || envval < 0) { + (void) log_error("%s: \"%s\" is not a valid connection " + "limit value\n", fname, env); + errno = 0; + } else { + conn_limit = envval; + } + } + (void) log_debug("%s: conn_limit = %d%s\n", fname, conn_limit, + (conn_limit == MAX_FD_VALUE) ? " (default)" : + (conn_limit == 0) ? " (unlimited)" : ""); + + return; +} +#endif + /* Reader callback for a listener object. Accept an incoming connection. */ isc_result_t omapi_accept (omapi_object_t *h) { @@ -233,7 +266,13 @@ return ISC_R_UNEXPECTED; } +#if !defined (sun) if ((MAX_FD_VALUE != 0) && (socket > MAX_FD_VALUE)) { +#else + if ((conn_limit != 0) && (socket > conn_limit)) { + (void) log_debug("omapi_accept: No more available " + "sockets - closing latest.\n"); +#endif close(socket); return (ISC_R_NORESOURCES); } diff -r 1680283c6725 server/dhcpd.c --- a/server/dhcpd.c Tue Jan 16 13:35:26 2018 -0800 +++ b/server/dhcpd.c Tue Jan 16 18:01:14 2018 -0800 @@ -452,6 +452,10 @@ path_dhcpd_conf = s; } +#if defined (sun) + omapi_set_max_fd_value (); +#endif + #ifdef DHCPv6 if (local_family == AF_INET6) { /* DHCPv6: override DHCPv4 lease and pid filenames */