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

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