lib/netdev-bsd.c
/*
 * Returns a pointer to 'netdev''s MAC address.  The caller must not modify or
 * free the returned buffer.
 */
Returns a pointer to 'netdev''s MAC address.  The caller must not modify or
free the returned buffer.
Returns a pointer to ' netdev ' ' s MAC address . The caller must not modify or free the returned buffer .
static int
netdev_bsd_get_etheraddr(const struct netdev *netdev_, struct eth_addr *mac)
{
    struct netdev_bsd *netdev = netdev_bsd_cast(netdev_);
    int error = 0;
    ovs_mutex_lock(&netdev->mutex);
    if (!(netdev->cache_valid & VALID_ETHERADDR)) {
        error = get_etheraddr(netdev_get_kernel_name(netdev_),
                              &netdev->etheraddr);
        if (!error) {
            netdev->cache_valid |= VALID_ETHERADDR;
        }
    }
    if (!error) {
        *mac = netdev->etheraddr;
    }
    ovs_mutex_unlock(&netdev->mutex);
    return error;
}
static int netdev_bsd_get_etheraddr ( const struct netdev * netdev_ , struct eth_addr * mac ) { struct netdev_bsd * netdev = netdev_bsd_cast ( netdev_ ) ; int error = 0 ; ovs_mutex_lock ( & netdev -> mutex ) ; if ( ! ( netdev -> cache_valid & VALID_ETHERADDR ) ) { error = get_etheraddr ( netdev_get_kernel_name ( netdev_ ) , & netdev -> etheraddr ) ; if ( ! error ) { netdev -> cache_valid |= VALID_ETHERADDR ; } } if ( ! error ) { * mac = netdev -> etheraddr ; } ovs_mutex_unlock ( & netdev -> mutex ) ; return error ; }
Returns a pointer to 'netdev''s MAC address.
Returns a pointer to ' netdev ' ' s MAC address .