From 0b8ccdf977365b529282712012150b481e462606 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 11 Nov 2008 12:58:52 -0800 Subject: [PATCH] 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. --- datapath/nx_act_snat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/datapath/nx_act_snat.c b/datapath/nx_act_snat.c index 95b8c2836..633428578 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; } -- 2.43.0