|
Description
|
After a recent synch-up with Nevada, Xiang reported that he could no longer
plumb an IPv6 tunnel in a non-global-zone:
# zonename
x86ztest
# ifconfig ip6.tun0 plumb
ifconfig: cannot open link "ip6.tun0": Invalid argument
Some debugging led me to this chunk of code in i_dlpi_open():
/* open libdladm handle rather than taking it as input */
if (dladm_open(&handle) != DLADM_STATUS_OK)
--> return (DLPI_FAILURE);
if (dladm_dev2linkid(handle, device, &linkid) ==
DLADM_STATUS_OK) {
dladm_phys_attr_t dpa;
if ((dladm_phys_info(handle, linkid, &dpa,
DLADM_OPT_ACTIVE)) == DLADM_STATUS_OK &&
!dpa.dp_novanity) {
dladm_close(handle);
return (DLPI_ENOTSTYLE2);
}
}
dladm_close(handle);
}
fallback:
(void) snprintf(path, sizeof (path), "/dev/%s", provider);
if ((*fd = open(path, oflags)) != -1)
return (DLPI_SUCCESS);
return (errno == ENOENT ? DLPI_ENOLINK : DL_SYSERR);
Note the marked line -- it's new as of 6745288. In this case, if dladm_open()
fails (which it always will in a non-global-zone), we will return DLPI_FAILURE
rather that proceeding to the `fallback' label as we used to. As a result, we
never attempt to open "/dev/ip6", and instead the dlpi_open() operation fails.
Note that this does not affect "ip.tun0" because "ip." doesn't have a number and
thus jumps to the fallback path earlier in i_dlpi_open():
/*
* This is not a valid style-1 name. It could be "ip" module
* for example. Fallback to open the /dev node.
*/
if (dlpi_parselink(provider, driver, &ppa) != DLPI_SUCCESS)
goto fallback;
The fix is straightforward: if dladm_open() fails, jump to the fallback path.
|