From: Giuseppe Lettieri Date: Wed, 16 May 2012 12:20:09 +0000 (+0200) Subject: restored minimal functionality X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=61e6eb51e2edf7faf5a80564bfe4199f7afd973f;p=sliver-openvswitch.git restored minimal functionality --- diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index 82214cf69..1b78a0b1c 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -89,6 +89,7 @@ struct netdev_bsd { struct netdev_dev_bsd { struct netdev_dev netdev_dev; unsigned int cache_valid; + unsigned int change_seq; int ifindex; uint8_t etheraddr[ETH_ADDR_LEN]; @@ -279,11 +280,12 @@ netdev_bsd_create_system(const struct netdev_class *class, const char *name, int error; error = cache_notifier_ref(); - if (!error) { + if (error) { return error; } netdev_dev = xzalloc(sizeof *netdev_dev); + netdev_dev->change_seq = 1; netdev_dev_init(&netdev_dev->netdev_dev, name, class); *netdev_devp = &netdev_dev->netdev_dev; @@ -302,7 +304,7 @@ netdev_bsd_create_tap(const struct netdev_class *class, const char *name, struct ifreq ifr; error = cache_notifier_ref(); - if (!error) { + if (error) { goto error; } @@ -1218,6 +1220,12 @@ netdev_bsd_update_flags(struct netdev *netdev, enum netdev_flags off, return error; } +static unsigned int +netdev_bsd_change_seq(const struct netdev *netdev) +{ + return netdev_dev_bsd_cast(netdev_get_dev(netdev))->change_seq; +} + const struct netdev_class netdev_bsd_class = { "system", @@ -1276,7 +1284,7 @@ const struct netdev_class netdev_bsd_class = { netdev_bsd_update_flags, - NULL, /* change_seq */ + netdev_bsd_change_seq }; const struct netdev_class netdev_tap_class = { @@ -1336,7 +1344,7 @@ const struct netdev_class netdev_tap_class = { netdev_bsd_update_flags, - NULL, /* change_seq */ + netdev_bsd_change_seq }; diff --git a/lib/netdev.c b/lib/netdev.c index 10942480a..6e7fa8b15 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -81,6 +81,7 @@ netdev_initialize(void) netdev_vport_register(); #endif #ifdef __FreeBSD__ + netdev_register_provider(&netdev_tap_class); netdev_register_provider(&netdev_bsd_class); #endif }