Hi All,
>From FreeBSD,
Only count table lookups when we're actually processing packets.
Index: sys/netinet6/ip6_mroute.c
===================================================================
RCS file: /cvs/src/sys/netinet6/ip6_mroute.c,v
retrieving revision 1.67
diff -u -p -u -p -r1.67 ip6_mroute.c
--- sys/netinet6/ip6_mroute.c 11 Nov 2013 09:15:35 -0000 1.67
+++ sys/netinet6/ip6_mroute.c 3 Mar 2014 12:33:06 -0000
@@ -190,7 +190,6 @@ static int pim6;
#define MF6CFIND(o, g, rt) do { \
struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
rt = NULL; \
- mrt6stat.mrt6s_mfc_lookups++; \
while (_rt) { \
if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \
IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \
@@ -247,7 +246,7 @@ int
ip6_mrouter_set(int cmd, struct socket *so, struct mbuf *m)
{
if (cmd != MRT6_INIT && so != ip6_mrouter)
- return (EACCES);
+ return (EPERM);
switch (cmd) {
case MRT6_INIT:
@@ -287,7 +286,8 @@ ip6_mrouter_set(int cmd, struct socket *
int
ip6_mrouter_get(int cmd, struct socket *so, struct mbuf **m)
{
- if (so != ip6_mrouter) return EACCES;
+ if (so != ip6_mrouter)
+ return (EPERM);
*m = m_get(M_WAIT, MT_SOOPTS);
@@ -998,7 +998,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct
*/
s = splsoftnet();
MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
-
+ mrt6stat.mrt6s_mfc_lookups++;
/* Entry exists, so forward if necessary */
if (rt) {
splx(s);