VirtualBox

Changeset 44208 in vbox


Ignore:
Timestamp:
Dec 28, 2012 4:13:10 AM (12 years ago)
Author:
vboxsync
Message:

DevINIP/new-lwip: use link-local address for IPv6 iSCSI-targets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevINIP.cpp

    r43924 r44208  
    112112    /** Flag whether the link is up. */
    113113    bool                    fLnkUp;
    114     /** Flag whether the configuration is IPv6 */
    115     bool                    fIpv6;
    116     /** Static IPv6 address of the interface. */
    117     char                   *pszIP6;
    118114} DEVINTNETIP, *PDEVINTNETIP;
    119115
     
    317313    netif->flags |= NETIF_FLAG_ETHARP;
    318314    netif->flags |= NETIF_FLAG_ETHERNET;
    319     if (g_pDevINIPData->fIpv6)
    320     {
    321         /* @todo: Don't bother user with entering IPv6 address explicitly,
    322          * instead what is required here that IPv6 local-address generation ?
    323          */
    324         if (!inet6_aton(g_pDevINIPData->pszIP6, &netif->ip6_addr[0]))
    325         {
    326             PDMDEV_SET_ERROR(g_pDevINIPData->pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    327                              N_("Configuration error: Invalid \"IPv6\" value"));
    328             return ERR_IF;
    329         }
    330         netif_ip6_addr_set_state(netif, 0, IP6_ADDR_VALID);
    331         netif->output_ip6 = ethip6_output;
    332         netif->ip6_autoconfig_enabled=1;
    333     }
    334     else
    335         netif->output = lwip_etharp_output;
    336 
     315    /*
     316     * @note: we always assign link-local IPv6 address
     317     */
     318    netif_create_ip6_linklocal_address(netif, 0);
     319    netif_ip6_addr_set_state(netif, 0, IP6_ADDR_VALID);
     320    netif->output_ip6 = ethip6_output;
     321    netif->ip6_autoconfig_enabled=1;
     322    LogFunc(("netif: ipv6:%RTnaipv6\n", &netif->ip6_addr[0].addr[0]));
     323    netif->output = lwip_etharp_output;
    337324#else
    338325    netif->output = devINIPOutput;
     
    357344        PDMDEV_SET_ERROR(pDevIns, rc,
    358345                         N_("Configuration error: Failed to get the \"IP\" value"));
     346        /* @todo: perhaps we should panic if IPv4 address isn't specify, with assumtion that
     347         * ISCSI target specified in IPv6 form. 
     348         */
    359349        return rc;
    360350    }
    361 #ifdef VBOX_WITH_NEW_LWIP
    362     rc = CFGMR3QueryStringAlloc(pCfg, "IPv6", &pThis->pszIP6);
    363     if (RT_SUCCESS(rc))
    364         pThis->fIpv6 = true;
    365     else if (rc != VERR_CFGM_VALUE_NOT_FOUND)
    366     {
    367         PDMDEV_SET_ERROR(pDevIns, rc,
    368                          N_("Configuration error: Failed to get the \"IPv6\" value"));
    369         AssertReturn(rc, rc);
    370     }
    371 #endif
     351
    372352    rc = CFGMR3QueryStringAlloc(pCfg, "Netmask", &pThis->pszNetmask);
    373353    if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette