9228 zone_getattr(ZONE_ATTR_NETWORK) returns uninitialised value
Review Request #930 — Created March 4, 2018 and submitted
Information | |
---|---|
citrus | |
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: sparse0Before this patch:
During first zone boot, dtrace shows:
7 24847 zone_getattr:return Returning -72887665and 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 -46and, 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
Change Summary:
re-based on illumos-gate/master
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+3) |
Change Summary:
Also fix 9230 - zone_getattr(ZONE_ATTR_NETWORK) doesn't check user-supplied buffer size.
Bugs: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 3 (+4) |
-
-
usr/src/uts/common/os/zone.c (Diff revision 3) Wonder if the following would look cleaner:
bufsize = MIN(bufsize, PIPE_BUF + sizeof (zone_net_data_t));
Change Summary:
Use MIN()
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+3) |