diff --git a/test/test_gre.py b/test/test_gre.py
index 59d03e9..f00e446 100644
--- a/test/test_gre.py
+++ b/test/test_gre.py
@@ -12,7 +12,7 @@
 from scapy.packet import Raw
 from scapy.layers.l2 import Ether, Dot1Q, GRE
 from scapy.layers.inet import IP, UDP
-from scapy.layers.inet6 import ICMPv6ND_RA, IPv6
+from scapy.layers.inet6 import IPv6
 from scapy.volatile import RandMAC, RandIP
 
 from util import ppp, ppc
@@ -129,18 +129,9 @@
             pkts.append(p)
         return pkts
 
-    def verify_filter(self, capture, sent):
-        if not len(capture) == len(sent):
-            # filter out any IPv6 RAs from the capture
-            for p in capture:
-                if (p.haslayer(ICMPv6ND_RA)):
-                    capture.remove(p)
-        return capture
-
     def verify_tunneled_4o4(self, src_if, capture, sent,
                             tunnel_src, tunnel_dst):
 
-        capture = self.verify_filter(capture, sent)
         self.assertEqual(len(capture), len(sent))
 
         for i in range(len(capture)):
@@ -169,7 +160,6 @@
 
     def verify_tunneled_l2o4(self, src_if, capture, sent,
                              tunnel_src, tunnel_dst):
-        capture = self.verify_filter(capture, sent)
         self.assertEqual(len(capture), len(sent))
 
         for i in range(len(capture)):
@@ -203,7 +193,6 @@
     def verify_tunneled_vlano4(self, src_if, capture, sent,
                                tunnel_src, tunnel_dst, vlan):
         try:
-            capture = self.verify_filter(capture, sent)
             self.assertEqual(len(capture), len(sent))
         except:
             ppc("Unexpected packets captured:", capture)
@@ -242,7 +231,6 @@
                 raise
 
     def verify_decapped_4o4(self, src_if, capture, sent):
-        capture = self.verify_filter(capture, sent)
         self.assertEqual(len(capture), len(sent))
 
         for i in range(len(capture)):
@@ -266,7 +254,6 @@
                 raise
 
     def verify_decapped_6o4(self, src_if, capture, sent):
-        capture = self.verify_filter(capture, sent)
         self.assertEqual(len(capture), len(sent))
 
         for i in range(len(capture)):
diff --git a/test/test_lb.py b/test/test_lb.py
index 7037d80..9b5baae 100644
--- a/test/test_lb.py
+++ b/test/test_lb.py
@@ -1,7 +1,7 @@
 import socket
 
 from scapy.layers.inet import IP, UDP
-from scapy.layers.inet6 import ICMPv6ND_RA, IPv6
+from scapy.layers.inet6 import IPv6
 from scapy.layers.l2 import Ether, GRE
 from scapy.packet import Raw
 
@@ -95,16 +95,7 @@
         self.assertEqual(str(inner), str(self.info.data[IPver]))
 
     def checkCapture(self, gre4, isv4):
-        # RA might appear in capture
-        try:
-            out = self.pg0.get_capture()
-            # filter out any IPv6 RAs from the capture
-            for p in out:
-                if (p.haslayer(ICMPv6ND_RA)):
-                    out.remove(p)
-            self.assertEqual(len(out), 0)
-        except:
-            pass
+        self.pg0.assert_nothing_captured()
         out = self.pg1.get_capture()
         self.assertEqual(len(out), len(self.packets))
 
diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py
index 44bd1a2..634d7d3 100644
--- a/test/vpp_pg_interface.py
+++ b/test/vpp_pg_interface.py
@@ -5,10 +5,22 @@
 
 from scapy.layers.l2 import Ether, ARP
 from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6ND_NA,\
-    ICMPv6NDOptSrcLLAddr, ICMPv6NDOptDstLLAddr
+    ICMPv6NDOptSrcLLAddr, ICMPv6NDOptDstLLAddr, ICMPv6ND_RA, RouterAlert, \
+    IPv6ExtHdrHopByHop
 from util import ppp, ppc
 
 
+def is_ipv6_misc(p):
+    """ Is packet one of uninteresting IPv6 broadcasts? """
+    if p.haslayer(ICMPv6ND_RA):
+        return True
+    if p.haslayer(IPv6ExtHdrHopByHop):
+        for o in p[IPv6ExtHdrHopByHop].options:
+            if isinstance(o, RouterAlert):
+                return True
+    return False
+
+
 class VppPGInterface(VppInterface):
     """
     VPP packet-generator interface
@@ -118,15 +130,19 @@
         # FIXME this should be an API, but no such exists atm
         self.test.vapi.cli(self.input_cli)
 
-    def get_capture(self, remark=None):
+    def get_capture(self, remark=None, filter_fn=is_ipv6_misc):
         """
         Get captured packets
 
+        :param remark: remark printed into debug logs
+        :param filter_fn: filter applied to each packet, packets for which
+                          the filter returns True are removed from capture
         :returns: iterable packets
         """
         try:
             self.wait_for_capture_file()
             output = rdpcap(self.out_path)
+            self.test.logger.debug("Capture has %s packets" % len(output.res))
         except IOError:  # TODO
             self.test.logger.debug("File %s does not exist, probably because no"
                                    " packets arrived" % self.out_path)
@@ -135,12 +151,20 @@
                                 (self.name, remark))
             else:
                 raise Exception("No packets captured on %s" % self.name)
+        before = len(output.res)
+        if filter_fn:
+            output.res = [p for p in output.res if not filter_fn(p)]
+        removed = len(output.res) - before
+        if removed:
+            self.test.logger.debug(
+                "Filtered out %s packets from capture (returning %s)" %
+                (removed, len(output.res)))
         return output
 
     def assert_nothing_captured(self, remark=None):
         if os.path.isfile(self.out_path):
             try:
-                capture = self.get_capture()
+                capture = self.get_capture(remark=remark)
                 self.test.logger.error(
                     ppc("Unexpected packets captured:", capture))
             except:
@@ -234,7 +258,7 @@
         self.test.pg_start()
         self.test.logger.info(self.test.vapi.cli("show trace"))
         try:
-            arp_reply = pg_interface.get_capture()
+            arp_reply = pg_interface.get_capture(filter_fn=None)
         except:
             self.test.logger.info("No ARP received on port %s" %
                                   pg_interface.name)
@@ -274,7 +298,7 @@
         pg_interface.enable_capture()
         self.test.pg_start()
         self.test.logger.info(self.test.vapi.cli("show trace"))
-        replies = pg_interface.get_capture()
+        replies = pg_interface.get_capture(filter_fn=None)
         if replies is None or len(replies) == 0:
             self.test.logger.info(
                 "No NDP received on port %s" %
