lib/netdev-bsd.c
/*
 * Returns the maximum size of transmitted (and received) packets on 'netdev',
 * in bytes, not including the hardware header; thus, this is typically 1500
 * bytes for Ethernet devices.
 */
Returns the maximum size of transmitted (and received) packets on 'netdev',
in bytes, not including the hardware header; thus, this is typically 1500
bytes for Ethernet devices.
Returns the maximum size of transmitted ( and received ) packets on ' netdev ' in bytes not including the hardware header ; thus this is typically 1500 bytes for Ethernet devices .
static int
netdev_bsd_get_mtu(const struct netdev *netdev_, int *mtup)
{
    struct netdev_bsd *netdev = netdev_bsd_cast(netdev_);
    int error = 0;
    ovs_mutex_lock(&netdev->mutex);
    if (!(netdev->cache_valid & VALID_MTU)) {
        struct ifreq ifr;
        error = af_inet_ifreq_ioctl(netdev_get_kernel_name(netdev_), &ifr,
                                    SIOCGIFMTU, "SIOCGIFMTU");
        if (!error) {
            netdev->mtu = ifr.ifr_mtu;
            netdev->cache_valid |= VALID_MTU;
        }
    }
    if (!error) {
        *mtup = netdev->mtu;
    }
    ovs_mutex_unlock(&netdev->mutex);
    return error;
}
static int netdev_bsd_get_mtu ( const struct netdev * netdev_ , int * mtup ) { struct netdev_bsd * netdev = netdev_bsd_cast ( netdev_ ) ; int error = 0 ; ovs_mutex_lock ( & netdev -> mutex ) ; if ( ! ( netdev -> cache_valid & VALID_MTU ) ) { struct ifreq ifr ; error = af_inet_ifreq_ioctl ( netdev_get_kernel_name ( netdev_ ) , & ifr , SIOCGIFMTU , " " ) ; if ( ! error ) { netdev -> mtu = ifr . ifr_mtu ; netdev -> cache_valid |= VALID_MTU ; } } if ( ! error ) { * mtup = netdev -> mtu ; } ovs_mutex_unlock ( & netdev -> mutex ) ; return error ; }
Returns the maximum size of transmitted (and received) packets on 'netdev',
 in bytes, not including the hardware header; thus, this is typically 1500
 bytes for Ethernet devices.
Returns the maximum size of transmitted ( and received ) packets on ' netdev ' in bytes not including the hardware header ; thus this is typically 1500 bytes for Ethernet devices .