9228 zone_getattr(ZONE_ATTR_NETWORK) returns uninitialised value

Review Request #930 - Created March 4, 2018 and submitted

Information
Andy Fiddaman
illumos-gate
master
9228, 9230
85362d4...
Reviewers
general
9228 zone_getattr(ZONE_ATTR_NETWORK) returns uninitialised value

I came across this while troubleshooting the allowed-address zone network attribute.
Using a freshly installed exclusive-ip zone with an allowed-address:

bloody# zonecfg -z sparse info net
net:
        address not specified
        allowed-address: 172.16.1.1/24
        defrouter: 172.16.1.254
        physical: sparse0

Before this patch:

During first zone boot, dtrace shows:

  7  24847              zone_getattr:return Returning -72887665

and once all services are started, there is no interface in the zone:

root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---

It can be created but attempting to bring it online results in an error:

oot@sparse:~# ipadm create-if sparse0
root@sparse:~# ipadm disable-if -t sparse0
root@sparse:~# ipadm enable-if -t sparse0
ipadm: Could not enable sparse0 : Invalid argument provided
root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---
sparse0    down     bm-------Z46 -46

and, again, dtrace shows the kernel function returning a negative number.

After patch:

Immediately following zone install, zone boot:

root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---
sparse0    ok       bm-------Z4- -4-
root@sparse:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
sparse0/_a        from-gz  ok           172.16.1.1/24
lo0/v6            static   ok           ::1/128
C Fraire
John Levon
Andy Fiddaman
Toomas Soome
Andy Fiddaman
C Fraire
John Levon
Toomas Soome
Yuri Pankov
Andy Fiddaman
Yuri Pankov
John Levon
Dominik Hassler
Toomas Soome
Andy Fiddaman
Review request changed

Status: Closed (submitted)

Loading...