projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovs-vsctl: additional commands for querying VLAN fake bridges.
[openvswitch]
/
lib
/
mac-learning.c
diff --git
a/lib/mac-learning.c
b/lib/mac-learning.c
index eeebce86629b32b3e66b0481866cdc8bf29a0b61..c9b7d3e73d65c65cab5c33fbf1334f2fcaf8a292 100644
(file)
--- a/
lib/mac-learning.c
+++ b/
lib/mac-learning.c
@@
-32,6
+32,14
@@
#define THIS_MODULE VLM_mac_learning
#include "vlog.h"
#define THIS_MODULE VLM_mac_learning
#include "vlog.h"
+/* Returns the number of seconds since 'e' was last learned. */
+int
+mac_entry_age(const struct mac_entry *e)
+{
+ time_t remaining = e->expires - time_now();
+ return MAC_ENTRY_IDLE_TIME - remaining;
+}
+
static uint32_t
mac_table_hash(const uint8_t mac[ETH_ADDR_LEN], uint16_t vlan)
{
static uint32_t
mac_table_hash(const uint8_t mac[ETH_ADDR_LEN], uint16_t vlan)
{
@@
-174,7
+182,7
@@
mac_learning_learn(struct mac_learning *ml,
/* Make the entry most-recently-used. */
list_remove(&e->lru_node);
list_push_back(&ml->lrus, &e->lru_node);
/* Make the entry most-recently-used. */
list_remove(&e->lru_node);
list_push_back(&ml->lrus, &e->lru_node);
- e->expires = time_now() +
60
;
+ e->expires = time_now() +
MAC_ENTRY_IDLE_TIME
;
/* Did we learn something? */
if (e->port != src_port) {
/* Did we learn something? */
if (e->port != src_port) {