From e6638f67492125bc25eee5ba668c87534c194dd8 Mon Sep 17 00:00:00 2001 From: ae Date: Fri, 13 Apr 2018 16:13:59 +0000 Subject: [PATCH] Add check that mbuf had not multicast layer2 address. Such packets should be handled by ip6_mforward(). Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC --- sys/netinet6/ip6_fastfwd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c index e4c0f6da6a6e..f2d996910865 100644 --- a/sys/netinet6/ip6_fastfwd.c +++ b/sys/netinet6/ip6_fastfwd.c @@ -97,7 +97,8 @@ ip6_tryforward(struct mbuf *m) * Fallback conditions to ip6_input for slow path processing. */ ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_nxt == IPPROTO_HOPOPTS || + if ((m->m_flags & (M_BCAST | M_MCAST)) != 0 || + ip6->ip6_nxt == IPPROTO_HOPOPTS || IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) ||