Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve IPv6 support in globalzone #503

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
allows sysinfo to discovered the ipv6 address
  • Loading branch information
sjorge committed Oct 31, 2015
commit 0542ce0fcc5454d5a95f41ffefb5416dc397081b
12 changes: 12 additions & 0 deletions src/sysinfo
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ function get_smartos_network_interfaces()
mac=${normalized}
ip4addr=$(ifconfig ${iface} 2>/dev/null \
| grep "inet " | awk '{ print $2 }')
ip6addr=$(ifconfig ${iface}:1 inet6 2> /dev/null \
| grep "inet6 " | awk '{ print $2 }' \
| awk -F/ '{ print $1 }')

nic_tag_count=0
while [[ ${nic_tag_count} -lt ${NicTagCount} ]]; do
Expand All @@ -372,6 +375,7 @@ function get_smartos_network_interfaces()
NetworkInterfaces[${count}]=${iface}
eval "Network_Interface_${iface}_MAC_Address=${mac}"
eval "Network_Interface_${iface}_IPv4_Address=${ip4addr}"
eval "Network_Interface_${iface}_IPv6_Address=${ip6addr}"
if [[ -n ${nicnames} ]]; then
eval "Network_Interface_${iface}_NIC_Names=${nicnames}"
fi
Expand Down Expand Up @@ -437,6 +441,9 @@ function get_smartos_network_interfaces()

ip4addr=$(ifconfig ${iface} 2>/dev/null \
| grep "inet " | awk '{ print $2 }')
ip6addr=$(ifconfig ${iface}:1 inet6 2> /dev/null \
| grep "inet6 " | awk '{ print $2 }' \
| awk -F/ '{ print $1 }')

nic_tag_count=0
while [[ ${nic_tag_count} -lt ${NicTagCount} ]]; do
Expand All @@ -457,6 +464,7 @@ function get_smartos_network_interfaces()
normalize_mac $(echo ${mac} | sed 's/\|/:/g')
eval "Network_Interface_${iface}_MAC_Address=${normalized}"
eval "Network_Interface_${iface}_IPv4_Address=${ip4addr}"
eval "Network_Interface_${iface}_IPv6_Address=${ip6addr}"
if [[ -n ${nicnames} ]]; then
eval "Network_Interface_${iface}_NIC_Names=${nicnames}"
fi
Expand Down Expand Up @@ -492,9 +500,13 @@ function get_smartos_vnics()
link_status=$(pfexec /sbin/dladm show-link -p -o state ${iface})
ip4addr=$(ifconfig ${iface} 2>/dev/null \
| grep "inet " | awk '{ print $2 }')
ip6addr=$(ifconfig ${iface}:1 inet6 2> /dev/null \
| grep "inet6 " | awk '{ print $2 }' \
| awk -F/ '{ print $1 }')
VirtualNetworkInterfaces[${count}]=${iface}
eval "Virtual_Network_Interface_${iface}_MAC_Address=${mac}"
eval "Virtual_Network_Interface_${iface}_IPv4_Address=${ip4addr}"
eval "Virtual_Network_Interface_${iface}_IPv6_Address=${ip6addr}"
eval "Virtual_Network_Interface_${iface}_Link_Status=${link_status}"
eval "Virtual_Network_Interface_${iface}_VLAN=${vlan}"
eval "Virtual_Network_Interface_${iface}_Host_Interface=${over}"
Expand Down