X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev.c;h=25d32db2ad559012ad4dc49666a6d78721529872;hb=4b0424809b823101c969a0691fc1db0c880ae64a;hp=74f5f53eec32a29a7adb0a0336ab3fab0ffa33d7;hpb=d010a5eef1e589b1ee517548a1e4d4f1c1f795d1;p=sliver-openvswitch.git diff --git a/lib/netdev.c b/lib/netdev.c index 74f5f53ee..25d32db2a 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -24,6 +24,7 @@ #include #include +#include "connectivity.h" #include "coverage.h" #include "dpif.h" #include "dynamic-string.h" @@ -36,6 +37,7 @@ #include "openflow/openflow.h" #include "packets.h" #include "poll-loop.h" +#include "seq.h" #include "shash.h" #include "smap.h" #include "sset.h" @@ -333,6 +335,7 @@ netdev_open(const char *name, const char *type, struct netdev **netdevp) int old_ref_cnt; atomic_add(&rc->ref_cnt, 1, &old_ref_cnt); + seq_change(connectivity_seq_get()); } else { free(netdev->name); ovs_assert(list_is_empty(&netdev->saved_flags_list)); @@ -388,13 +391,19 @@ netdev_set_config(struct netdev *netdev, const struct smap *args) { if (netdev->netdev_class->set_config) { const struct smap no_args = SMAP_INITIALIZER(&no_args); - return netdev->netdev_class->set_config(netdev, - args ? args : &no_args); + int error; + + error = netdev->netdev_class->set_config(netdev, + args ? args : &no_args); + if (error) { + VLOG_WARN("%s: could not set configuration (%s)", + netdev_get_name(netdev), ovs_strerror(error)); + } + return error; } else if (args && !smap_is_empty(args)) { VLOG_WARN("%s: arguments provided to device that is not configurable", netdev_get_name(netdev)); } - return 0; } @@ -1496,18 +1505,6 @@ netdev_dump_queue_stats(const struct netdev *netdev, : EOPNOTSUPP); } -/* Returns a sequence number which indicates changes in one of 'netdev''s - * properties. The returned sequence will be nonzero so that callers have a - * value which they may use as a reset when tracking 'netdev'. - * - * The returned sequence number will change whenever 'netdev''s flags, - * features, ethernet address, or carrier changes. It may change for other - * reasons as well, or no reason at all. */ -unsigned int -netdev_change_seq(const struct netdev *netdev) -{ - return netdev->netdev_class->change_seq(netdev); -} /* Returns the class type of 'netdev'. *