From 63a10d0e099fe8eb6052fadf6b80a0ab208a6381 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Thu, 16 May 2013 15:17:10 -0700 Subject: [PATCH] lib/mac-learning.h: Change one variable's type and name This commit changes variable "int i" of "union port" of "struct mac_entry" to "uint16_t ofp_port", since it is used to store the OpenFlow port number. Signed-off-by: Alex Wang Signed-off-by: Ben Pfaff --- lib/learning-switch.c | 6 +++--- lib/mac-learning.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 4a95dc1b8..ab37dccd7 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -474,12 +474,12 @@ lswitch_choose_destination(struct lswitch *sw, const struct flow *flow) /* Learn the source MAC. */ if (mac_learning_may_learn(sw->ml, flow->dl_src, 0)) { struct mac_entry *mac = mac_learning_insert(sw->ml, flow->dl_src, 0); - if (mac_entry_is_new(mac) || mac->port.i != flow->in_port) { + if (mac_entry_is_new(mac) || mac->port.ofp_port != flow->in_port) { VLOG_DBG_RL(&rl, "%016llx: learned that "ETH_ADDR_FMT" is on " "port %"PRIu16, sw->datapath_id, ETH_ADDR_ARGS(flow->dl_src), flow->in_port); - mac->port.i = flow->in_port; + mac->port.ofp_port = flow->in_port; mac_learning_changed(sw->ml, mac); } } @@ -495,7 +495,7 @@ lswitch_choose_destination(struct lswitch *sw, const struct flow *flow) mac = mac_learning_lookup(sw->ml, flow->dl_dst, 0, NULL); if (mac) { - out_port = mac->port.i; + out_port = mac->port.ofp_port; if (out_port == flow->in_port) { /* Don't send a packet back out its input port. */ return OFPP_NONE; diff --git a/lib/mac-learning.h b/lib/mac-learning.h index 284e7f636..666b00f40 100644 --- a/lib/mac-learning.h +++ b/lib/mac-learning.h @@ -49,7 +49,7 @@ struct mac_entry { /* Learned port. */ union { void *p; - int i; + uint16_t ofp_port; } port; }; -- 2.43.0