]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/ethernet/eth.c
Merge tag 'audit-pr-20191126' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoor...
[linux.git] / net / ethernet / eth.c
index 17374afee28f815b4d312eb87edbfa61a41d7f44..9040fe55e0f5d33814d6489cf1e50d1c2aa89067 100644 (file)
@@ -244,7 +244,12 @@ int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16
        eth->h_proto = type;
        memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
        memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
-       hh->hh_len = ETH_HLEN;
+
+       /* Pairs with READ_ONCE() in neigh_resolve_output(),
+        * neigh_hh_output() and neigh_update_hhs().
+        */
+       smp_store_release(&hh->hh_len, ETH_HLEN);
+
        return 0;
 }
 EXPORT_SYMBOL(eth_header_cache);