projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev-port: Fix invalid memory access in netdev_vport_poll_add().
[openvswitch]
/
vswitchd
/
bridge.c
diff --git
a/vswitchd/bridge.c
b/vswitchd/bridge.c
index c2c4579c56fc292a8923e0d3abcc333608086163..1558d3bb90d3afc79cc7cbbb6a94b9a66af98d77 100644
(file)
--- a/
vswitchd/bridge.c
+++ b/
vswitchd/bridge.c
@@
-981,7
+981,7
@@
bridge_pick_local_hw_addr(struct bridge *br, uint8_t ea[ETH_ADDR_LEN],
/* Otherwise choose the minimum non-local MAC address among all of the
* interfaces. */
/* Otherwise choose the minimum non-local MAC address among all of the
* interfaces. */
- memset(ea, 0xff,
sizeof ea
);
+ memset(ea, 0xff,
ETH_ADDR_LEN
);
for (i = 0; i < br->n_ports; i++) {
struct port *port = br->ports[i];
uint8_t iface_ea[ETH_ADDR_LEN];
for (i = 0; i < br->n_ports; i++) {
struct port *port = br->ports[i];
uint8_t iface_ea[ETH_ADDR_LEN];
@@
-3029,7
+3029,7
@@
static void
bridge_account_flow_ofhook_cb(const struct flow *flow, tag_type tags,
const struct nlattr *actions,
size_t actions_len,
bridge_account_flow_ofhook_cb(const struct flow *flow, tag_type tags,
const struct nlattr *actions,
size_t actions_len,
- u
nsigned long long in
t n_bytes, void *br_)
+ u
int64_
t n_bytes, void *br_)
{
struct bridge *br = br_;
const struct nlattr *a;
{
struct bridge *br = br_;
const struct nlattr *a;
@@
-4527,6
+4527,8
@@
port_update_bonding(struct port *port)
free(port->bond_hash);
port->bond_hash = NULL;
port->bond_fake_iface = false;
free(port->bond_hash);
port->bond_hash = NULL;
port->bond_fake_iface = false;
+ port->active_iface = -1;
+ port->no_ifaces_tag = 0;
} else {
size_t i;
} else {
size_t i;
@@
-4537,19
+4539,25
@@
port_update_bonding(struct port *port)
e->iface_idx = -1;
e->tx_bytes = 0;
}
e->iface_idx = -1;
e->tx_bytes = 0;
}
- port->no_ifaces_tag = tag_create_random();
- bond_choose_active_iface(port);
port->bond_next_rebalance
= time_msec() + port->bond_rebalance_interval;
port->bond_next_rebalance
= time_msec() + port->bond_rebalance_interval;
-
- if (port->cfg->bond_fake_iface) {
- port->bond_next_fake_iface_update = time_msec();
- }
} else if (port->bond_mode == BM_AB) {
free(port->bond_hash);
port->bond_hash = NULL;
}
} else if (port->bond_mode == BM_AB) {
free(port->bond_hash);
port->bond_hash = NULL;
}
+
+ if (!port->no_ifaces_tag) {
+ port->no_ifaces_tag = tag_create_random();
+ }
+
+ if (port->active_iface < 0) {
+ bond_choose_active_iface(port);
+ }
+
port->bond_fake_iface = port->cfg->bond_fake_iface;
port->bond_fake_iface = port->cfg->bond_fake_iface;
+ if (port->bond_fake_iface) {
+ port->bond_next_fake_iface_update = time_msec();
+ }
if (!port->miimon) {
port->monitor = netdev_monitor_create();
if (!port->miimon) {
port->monitor = netdev_monitor_create();