OpenSolaris

Printable Version Enter a New Search
Bug ID 6789718
Synopsis ip6.tun0 cannot be plumbed in a non-global-zone post-6745288
State 10-Fix Delivered (Fix available in build)
Category:Subcategory library:libdlpi
Keywords
Responsible Engineer Peter Memishian
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_107
Fixed In snv_107
Release Fixed solaris_nevada(snv_107)
Related Bugs 6745288 , 6793122
Submit Date 31-December-2008
Last Update Date 28-January-2009
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.
Work Around
N/A
Comments
N/A