From ae05bcfd103fcd67953ad86cbd541288014c3443 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Thu, 10 Nov 2011 19:34:27 -0800 Subject: [PATCH] datapath: Don't use Nicira's OUI for generating mac-address. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- datapath/tunnel.c | 2 +- datapath/vport-generic.c | 13 ------------- datapath/vport-generic.h | 1 - datapath/vport-internal_dev.c | 2 +- datapath/vport-patch.c | 2 +- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 19056b97..a6fdfa94 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1457,7 +1457,7 @@ struct vport *tnl_create(const struct vport_parms *parms, goto error_free_vport; } - vport_gen_rand_ether_addr(mutable->eth_addr); + random_ether_addr(mutable->eth_addr); get_random_bytes(&initial_frag_id, sizeof(int)); atomic_set(&tnl_vport->frag_id, initial_frag_id); diff --git a/datapath/vport-generic.c b/datapath/vport-generic.c index 5bb27c78..c42a2851 100644 --- a/datapath/vport-generic.c +++ b/datapath/vport-generic.c @@ -10,19 +10,6 @@ #include "vport-generic.h" -void vport_gen_rand_ether_addr(u8 *addr) -{ - random_ether_addr(addr); - - /* Set the OUI to the Nicira one. */ - addr[0] = 0x00; - addr[1] = 0x23; - addr[2] = 0x20; - - /* Set the top bit to indicate random address. */ - addr[3] |= 0x80; -} - unsigned vport_gen_get_dev_flags(const struct vport *vport) { return IFF_UP | IFF_RUNNING | IFF_LOWER_UP; diff --git a/datapath/vport-generic.h b/datapath/vport-generic.h index 8bda5ad3..6b6b3e84 100644 --- a/datapath/vport-generic.h +++ b/datapath/vport-generic.h @@ -11,7 +11,6 @@ #include "vport.h" -void vport_gen_rand_ether_addr(u8 *addr); unsigned vport_gen_get_dev_flags(const struct vport *); int vport_gen_is_running(const struct vport *); unsigned char vport_gen_get_operstate(const struct vport *); diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index bc7b70e6..67f28260 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -203,7 +203,7 @@ static void do_setup(struct net_device *netdev) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) netdev->hw_features = netdev->features & ~NETIF_F_LLTX; #endif - vport_gen_rand_ether_addr(netdev->dev_addr); + random_ether_addr(netdev->dev_addr); } static struct vport *internal_dev_create(const struct vport_parms *parms) diff --git a/datapath/vport-patch.c b/datapath/vport-patch.c index ba10903b..306fe5a0 100644 --- a/datapath/vport-patch.c +++ b/datapath/vport-patch.c @@ -148,7 +148,7 @@ static struct vport *patch_create(const struct vport_parms *parms) if (err) goto error_free_patchconf; - vport_gen_rand_ether_addr(patchconf->eth_addr); + random_ether_addr(patchconf->eth_addr); rcu_assign_pointer(patch_vport->patchconf, patchconf); -- 2.30.2