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
This commit is contained in:
Andrey V. Elsukov 2018-04-13 16:13:59 +00:00
parent b8f915ab24
commit 56c989dff2

View File

@ -97,7 +97,8 @@ ip6_tryforward(struct mbuf *m)
* Fallback conditions to ip6_input for slow path processing. * Fallback conditions to ip6_input for slow path processing.
*/ */
ip6 = mtod(m, struct ip6_hdr *); 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_MULTICAST(&ip6->ip6_dst) ||
IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) ||
IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) ||