projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tunneling: Add DF inherit and default flags to set of public tunnel flags.
[openvswitch]
/
ofproto
/
connmgr.c
diff --git
a/ofproto/connmgr.c
b/ofproto/connmgr.c
index 166ef8c3f3cd2093142d70c45222f647f97bad9e..a76dc8e8084b790874e38dba40780e0b8bba9a77 100644
(file)
--- a/
ofproto/connmgr.c
+++ b/
ofproto/connmgr.c
@@
-319,7
+319,7
@@
static struct ofconn *find_controller_by_target(struct connmgr *,
const char *target);
static void update_fail_open(struct connmgr *);
static int set_pvconns(struct pvconn ***pvconnsp, size_t *n_pvconnsp,
const char *target);
static void update_fail_open(struct connmgr *);
static int set_pvconns(struct pvconn ***pvconnsp, size_t *n_pvconnsp,
- const struct s
vec
*);
+ const struct s
set
*);
/* Returns true if 'mgr' has any configured primary controllers.
*
/* Returns true if 'mgr' has any configured primary controllers.
*
@@
-393,7
+393,6
@@
connmgr_set_controllers(struct connmgr *mgr,
struct shash new_controllers;
struct ofconn *ofconn, *next_ofconn;
struct ofservice *ofservice, *next_ofservice;
struct shash new_controllers;
struct ofconn *ofconn, *next_ofconn;
struct ofservice *ofservice, *next_ofservice;
- bool ss_exists;
size_t i;
/* Create newly configured controllers and services.
size_t i;
/* Create newly configured controllers and services.
@@
-421,7
+420,6
@@
connmgr_set_controllers(struct connmgr *mgr,
/* Delete controllers that are no longer configured.
* Update configuration of all now-existing controllers. */
/* Delete controllers that are no longer configured.
* Update configuration of all now-existing controllers. */
- ss_exists = false;
HMAP_FOR_EACH_SAFE (ofconn, next_ofconn, hmap_node, &mgr->controllers) {
struct ofproto_controller *c;
HMAP_FOR_EACH_SAFE (ofconn, next_ofconn, hmap_node, &mgr->controllers) {
struct ofproto_controller *c;
@@
-470,22
+468,29
@@
connmgr_reconnect(const struct connmgr *mgr)
* A "snoop" is a pvconn to which every OpenFlow message to or from the most
* important controller on 'mgr' is mirrored. */
int
* A "snoop" is a pvconn to which every OpenFlow message to or from the most
* important controller on 'mgr' is mirrored. */
int
-connmgr_set_snoops(struct connmgr *mgr, const struct s
vec
*snoops)
+connmgr_set_snoops(struct connmgr *mgr, const struct s
set
*snoops)
{
return set_pvconns(&mgr->snoops, &mgr->n_snoops, snoops);
}
/* Adds each of the snoops currently configured on 'mgr' to 'snoops'. */
void
{
return set_pvconns(&mgr->snoops, &mgr->n_snoops, snoops);
}
/* Adds each of the snoops currently configured on 'mgr' to 'snoops'. */
void
-connmgr_get_snoops(const struct connmgr *mgr, struct s
vec
*snoops)
+connmgr_get_snoops(const struct connmgr *mgr, struct s
set
*snoops)
{
size_t i;
for (i = 0; i < mgr->n_snoops; i++) {
{
size_t i;
for (i = 0; i < mgr->n_snoops; i++) {
- s
vec
_add(snoops, pvconn_get_name(mgr->snoops[i]));
+ s
set
_add(snoops, pvconn_get_name(mgr->snoops[i]));
}
}
}
}
+/* Returns true if 'mgr' has at least one snoop, false if it has none. */
+bool
+connmgr_has_snoops(const struct connmgr *mgr)
+{
+ return mgr->n_snoops > 0;
+}
+
/* Creates a new controller for 'target' in 'mgr'. update_controller() needs
* to be called later to finish the new ofconn's configuration. */
static void
/* Creates a new controller for 'target' in 'mgr'. update_controller() needs
* to be called later to finish the new ofconn's configuration. */
static void
@@
-583,10
+588,11
@@
update_fail_open(struct connmgr *mgr)
static int
set_pvconns(struct pvconn ***pvconnsp, size_t *n_pvconnsp,
static int
set_pvconns(struct pvconn ***pvconnsp, size_t *n_pvconnsp,
- const struct s
vec *svec
)
+ const struct s
set *sset
)
{
struct pvconn **pvconns = *pvconnsp;
size_t n_pvconns = *n_pvconnsp;
{
struct pvconn **pvconns = *pvconnsp;
size_t n_pvconns = *n_pvconnsp;
+ const char *name;
int retval = 0;
size_t i;
int retval = 0;
size_t i;
@@
-595,10
+601,9
@@
set_pvconns(struct pvconn ***pvconnsp, size_t *n_pvconnsp,
}
free(pvconns);
}
free(pvconns);
- pvconns = xmalloc(s
vec->n
* sizeof *pvconns);
+ pvconns = xmalloc(s
set_count(sset)
* sizeof *pvconns);
n_pvconns = 0;
n_pvconns = 0;
- for (i = 0; i < svec->n; i++) {
- const char *name = svec->names[i];
+ SSET_FOR_EACH (name, sset) {
struct pvconn *pvconn;
int error;
struct pvconn *pvconn;
int error;
@@
-1164,7
+1169,7
@@
connmgr_broadcast(struct connmgr *mgr, struct ofpbuf *packet)
}
}
if (prev) {
}
}
if (prev) {
- ofconn_send_reply(
ofconn
, packet);
+ ofconn_send_reply(
prev
, packet);
} else {
ofpbuf_delete(packet);
}
} else {
ofpbuf_delete(packet);
}