From 0bdf5171c856a1657a79c24f1fd3c36189d3f13a Mon Sep 17 00:00:00 2001 From: Max Laier Date: Tue, 23 Aug 2005 14:13:17 +0000 Subject: [PATCH] Don't loop back packets that have been routed by pf. This fixes an endless loop where the same packet is sent over and over again. Obtained from: OpenBSD Reported by: Sergey Lapin Tested by: Sergey Lapin MFC after: 7 days --- sys/net/if_ethersubr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index eada2f90c7ee..2b3f7465032f 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -310,7 +310,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * on the wire). However, we don't do that here for security * reasons and compatibility with the original behavior. */ - if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { + if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1) && + m_tag_find(m, PACKET_TAG_PF_ROUTED, NULL) == NULL) { int csum_flags = 0; if (m->m_pkthdr.csum_flags & CSUM_IP)