diff options
author | Ben Pfaff <blp@nicira.com> | 2011-09-15 10:41:15 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-09-15 10:41:15 -0700 |
commit | 14622f22abd93ca464c9be1b6b58d6f0fb2bb186 (patch) | |
tree | f0da08fad41f064d74044246468d62794c2e7156 /lib/netdev-provider.h | |
parent | 98fbd5b28b4e67d3cabe2ef1c7d1dfec9a1067ce (diff) | |
download | openvswitch-14622f22abd93ca464c9be1b6b58d6f0fb2bb186.tar.gz |
netdev: Allow get_mtu and set_mtu provider functions to be null.
Most netdev provider functions are allowed to be null if the implementation
does not support this feature. This commit adds this feature for get_mtu
and set_mtu, and changes netdev-vport to take advantage of it.
Also, changes netdev_get_mtu() to report an MTU of 0 on error, instead of
leaving the MTU indeterminate.
Diffstat (limited to 'lib/netdev-provider.h')
-rw-r--r-- | lib/netdev-provider.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index b8f652919..22b00f728 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -248,13 +248,15 @@ struct netdev_class { * bytes for Ethernet devices. * * If 'netdev' does not have an MTU (e.g. as some tunnels do not), then - * this function should return EOPNOTSUPP. */ + * this function should return EOPNOTSUPP. This function may be set to + * null if it would always return EOPNOTSUPP. */ int (*get_mtu)(const struct netdev *netdev, int *mtup); /* Sets 'netdev''s MTU to 'mtu'. * * If 'netdev' does not have an MTU (e.g. as some tunnels do not), then - * this function should return EOPNOTSUPP. */ + * this function should return EOPNOTSUPP. This function may be set to + * null if it would always return EOPNOTSUPP. */ int (*set_mtu)(const struct netdev *netdev, int mtu); /* Returns the ifindex of 'netdev', if successful, as a positive number. |