Commit c34b8bb1 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

ipv6: icmp6: add SKB_DROP_REASON_IPV6_NDISC_NS_OTHERHOST



Hosts can often receive neighbour discovery messages
that are not for them.

Use a dedicated drop reason to make clear the packet is dropped
for this normal case.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 784d4477
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@
	FN(IPV6_NDISC_HOP_LIMIT)	\
	FN(IPV6_NDISC_BAD_CODE)		\
	FN(IPV6_NDISC_BAD_OPTIONS)	\
	FN(IPV6_NDISC_NS_OTHERHOST)	\
	FNe(MAX)

/**
@@ -333,6 +334,10 @@ enum skb_drop_reason {
	SKB_DROP_REASON_IPV6_NDISC_BAD_CODE,
	/** @SKB_DROP_REASON_IPV6_NDISC_BAD_OPTIONS: invalid NDISC options. */
	SKB_DROP_REASON_IPV6_NDISC_BAD_OPTIONS,
	/** @SKB_DROP_REASON_IPV6_NDISC_NS_OTHERHOST: NEIGHBOUR SOLICITATION
	 * for another host.
	 */
	SKB_DROP_REASON_IPV6_NDISC_NS_OTHERHOST,
	/**
	 * @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be
	 * used as a real 'reason'
+3 −1
Original line number Diff line number Diff line
@@ -921,9 +921,11 @@ static enum skb_drop_reason ndisc_recv_ns(struct sk_buff *skb)
					pneigh_enqueue(&nd_tbl, idev->nd_parms, n);
				goto out;
			}
		} else
		} else {
			SKB_DR_SET(reason, IPV6_NDISC_NS_OTHERHOST);
			goto out;
		}
	}

	if (is_router < 0)
		is_router = idev->cnf.forwarding;