Blame SOURCES/0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch

23d2ea
From f7cfef0838ab21316699cad18c3621ec0a67dd3f Mon Sep 17 00:00:00 2001
ecb9bb
From: RHEL Ninjas <example@example.com>
ecb9bb
Date: Fri, 25 Sep 2015 16:24:23 +0900
23d2ea
Subject: [PATCH 185/198] efinet: add filter for the first exclusive reopen of
23d2ea
 SNP
ecb9bb
ecb9bb
---
ecb9bb
 grub-core/net/drivers/efi/efinet.c | 24 ++++++++++++++++++++++++
ecb9bb
 1 file changed, 24 insertions(+)
ecb9bb
ecb9bb
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
ecb9bb
index fd47b8a..b6b5187 100644
ecb9bb
--- a/grub-core/net/drivers/efi/efinet.c
ecb9bb
+++ b/grub-core/net/drivers/efi/efinet.c
ecb9bb
@@ -479,6 +479,30 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
ecb9bb
       if (net->mode->state == GRUB_EFI_NETWORK_STARTED
ecb9bb
 	  && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
ecb9bb
 	continue;
ecb9bb
+
ecb9bb
+      /* Enable hardware receive filters if driver declares support for it.
ecb9bb
+	 We need unicast and broadcast and additionaly all nodes and
ecb9bb
+	 solicited multicast for IPv6. Solicited multicast is per-IPv6
ecb9bb
+	 address and we currently do not have API to do it so simply
ecb9bb
+	 try to enable receive of all multicast packets or evertyhing in
ecb9bb
+	 the worst case (i386 PXE driver always enables promiscuous too).
ecb9bb
+
ecb9bb
+	 This does trust firmware to do what it claims to do.
ecb9bb
+       */
ecb9bb
+      if (net->mode->receive_filter_mask)
ecb9bb
+	{
ecb9bb
+	  grub_uint32_t filters = GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST   |
ecb9bb
+				  GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST |
ecb9bb
+				  GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;
ecb9bb
+
ecb9bb
+	  filters &= net->mode->receive_filter_mask;
ecb9bb
+	  if (!(filters & GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST))
ecb9bb
+	    filters |= (net->mode->receive_filter_mask &
ecb9bb
+			GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS);
ecb9bb
+
ecb9bb
+	  efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL);
ecb9bb
+	}
ecb9bb
+
ecb9bb
       card->efi_net = net;
ecb9bb
     }
ecb9bb
     return;
ecb9bb
-- 
23d2ea
2.7.4
ecb9bb