diff options
| author | Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> | 2021-08-04 15:22:53 +0200 |
|---|---|---|
| committer | Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> | 2021-11-22 12:30:03 +0100 |
| commit | a73be61a80f7331c35adfa540bcf8f1546ff1e33 (patch) | |
| tree | c0c72232c78479d3333c9ec6efdc60f0e75f6784 /usr/src/cmd/svc | |
| parent | f81209f5137586c57e31f7d74b929149299d9b3c (diff) | |
| download | illumos-joyent-a73be61a80f7331c35adfa540bcf8f1546ff1e33.tar.gz | |
2554 ipadm needs IPMP configuration support
Contributed by: Ivan Krivonos <ivan.krivonos@nexenta.com>
Contributed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Yuri Pankov <ypankov@tintri.com>
Reviewed by: Andy Fiddaman <andyf@omnios.com>
Reviewed by: Ryan Goodfellow <ryan.goodfellow@oxide.computer>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/cmd/svc')
| -rw-r--r-- | usr/src/cmd/svc/milestone/net-init | 16 | ||||
| -rw-r--r-- | usr/src/cmd/svc/milestone/net-physical | 42 |
2 files changed, 33 insertions, 25 deletions
diff --git a/usr/src/cmd/svc/milestone/net-init b/usr/src/cmd/svc/milestone/net-init index ad2ff3d963..ea59624007 100644 --- a/usr/src/cmd/svc/milestone/net-init +++ b/usr/src/cmd/svc/milestone/net-init @@ -23,6 +23,8 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2021 Tintri by DDN, Inc. All rights reserved. +# # This is the second phase of TCP/IP configuration. The first part is # run by the svc:/network/physical service and includes configuring the # interfaces and setting the machine's hostname. The svc:/network/initial @@ -38,8 +40,8 @@ # # In a shared-IP zone we need this service to be up, but all of the work -# it tries to do is irrelevant (and will actually lead to the service -# failing if we try to do it), so just bail out. +# it tries to do is irrelevant (and will actually lead to the service +# failing if we try to do it), so just bail out. # In the global zone and exclusive-IP zones we proceed. # smf_configure_ip || exit $SMF_EXIT_OK @@ -50,16 +52,6 @@ if [ -f /etc/inet/ipaddrsel.conf ]; then fi # -# If explicit IPMP groups are being used, in.mpathd will already be started. -# However, if TRACK_INTERFACES_ONLY_WITH_GROUPS=no and no explicit IPMP -# groups have been configured, then it still needs to be started. So, fire -# it up in "adopt" mode; if there are no interfaces it needs to manage, it -# will automatically exit. -# -/usr/bin/pgrep -x -u 0 -z `smf_zonename` in.mpathd >/dev/null 2>&1 || \ - /usr/lib/inet/in.mpathd -a - -# # Set the RFC 1948 entropy, regardless of if I'm using it or not. If present, # use the encrypted root password as a source of entropy. Otherwise, # just use the pre-set (and hopefully difficult to guess) entropy that diff --git a/usr/src/cmd/svc/milestone/net-physical b/usr/src/cmd/svc/milestone/net-physical index 89784dcbbc..2d7d76d9b0 100644 --- a/usr/src/cmd/svc/milestone/net-physical +++ b/usr/src/cmd/svc/milestone/net-physical @@ -19,12 +19,13 @@ # # CDDL HEADER END # -# -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012 Milan Jurik. All rights reserved. + # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T. # All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012 Milan Jurik. All rights reserved. +# Copyright 2021 Tintri by DDN, Inc. All rights reserved. # . /lib/svc/share/smf_include.sh @@ -32,8 +33,8 @@ # # In a shared-IP zone we need this service to be up, but all of the work -# it tries to do is irrelevant (and will actually lead to the service -# failing if we try to do it), so just bail out. +# it tries to do is irrelevant (and will actually lead to the service +# failing if we try to do it), so just bail out. # In the global zone and exclusive-IP zones we proceed. # smf_configure_ip || exit $SMF_EXIT_OK @@ -50,14 +51,14 @@ if smf_is_globalzone; then # Update PVID on interfaces configured with VLAN 1 update_pvid - # + # # Upgrade handling. The upgrade file consists of a series of dladm(1M) # commands. Note that after we are done, we cannot rename the upgrade # script file as the file system is still read-only at this point. # Defer this to the manifest-import service. # upgrade_script=/var/svc/profile/upgrade_datalink - if [ -f "${upgrade_script}" ]; then + if [ -f "${upgrade_script}" ]; then . "${upgrade_script}" fi @@ -230,11 +231,11 @@ fi if [ -n "$ipmp_list" ]; then set -- $ipmp_list while [ $# -gt 0 ]; do - if /sbin/ifconfig $1 ipmp; then + if /sbin/ifconfig $1 ipmp; then ipmp_created="$ipmp_created $1" else ipmp_failed="$ipmp_failed $1" - fi + fi shift done [ -n "$ipmp_failed" ] && warn_failed_ifs "create IPv4 IPMP" \ @@ -296,11 +297,11 @@ fi if [ -n "$ipmp6_list" ]; then set -- $ipmp6_list while [ $# -gt 0 ]; do - if /sbin/ifconfig $1 inet6 ipmp; then + if /sbin/ifconfig $1 inet6 ipmp; then ipmp6_created="$ipmp6_created $1" else ipmp6_failed="$ipmp6_failed $1" - fi + fi shift done [ -n "$ipmp6_failed" ] && warn_failed_ifs "create IPv6 IPMP" \ @@ -308,6 +309,21 @@ if [ -n "$ipmp6_list" ]; then fi # +# Upgrade ipadm.conf. +# +if /usr/bin/grep -q _family /etc/ipadm/ipadm.conf; then + oldifs=$(/usr/bin/sed -En \ + 's/^_ifname=([a-z0-9]+);_family=[0-9]+;$/\1/p' \ + /etc/ipadm/ipadm.conf | /usr/bin/sort -u) + /usr/bin/sed -i '/_family/d' /etc/ipadm/ipadm.conf + for oldif in $oldifs; do + /usr/bin/printf \ + "_ifname=%s;_ifclass=0;_families=2,26;\n" \ + $oldif >> /etc/ipadm/ipadm.conf + done +fi + +# # Finally configure interfaces set up with ipadm. Any /etc/hostname*.intf # files take precedence over ipadm defined configurations except when # we are in a non-global zone and Layer-3 protection of IP addresses is @@ -333,7 +349,7 @@ for showif_output in `/sbin/ipadm show-if -p -o ifname,state,current`; do "ignoring ipadm configuration" > /dev/msglog continue; else - echo "Ignoring /etc/hostname*.$intf" > /dev/msglog + echo "Ignoring /etc/hostname*.$intf" > /dev/msglog /sbin/ifconfig $intf unplumb > /dev/null 2>&1 /sbin/ifconfig $intf inet6 unplumb > /dev/null 2>&1 fi @@ -524,7 +540,7 @@ fi # Any non-loopback IPv4 interfaces with usable addresses up? if [ -n "`/sbin/ifconfig -a4u`" ]; then - /sbin/ifconfig -a4u | while read intf addr rest; do + /sbin/ifconfig -a4u | while read intf addr rest; do [ $intf = inet ] && [ $addr != 127.0.0.1 ] && [ $addr != 0.0.0.0 ] && exit $SMF_EXIT_OK done && exit $SMF_EXIT_OK |
