Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/overlay/generic/usr/lib/brand/jcommon/statechange b/overlay/generic/usr/lib/brand/jcommon/statechange
- index e2a10f0c..07bdb9a0 100644
- --- a/overlay/generic/usr/lib/brand/jcommon/statechange
- +++ b/overlay/generic/usr/lib/brand/jcommon/statechange
- @@ -56,6 +56,7 @@ cmd=$5
- VNDADM=/usr/sbin/vndadm
- SNAPSHOT_DIR=root/checkpoints
- OVERLAY_RULES=/var/run/smartdc/networking/overlay_rules.json
- +SYSINFO=/tmp/.sysinfo.parsable
- DEFAULT_MTU=1500
- #
- @@ -144,8 +145,15 @@ setup_net()
- do
- # Get simplified versions of the network config. variables.
- address=$(eval echo \$_ZONECFG_net_${nic}_address)
- - dhcp_server=$(get_boolean_nic_property ${nic} dhcp_server)
- + # If address set, must be a shared stack zone
- + [[ -n $address ]] && exit 0
- +
- global_nic=$(eval echo \$_ZONECFG_net_${nic}_global_nic)
- + # If no global-nic, must be a dedicated physical NIC instead
- + # of a vnic
- + [[ -z $global_nic ]] && continue
- +
- + dhcp_server=$(get_boolean_nic_property ${nic} dhcp_server)
- mac_addr=$(eval echo \$_ZONECFG_net_${nic}_mac_addr)
- vlan_id=$(eval echo \$_ZONECFG_net_${nic}_vlan_id)
- blocked_outgoing_ports=$(eval \
- @@ -177,12 +185,7 @@ setup_net()
- zone_ips=$zone_ip
- fi
- - # If address set, must be a shared stack zone
- - [[ -n $address ]] && exit 0
- - # If no global-nic, must be a dedicated physical NIC instead
- - # of a vnic
- - [[ -z $global_nic ]] && continue
- orig_global=$global_nic
- @@ -211,10 +214,11 @@ setup_net()
- tmp=$(echo $orig_global | sed -E 's_[a-zA-Z_0-9]+/[0-9]+__')
- if [[ -n "$tmp" ]]; then
- - global_nic=$(eval echo \$SYSINFO_NIC_${orig_global})
- + global_nic=$(grep NIC_$orig_global $SYSINFO | \
- + awk -F= '{print $2}' | tr -d \'\\)
- - # If the global nic is specified as a device or etherstub name
- - # rather than a tag
- + # If the global nic is specified as a device or
- + # etherstub name rather than a tag
- if [[ -z $global_nic ]]; then
- echo "$(dladm show-phys -p -o LINK) $(dladm show-etherstub -p -o LINK)" \
- | egrep "(^| )${orig_global}( |$)" > /dev/null
- @@ -417,26 +421,27 @@ setup_net()
- fi
- fi
- - # If we aren't using IP spoofing, we'll need to set the allowed-ips
- - # property on the NIC so that the zone will be able to ifconfig the
- - # proper addresses.
- + # If we aren't using IP spoofing, we'll need to set the
- + # allowed-ips property on the NIC so that the zone will be able
- + # to ifconfig the proper addresses.
- if [[ $allow_ip_spoof != "true" ]]; then
- unset allowed_ip_map
- typeset -A allowed_ip_map
- OLDIFS=$IFS
- IFS=,
- +
- + # For each static IP available, add it to the list.
- for zone_ip in $zone_ips; do
- - # For each static IP available, add it to the list.
- if [[ $zone_ip != "dhcp" ]] && [[ $zone_ip != "addrconf" ]]; then
- clean_ip=`printf "%s" "${zone_ip}" | sed 's|^\([^/]*\)/.*|\1|'`
- allowed_ip_map[${clean_ip}]=true
- fi
- done
- - # If any additional IPs have been specified (for example, older
- - # VMs set up for IPv6 before vmadm gained support), add them to
- - # the list.
- + # If any additional IPs have been specified (for
- + # example, older VMs set up for IPv6 before vmadm gained
- + # support), add them to the list.
- for allowed_ip in $allowed_ips; do
- allowed_ip_map[${allowed_ip}]=true
- done
- @@ -783,12 +788,6 @@ cleanup_mount()
- # Main
- #
- -# Load sysinfo variables with SYSINFO_ prefix
- -load_sdc_sysinfo
- -# Load config variables with CONFIG_ prefix, and sets the headnode variable
- -load_sdc_config
- -
- -
- [[ "$subcommand" == "pre" && $cmd == 0 ]] && setup_fs
- if [[ "$subcommand" == "post" && $cmd == 0 ]]; then
- [[ -n "$jst_showsnap" ]] && setup_snapshots
Add Comment
Please, Sign In to add comment