From: Ben Pfaff Date: Tue, 11 Nov 2008 20:58:52 +0000 (-0800) Subject: In update_mapping(), update m->hw_addr unconditionally. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b8ccdf977365b529282712012150b481e462606;p=openvswitch In update_mapping(), update m->hw_addr unconditionally. There is no benefit to comparing it first, since we already know that that cache line will be dirtied by the assignment to m->used. --- diff --git a/datapath/nx_act_snat.c b/datapath/nx_act_snat.c index 95b8c283..63342857 100644 --- a/datapath/nx_act_snat.c +++ b/datapath/nx_act_snat.c @@ -361,9 +361,7 @@ update_mapping(struct net_bridge_port *p, const struct sk_buff *skb) list_for_each_entry (m, &sc->mappings, node) { if (m->ip_addr == iph->saddr){ - if (memcmp(m->hw_addr, eh->h_source, ETH_ALEN)) { - memcpy(m->hw_addr, eh->h_source, ETH_ALEN); - } + memcpy(m->hw_addr, eh->h_source, ETH_ALEN); m->used = jiffies; goto done; }