Skip to content

Commit

Permalink
ofproto-dpif-xlate: Only learn MAC addresses upon handling packets.
Browse files Browse the repository at this point in the history
MAC learning, like flow entry learning via the "learn" action, should only
happen if a packet was actually received.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Joe Stringer <[email protected]>
  • Loading branch information
blp committed Aug 25, 2014
1 parent 826bc7b commit 549d386
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -4354,8 +4354,10 @@ xlate_push_stats(struct xlate_cache *xcache, bool may_learn,
}
break;
case XC_NORMAL:
xlate_cache_normal(entry->u.normal.ofproto, entry->u.normal.flow,
entry->u.normal.vlan);
if (may_learn) {
xlate_cache_normal(entry->u.normal.ofproto,
entry->u.normal.flow, entry->u.normal.vlan);
}
break;
case XC_FIN_TIMEOUT:
xlate_fin_timeout__(entry->u.fin.rule, stats->tcp_flags,
Expand Down

0 comments on commit 549d386

Please sign in to comment.