From nobody@FreeBSD.org  Mon Dec 23 21:52:59 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id D9A32A18
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 21:52:59 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id C4F0E12AB
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 21:52:59 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBNLqxpV046262
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 21:52:59 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBNLqxvU046255;
	Mon, 23 Dec 2013 21:52:59 GMT
	(envelope-from nobody)
Message-Id: <201312232152.rBNLqxvU046255@oldred.freebsd.org>
Date: Mon, 23 Dec 2013 21:52:59 GMT
From: Sven-Thorsten Dietrich <sven@vyatta.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Cleanup ip6_mroute.c
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185148
>Category:       kern
>Synopsis:       [ip6] [patch] Cleanup ip6_mroute.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ae
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 23 22:00:00 UTC 2013
>Closed-Date:    Tue Jan 28 00:32:30 UTC 2014
>Last-Modified:  Tue Jan 28 00:40:01 UTC 2014
>Originator:     Sven-Thorsten Dietrich
>Release:        HEAD
>Organization:
Vyatta
>Environment:
N/A
>Description:
The ip6_mforward function has unnecessary nesting.

The first few lines check if a route exists, and if so, forward and return.

The remaining 200 lines of the function are devoted to handling up calls to the route daemon.

There is no need for the indentation.

Rework the code from:

if (rt) {
 		MFC6_UNLOCK();
 		return (ip6_mdq(m, ifp, rt));
} else {
/* 200 lines of necessary indentation */
}

TO:

if (rt) {
 		MFC6_UNLOCK();
 		return (ip6_mdq(m, ifp, rt));
}

/* same 200 lines without the extra tab */

There is no change in functionality and this patch doesn't attempt to join line-breaks.
(to retain clarity -- do that later)
>How-To-Repeat:

>Fix:
apply patch

Patch attached with submission follows:

Subject: Don't count table lookups from add_mfc.
Signed-off-by: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>

Index: sys/netinet6/ip6_mroute.c
===================================================================
--- sys/netinet6/ip6_mroute.c	(revision 256126)
+++ sys/netinet6/ip6_mroute.c	(working copy)
@@ -275,7 +275,6 @@
 #define MF6CFIND(o, g, rt) do { \
 	struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
 	rt = NULL; \
-	MRT6STAT_INC(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)) && \
@@ -1124,6 +1123,7 @@
 	/*
 	 * Determine forwarding mifs from the forwarding cache table
 	 */
+	MRT6STAT_INC(mrt6s_mfc_lookups);
 	MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
 
 	/* Entry exists, so forward if necessary */


>Release-Note:
>Audit-Trail:

From: Sven-Thorsten Dietrich <sdietric@brocade.com>
To: <bug-followup@FreeBSD.org>
Cc: Sven-Thorsten Dietrich <sven@vyatta.com>
Subject: Re: kern/185148: Cleanup ip6_mroute.c
Date: Mon, 23 Dec 2013 14:11:03 -0800

 --Apple-Mail=_BB732C14-A7BB-4E5E-A269-A086C61A64DD
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset="us-ascii"
 
 I inadvertently attached the wrong patch to the bug report.
 
 This is the correct patch against current head.
 
 
 --Apple-Mail=_BB732C14-A7BB-4E5E-A269-A086C61A64DD
 Content-Disposition: attachment;
 	filename="remove_unnecessary_else_clause_nesting.patch.txt"
 Content-Type: text/plain;
 	name="remove_unnecessary_else_clause_nesting.patch.txt"
 Content-Transfer-Encoding: 7bit
 
 Index: ip6_mroute.c
 ===================================================================
 --- ip6_mroute.c	(revision 259790)
 +++ ip6_mroute.c	(working copy)
 @@ -1130,206 +1130,206 @@
  	if (rt) {
  		MFC6_UNLOCK();
  		return (ip6_mdq(m, ifp, rt));
 -	} else {
 -		/*
 -		 * If we don't have a route for packet's origin,
 -		 * Make a copy of the packet &
 -		 * send message to routing daemon
 -		 */
 +	}
  
 -		struct mbuf *mb0;
 -		struct rtdetq *rte;
 -		u_long hash;
 -/*		int i, npkts;*/
 +	/*
 +	 * If we don't have a route for packet's origin,
 +	 * Make a copy of the packet &
 +	 * send message to routing daemon
 +	 */
 +
 +	struct mbuf *mb0;
 +	struct rtdetq *rte;
 +	u_long hash;
 +/*	int i, npkts;*/
  #ifdef UPCALL_TIMING
 -		struct timeval tp;
 +	struct timeval tp;
  
 -		GET_TIME(tp);
 +	GET_TIME(tp);
  #endif /* UPCALL_TIMING */
  
 -		MRT6STAT_INC(mrt6s_no_route);
 +	MRT6STAT_INC(mrt6s_no_route);
  #ifdef MRT6DEBUG
 -		if (V_mrt6debug & (DEBUG_FORWARD | DEBUG_MFC))
 -			log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n",
 -			    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 -			    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
 +	if (V_mrt6debug & (DEBUG_FORWARD | DEBUG_MFC))
 +		log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n",
 +		    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 +		    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
  #endif
  
 -		/*
 -		 * Allocate mbufs early so that we don't do extra work if we
 -		 * are just going to fail anyway.
 -		 */
 -		rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6,
 -					      M_NOWAIT);
 -		if (rte == NULL) {
 +	/*
 +	 * Allocate mbufs early so that we don't do extra work if we
 +	 * are just going to fail anyway.
 +	 */
 +	rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6,
 +				      M_NOWAIT);
 +	if (rte == NULL) {
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
 +	mb0 = m_copy(m, 0, M_COPYALL);
 +	/*
 +	 * Pullup packet header if needed before storing it,
 +	 * as other references may modify it in the meantime.
 +	 */
 +	if (mb0 &&
 +	    (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 +		mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 +	if (mb0 == NULL) {
 +		free(rte, M_MRTABLE6);
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
 +
 +	/* is there an upcall waiting for this packet? */
 +	hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 +	for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 +		if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 +				       &rt->mf6c_origin.sin6_addr) &&
 +		    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 +				       &rt->mf6c_mcastgrp.sin6_addr) &&
 +		    (rt->mf6c_stall != NULL))
 +			break;
 +	}
 +
 +	if (rt == NULL) {
 +		struct mrt6msg *im;
 +#ifdef MRT6_OINIT
 +		struct omrt6msg *oim;
 +#endif
 +
 +		/* no upcall, so make a new entry */
 +		rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6,
 +					  M_NOWAIT);
 +		if (rt == NULL) {
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
 -		mb0 = m_copy(m, 0, M_COPYALL);
  		/*
 -		 * Pullup packet header if needed before storing it,
 -		 * as other references may modify it in the meantime.
 +		 * Make a copy of the header to send to the user
 +		 * level process
  		 */
 -		if (mb0 &&
 -		    (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 -			mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 -		if (mb0 == NULL) {
 +		mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 +
 +		if (mm == NULL) {
  			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
  
 -		/* is there an upcall waiting for this packet? */
 -		hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 -		for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 -			if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 -					       &rt->mf6c_origin.sin6_addr) &&
 -			    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 -					       &rt->mf6c_mcastgrp.sin6_addr) &&
 -			    (rt->mf6c_stall != NULL))
 -				break;
 -		}
 +		/*
 +		 * Send message to routing daemon
 +		 */
 +		sin6.sin6_addr = ip6->ip6_src;
  
 -		if (rt == NULL) {
 -			struct mrt6msg *im;
 +		im = NULL;
  #ifdef MRT6_OINIT
 -			struct omrt6msg *oim;
 +		oim = NULL;
  #endif
 -
 -			/* no upcall, so make a new entry */
 -			rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6,
 -						  M_NOWAIT);
 -			if (rt == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -			/*
 -			 * Make a copy of the header to send to the user
 -			 * level process
 -			 */
 -			mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 -
 -			if (mm == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -
 -			/*
 -			 * Send message to routing daemon
 -			 */
 -			sin6.sin6_addr = ip6->ip6_src;
 -
 -			im = NULL;
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			oim = NULL;
 +		case MRT6_OINIT:
 +			oim = mtod(mm, struct omrt6msg *);
 +			oim->im6_msgtype = MRT6MSG_NOCACHE;
 +			oim->im6_mbz = 0;
 +			break;
  #endif
 -			switch (V_ip6_mrouter_ver) {
 -#ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim = mtod(mm, struct omrt6msg *);
 -				oim->im6_msgtype = MRT6MSG_NOCACHE;
 -				oim->im6_mbz = 0;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im = mtod(mm, struct mrt6msg *);
 -				im->im6_msgtype = MRT6MSG_NOCACHE;
 -				im->im6_mbz = 0;
 -				break;
 -			default:
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (EINVAL);
 -			}
 +		case MRT6_INIT:
 +			im = mtod(mm, struct mrt6msg *);
 +			im->im6_msgtype = MRT6MSG_NOCACHE;
 +			im->im6_mbz = 0;
 +			break;
 +		default:
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (EINVAL);
 +		}
  
  #ifdef MRT6DEBUG
 -			if (V_mrt6debug & DEBUG_FORWARD)
 -				log(LOG_DEBUG,
 -				    "getting the iif info in the kernel\n");
 +		if (V_mrt6debug & DEBUG_FORWARD)
 +			log(LOG_DEBUG,
 +			    "getting the iif info in the kernel\n");
  #endif
  
 -			for (mifp = mif6table, mifi = 0;
 -			     mifi < nummifs && mifp->m6_ifp != ifp;
 -			     mifp++, mifi++)
 -				;
 +		for (mifp = mif6table, mifi = 0;
 +		     mifi < nummifs && mifp->m6_ifp != ifp;
 +		     mifp++, mifi++)
 +			;
  
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim->im6_mif = mifi;
 -				break;
 +		case MRT6_OINIT:
 +			oim->im6_mif = mifi;
 +			break;
  #endif
 -			case MRT6_INIT:
 -				im->im6_mif = mifi;
 -				break;
 -			}
 +		case MRT6_INIT:
 +			im->im6_mif = mifi;
 +			break;
 +		}
  
 -			if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 -				log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 -				    "socket queue full\n");
 -				MRT6STAT_INC(mrt6s_upq_sockfull);
 +		if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 +			log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 +			    "socket queue full\n");
 +			MRT6STAT_INC(mrt6s_upq_sockfull);
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (ENOBUFS);
 +		}
 +
 +		MRT6STAT_INC(mrt6s_upcalls);
 +
 +		/* insert new entry at head of hash chain */
 +		bzero(rt, sizeof(*rt));
 +		rt->mf6c_origin.sin6_family = AF_INET6;
 +		rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 +		rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 +		rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 +		rt->mf6c_expire = UPCALL_EXPIRE;
 +		n6expire[hash]++;
 +		rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 +
 +		/* link into table */
 +		rt->mf6c_next  = mf6ctable[hash];
 +		mf6ctable[hash] = rt;
 +		/* Add this entry to the end of the queue */
 +		rt->mf6c_stall = rte;
 +	} else {
 +		/* determine if q has overflowed */
 +		struct rtdetq **p;
 +		int npkts = 0;
 +
 +		for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 +			if (++npkts > MAX_UPQ6) {
 +				MRT6STAT_INC(mrt6s_upq_ovflw);
  				free(rte, M_MRTABLE6);
  				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
  				MFC6_UNLOCK();
 -				return (ENOBUFS);
 +				return (0);
  			}
  
 -			MRT6STAT_INC(mrt6s_upcalls);
 +		/* Add this entry to the end of the queue */
 +		*p = rte;
 +	}
  
 -			/* insert new entry at head of hash chain */
 -			bzero(rt, sizeof(*rt));
 -			rt->mf6c_origin.sin6_family = AF_INET6;
 -			rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 -			rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 -			rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 -			rt->mf6c_expire = UPCALL_EXPIRE;
 -			n6expire[hash]++;
 -			rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 -
 -			/* link into table */
 -			rt->mf6c_next  = mf6ctable[hash];
 -			mf6ctable[hash] = rt;
 -			/* Add this entry to the end of the queue */
 -			rt->mf6c_stall = rte;
 -		} else {
 -			/* determine if q has overflowed */
 -			struct rtdetq **p;
 -			int npkts = 0;
 -
 -			for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 -				if (++npkts > MAX_UPQ6) {
 -					MRT6STAT_INC(mrt6s_upq_ovflw);
 -					free(rte, M_MRTABLE6);
 -					m_freem(mb0);
 -					MFC6_UNLOCK();
 -					return (0);
 -				}
 -
 -			/* Add this entry to the end of the queue */
 -			*p = rte;
 -		}
 -
 -		rte->next = NULL;
 -		rte->m = mb0;
 -		rte->ifp = ifp;
 +	rte->next = NULL;
 +	rte->m = mb0;
 +	rte->ifp = ifp;
  #ifdef UPCALL_TIMING
 -		rte->t = tp;
 +	rte->t = tp;
  #endif /* UPCALL_TIMING */
  
 -		MFC6_UNLOCK();
 +	MFC6_UNLOCK();
  
 -		return (0);
 -	}
 +	return (0);
  }
  
  /*
 Index: ip6_mroute.h
 ===================================================================
 --- ip6_mroute.h	(revision 259790)
 +++ ip6_mroute.h	(working copy)
 @@ -145,11 +145,6 @@
  struct omrt6msg {
  	u_long	    unused1;
  	u_char	    im6_msgtype;		/* what type of message	    */
 -#if 0
 -#define MRT6MSG_NOCACHE	1
 -#define MRT6MSG_WRONGMIF	2
 -#define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
 -#endif
  	u_char	    im6_mbz;			/* must be zero		    */
  	u_char	    im6_mif;			/* mif rec'd on		    */
  	u_char	    unused2;
 
 --Apple-Mail=_BB732C14-A7BB-4E5E-A269-A086C61A64DD
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset="us-ascii"
 
 
 
 
 
 --Apple-Mail=_BB732C14-A7BB-4E5E-A269-A086C61A64DD--
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Dec 24 16:04:11 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185148 
State-Changed-From-To: open->patched 
State-Changed-By: ae 
State-Changed-When: Thu Jan 9 15:39:12 UTC 2014 
State-Changed-Why:  
Patched in head/. Thanks! 


Responsible-Changed-From-To: freebsd-net->ae 
Responsible-Changed-By: ae 
Responsible-Changed-When: Thu Jan 9 15:39:12 UTC 2014 
Responsible-Changed-Why:  
Take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185148 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185148: commit references a PR
Date: Thu,  9 Jan 2014 15:38:37 +0000 (UTC)

 Author: ae
 Date: Thu Jan  9 15:38:28 2014
 New Revision: 260485
 URL: http://svnweb.freebsd.org/changeset/base/260485
 
 Log:
   Remove extra nesting from X_ip6_mforward() function.
   Also remove disabled definitions from ip6_mroute.h.
   
   PR:		185148
   Sponsored by:	Yandex LLC
 
 Modified:
   head/sys/netinet6/ip6_mroute.c
   head/sys/netinet6/ip6_mroute.h
 
 Modified: head/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- head/sys/netinet6/ip6_mroute.c	Thu Jan  9 15:35:35 2014	(r260484)
 +++ head/sys/netinet6/ip6_mroute.c	Thu Jan  9 15:38:28 2014	(r260485)
 @@ -1044,11 +1044,19 @@ socket_send(struct socket *s, struct mbu
  int
  X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
  {
 +	struct rtdetq *rte;
 +	struct mbuf *mb0;
  	struct mf6c *rt;
  	struct mif6 *mifp;
  	struct mbuf *mm;
 +	u_long hash;
  	mifi_t mifi;
  	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 +#ifdef UPCALL_TIMING
 +	struct timeval tp;
 +
 +	GET_TIME(tp);
 +#endif /* UPCALL_TIMING */
  
  	MRT6_DLOG(DEBUG_FORWARD, "src %s, dst %s, ifindex %d",
  	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 @@ -1096,200 +1104,178 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	if (rt) {
  		MFC6_UNLOCK();
  		return (ip6_mdq(m, ifp, rt));
 -	} else {
 -		/*
 -		 * If we don't have a route for packet's origin,
 -		 * Make a copy of the packet &
 -		 * send message to routing daemon
 -		 */
 +	}
  
 -		struct mbuf *mb0;
 -		struct rtdetq *rte;
 -		u_long hash;
 -/*		int i, npkts;*/
 -#ifdef UPCALL_TIMING
 -		struct timeval tp;
 +	/*
 +	 * If we don't have a route for packet's origin,
 +	 * Make a copy of the packet & send message to routing daemon.
 +	 */
 +	MRT6STAT_INC(mrt6s_no_route);
 +	MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 +	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 +	    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
  
 -		GET_TIME(tp);
 -#endif /* UPCALL_TIMING */
 +	/*
 +	 * Allocate mbufs early so that we don't do extra work if we
 +	 * are just going to fail anyway.
 +	 */
 +	rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, M_NOWAIT);
 +	if (rte == NULL) {
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
 +	mb0 = m_copy(m, 0, M_COPYALL);
 +	/*
 +	 * Pullup packet header if needed before storing it,
 +	 * as other references may modify it in the meantime.
 +	 */
 +	if (mb0 && (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 +		mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 +	if (mb0 == NULL) {
 +		free(rte, M_MRTABLE6);
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
  
 -		MRT6STAT_INC(mrt6s_no_route);
 -		MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 -		    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 -		    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
 +	/* is there an upcall waiting for this packet? */
 +	hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 +	for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 +		if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 +		    &rt->mf6c_origin.sin6_addr) &&
 +		    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 +		    &rt->mf6c_mcastgrp.sin6_addr) && (rt->mf6c_stall != NULL))
 +			break;
 +	}
  
 -		/*
 -		 * Allocate mbufs early so that we don't do extra work if we
 -		 * are just going to fail anyway.
 -		 */
 -		rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6,
 -					      M_NOWAIT);
 -		if (rte == NULL) {
 +	if (rt == NULL) {
 +		struct mrt6msg *im;
 +#ifdef MRT6_OINIT
 +		struct omrt6msg *oim;
 +#endif
 +		/* no upcall, so make a new entry */
 +		rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6, M_NOWAIT);
 +		if (rt == NULL) {
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
 -		mb0 = m_copy(m, 0, M_COPYALL);
  		/*
 -		 * Pullup packet header if needed before storing it,
 -		 * as other references may modify it in the meantime.
 +		 * Make a copy of the header to send to the user
 +		 * level process
  		 */
 -		if (mb0 &&
 -		    (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 -			mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 -		if (mb0 == NULL) {
 +		mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 +		if (mm == NULL) {
  			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
  
 -		/* is there an upcall waiting for this packet? */
 -		hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 -		for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 -			if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 -					       &rt->mf6c_origin.sin6_addr) &&
 -			    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 -					       &rt->mf6c_mcastgrp.sin6_addr) &&
 -			    (rt->mf6c_stall != NULL))
 -				break;
 -		}
 -
 -		if (rt == NULL) {
 -			struct mrt6msg *im;
 -#ifdef MRT6_OINIT
 -			struct omrt6msg *oim;
 -#endif
 -
 -			/* no upcall, so make a new entry */
 -			rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6,
 -						  M_NOWAIT);
 -			if (rt == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -			/*
 -			 * Make a copy of the header to send to the user
 -			 * level process
 -			 */
 -			mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 -
 -			if (mm == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -
 -			/*
 -			 * Send message to routing daemon
 -			 */
 -			sin6.sin6_addr = ip6->ip6_src;
 -
 -			im = NULL;
 +		/*
 +		 * Send message to routing daemon
 +		 */
 +		sin6.sin6_addr = ip6->ip6_src;
 +		im = NULL;
  #ifdef MRT6_OINIT
 -			oim = NULL;
 +		oim = NULL;
  #endif
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim = mtod(mm, struct omrt6msg *);
 -				oim->im6_msgtype = MRT6MSG_NOCACHE;
 -				oim->im6_mbz = 0;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im = mtod(mm, struct mrt6msg *);
 -				im->im6_msgtype = MRT6MSG_NOCACHE;
 -				im->im6_mbz = 0;
 -				break;
 -			default:
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (EINVAL);
 -			}
 -
 -			MRT6_DLOG(DEBUG_FORWARD,
 -			    "getting the iif info in the kernel");
 +		case MRT6_OINIT:
 +			oim = mtod(mm, struct omrt6msg *);
 +			oim->im6_msgtype = MRT6MSG_NOCACHE;
 +			oim->im6_mbz = 0;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im = mtod(mm, struct mrt6msg *);
 +			im->im6_msgtype = MRT6MSG_NOCACHE;
 +			im->im6_mbz = 0;
 +			break;
 +		default:
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (EINVAL);
 +		}
  
 -			for (mifp = mif6table, mifi = 0;
 -			     mifi < nummifs && mifp->m6_ifp != ifp;
 -			     mifp++, mifi++)
 +		MRT6_DLOG(DEBUG_FORWARD, "getting the iif info in the kernel");
 +		for (mifp = mif6table, mifi = 0;
 +		    mifi < nummifs && mifp->m6_ifp != ifp; mifp++, mifi++)
  				;
  
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim->im6_mif = mifi;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im->im6_mif = mifi;
 -				break;
 -			}
 +		case MRT6_OINIT:
 +			oim->im6_mif = mifi;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im->im6_mif = mifi;
 +			break;
 +		}
 +
 +		if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 +			log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 +			    "socket queue full\n");
 +			MRT6STAT_INC(mrt6s_upq_sockfull);
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (ENOBUFS);
 +		}
 +
 +		MRT6STAT_INC(mrt6s_upcalls);
  
 -			if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 -				log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 -				    "socket queue full\n");
 -				MRT6STAT_INC(mrt6s_upq_sockfull);
 +		/* insert new entry at head of hash chain */
 +		bzero(rt, sizeof(*rt));
 +		rt->mf6c_origin.sin6_family = AF_INET6;
 +		rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 +		rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 +		rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 +		rt->mf6c_expire = UPCALL_EXPIRE;
 +		n6expire[hash]++;
 +		rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 +
 +		/* link into table */
 +		rt->mf6c_next  = mf6ctable[hash];
 +		mf6ctable[hash] = rt;
 +		/* Add this entry to the end of the queue */
 +		rt->mf6c_stall = rte;
 +	} else {
 +		/* determine if q has overflowed */
 +		struct rtdetq **p;
 +		int npkts = 0;
 +
 +		for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 +			if (++npkts > MAX_UPQ6) {
 +				MRT6STAT_INC(mrt6s_upq_ovflw);
  				free(rte, M_MRTABLE6);
  				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
  				MFC6_UNLOCK();
 -				return (ENOBUFS);
 +				return (0);
  			}
  
 -			MRT6STAT_INC(mrt6s_upcalls);
 -
 -			/* insert new entry at head of hash chain */
 -			bzero(rt, sizeof(*rt));
 -			rt->mf6c_origin.sin6_family = AF_INET6;
 -			rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 -			rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 -			rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 -			rt->mf6c_expire = UPCALL_EXPIRE;
 -			n6expire[hash]++;
 -			rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 -
 -			/* link into table */
 -			rt->mf6c_next  = mf6ctable[hash];
 -			mf6ctable[hash] = rt;
 -			/* Add this entry to the end of the queue */
 -			rt->mf6c_stall = rte;
 -		} else {
 -			/* determine if q has overflowed */
 -			struct rtdetq **p;
 -			int npkts = 0;
 -
 -			for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 -				if (++npkts > MAX_UPQ6) {
 -					MRT6STAT_INC(mrt6s_upq_ovflw);
 -					free(rte, M_MRTABLE6);
 -					m_freem(mb0);
 -					MFC6_UNLOCK();
 -					return (0);
 -				}
 -
 -			/* Add this entry to the end of the queue */
 -			*p = rte;
 -		}
 +		/* Add this entry to the end of the queue */
 +		*p = rte;
 +	}
  
 -		rte->next = NULL;
 -		rte->m = mb0;
 -		rte->ifp = ifp;
 +	rte->next = NULL;
 +	rte->m = mb0;
 +	rte->ifp = ifp;
  #ifdef UPCALL_TIMING
 -		rte->t = tp;
 +	rte->t = tp;
  #endif /* UPCALL_TIMING */
  
 -		MFC6_UNLOCK();
 +	MFC6_UNLOCK();
  
 -		return (0);
 -	}
 +	return (0);
  }
  
  /*
 
 Modified: head/sys/netinet6/ip6_mroute.h
 ==============================================================================
 --- head/sys/netinet6/ip6_mroute.h	Thu Jan  9 15:35:35 2014	(r260484)
 +++ head/sys/netinet6/ip6_mroute.h	Thu Jan  9 15:38:28 2014	(r260485)
 @@ -145,11 +145,6 @@ struct mrt6stat {
  struct omrt6msg {
  	u_long	    unused1;
  	u_char	    im6_msgtype;		/* what type of message	    */
 -#if 0
 -#define MRT6MSG_NOCACHE	1
 -#define MRT6MSG_WRONGMIF	2
 -#define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
 -#endif
  	u_char	    im6_mbz;			/* must be zero		    */
  	u_char	    im6_mif;			/* mif rec'd on		    */
  	u_char	    unused2;
 @@ -199,7 +194,7 @@ struct sioc_mif_req6 {
  	u_quad_t obytes;	/* Output byte count on mif		*/
  };
  
 -#if defined(_KERNEL) || defined(KERNEL)
 +#ifdef _KERNEL
  /*
   * The kernel's multicast-interface structure.
   */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185148: commit references a PR
Date: Thu,  9 Jan 2014 22:41:31 +0000 (UTC)

 Author: jmg
 Date: Thu Jan  9 22:41:18 2014
 New Revision: 260496
 URL: http://svnweb.freebsd.org/changeset/base/260496
 
 Log:
   revert part of r260485 which changes how part of the header gets
   included..  netstat uses -DKERNEL=1 to get these parts and breaks the
   build w/o it...
   
   melifaro@ says that ae@ is probably asleep, and the PR doesn't have
   this part of the patch...  Probably a local change got in by accident..
   
   PR:		185148
   Pointy hat to:	ae@
 
 Modified:
   head/sys/netinet6/ip6_mroute.h
 
 Modified: head/sys/netinet6/ip6_mroute.h
 ==============================================================================
 --- head/sys/netinet6/ip6_mroute.h	Thu Jan  9 22:40:51 2014	(r260495)
 +++ head/sys/netinet6/ip6_mroute.h	Thu Jan  9 22:41:18 2014	(r260496)
 @@ -194,7 +194,7 @@ struct sioc_mif_req6 {
  	u_quad_t obytes;	/* Output byte count on mif		*/
  };
  
 -#ifdef _KERNEL
 +#if defined(_KERNEL) || defined(KERNEL)
  /*
   * The kernel's multicast-interface structure.
   */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: ae 
State-Changed-When: Tue Jan 28 00:32:06 UTC 2014 
State-Changed-Why:  
Merged to stable/10 and stable/9. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185148 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185148: commit references a PR
Date: Tue, 28 Jan 2014 00:32:02 +0000 (UTC)

 Author: ae
 Date: Tue Jan 28 00:31:48 2014
 New Revision: 261219
 URL: http://svnweb.freebsd.org/changeset/base/261219
 
 Log:
   MFC r260485,260496:
     Remove extra nesting from X_ip6_mforward() function.
     Also remove disabled definitions from ip6_mroute.h.
   
     PR:		185148
 
 Modified:
   stable/9/sys/netinet6/ip6_mroute.c
   stable/9/sys/netinet6/ip6_mroute.h
 Directory Properties:
   stable/9/sys/   (props changed)
 
 Modified: stable/9/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- stable/9/sys/netinet6/ip6_mroute.c	Tue Jan 28 00:30:17 2014	(r261218)
 +++ stable/9/sys/netinet6/ip6_mroute.c	Tue Jan 28 00:31:48 2014	(r261219)
 @@ -1041,11 +1041,19 @@ socket_send(struct socket *s, struct mbu
  int
  X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
  {
 +	struct rtdetq *rte;
 +	struct mbuf *mb0;
  	struct mf6c *rt;
  	struct mif6 *mifp;
  	struct mbuf *mm;
 +	u_long hash;
  	mifi_t mifi;
  	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 +#ifdef UPCALL_TIMING
 +	struct timeval tp;
 +
 +	GET_TIME(tp);
 +#endif /* UPCALL_TIMING */
  
  	MRT6_DLOG(DEBUG_FORWARD, "src %s, dst %s, ifindex %d",
  	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 @@ -1093,200 +1101,178 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	if (rt) {
  		MFC6_UNLOCK();
  		return (ip6_mdq(m, ifp, rt));
 -	} else {
 -		/*
 -		 * If we don't have a route for packet's origin,
 -		 * Make a copy of the packet &
 -		 * send message to routing daemon
 -		 */
 +	}
  
 -		struct mbuf *mb0;
 -		struct rtdetq *rte;
 -		u_long hash;
 -/*		int i, npkts;*/
 -#ifdef UPCALL_TIMING
 -		struct timeval tp;
 +	/*
 +	 * If we don't have a route for packet's origin,
 +	 * Make a copy of the packet & send message to routing daemon.
 +	 */
 +	MRT6STAT_INC(mrt6s_no_route);
 +	MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 +	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 +	    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
  
 -		GET_TIME(tp);
 -#endif /* UPCALL_TIMING */
 +	/*
 +	 * Allocate mbufs early so that we don't do extra work if we
 +	 * are just going to fail anyway.
 +	 */
 +	rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, M_NOWAIT);
 +	if (rte == NULL) {
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
 +	mb0 = m_copy(m, 0, M_COPYALL);
 +	/*
 +	 * Pullup packet header if needed before storing it,
 +	 * as other references may modify it in the meantime.
 +	 */
 +	if (mb0 && (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 +		mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 +	if (mb0 == NULL) {
 +		free(rte, M_MRTABLE6);
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
  
 -		MRT6STAT_INC(mrt6s_no_route);
 -		MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 -		    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 -		    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
 +	/* is there an upcall waiting for this packet? */
 +	hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 +	for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 +		if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 +		    &rt->mf6c_origin.sin6_addr) &&
 +		    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 +		    &rt->mf6c_mcastgrp.sin6_addr) && (rt->mf6c_stall != NULL))
 +			break;
 +	}
  
 -		/*
 -		 * Allocate mbufs early so that we don't do extra work if we
 -		 * are just going to fail anyway.
 -		 */
 -		rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6,
 -					      M_NOWAIT);
 -		if (rte == NULL) {
 +	if (rt == NULL) {
 +		struct mrt6msg *im;
 +#ifdef MRT6_OINIT
 +		struct omrt6msg *oim;
 +#endif
 +		/* no upcall, so make a new entry */
 +		rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6, M_NOWAIT);
 +		if (rt == NULL) {
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
 -		mb0 = m_copy(m, 0, M_COPYALL);
  		/*
 -		 * Pullup packet header if needed before storing it,
 -		 * as other references may modify it in the meantime.
 +		 * Make a copy of the header to send to the user
 +		 * level process
  		 */
 -		if (mb0 &&
 -		    (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 -			mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 -		if (mb0 == NULL) {
 +		mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 +		if (mm == NULL) {
  			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
  
 -		/* is there an upcall waiting for this packet? */
 -		hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 -		for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 -			if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 -					       &rt->mf6c_origin.sin6_addr) &&
 -			    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 -					       &rt->mf6c_mcastgrp.sin6_addr) &&
 -			    (rt->mf6c_stall != NULL))
 -				break;
 -		}
 -
 -		if (rt == NULL) {
 -			struct mrt6msg *im;
 -#ifdef MRT6_OINIT
 -			struct omrt6msg *oim;
 -#endif
 -
 -			/* no upcall, so make a new entry */
 -			rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6,
 -						  M_NOWAIT);
 -			if (rt == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -			/*
 -			 * Make a copy of the header to send to the user
 -			 * level process
 -			 */
 -			mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 -
 -			if (mm == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -
 -			/*
 -			 * Send message to routing daemon
 -			 */
 -			sin6.sin6_addr = ip6->ip6_src;
 -
 -			im = NULL;
 +		/*
 +		 * Send message to routing daemon
 +		 */
 +		sin6.sin6_addr = ip6->ip6_src;
 +		im = NULL;
  #ifdef MRT6_OINIT
 -			oim = NULL;
 +		oim = NULL;
  #endif
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim = mtod(mm, struct omrt6msg *);
 -				oim->im6_msgtype = MRT6MSG_NOCACHE;
 -				oim->im6_mbz = 0;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im = mtod(mm, struct mrt6msg *);
 -				im->im6_msgtype = MRT6MSG_NOCACHE;
 -				im->im6_mbz = 0;
 -				break;
 -			default:
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (EINVAL);
 -			}
 -
 -			MRT6_DLOG(DEBUG_FORWARD,
 -			    "getting the iif info in the kernel");
 +		case MRT6_OINIT:
 +			oim = mtod(mm, struct omrt6msg *);
 +			oim->im6_msgtype = MRT6MSG_NOCACHE;
 +			oim->im6_mbz = 0;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im = mtod(mm, struct mrt6msg *);
 +			im->im6_msgtype = MRT6MSG_NOCACHE;
 +			im->im6_mbz = 0;
 +			break;
 +		default:
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (EINVAL);
 +		}
  
 -			for (mifp = mif6table, mifi = 0;
 -			     mifi < nummifs && mifp->m6_ifp != ifp;
 -			     mifp++, mifi++)
 +		MRT6_DLOG(DEBUG_FORWARD, "getting the iif info in the kernel");
 +		for (mifp = mif6table, mifi = 0;
 +		    mifi < nummifs && mifp->m6_ifp != ifp; mifp++, mifi++)
  				;
  
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim->im6_mif = mifi;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im->im6_mif = mifi;
 -				break;
 -			}
 +		case MRT6_OINIT:
 +			oim->im6_mif = mifi;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im->im6_mif = mifi;
 +			break;
 +		}
 +
 +		if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 +			log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 +			    "socket queue full\n");
 +			MRT6STAT_INC(mrt6s_upq_sockfull);
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (ENOBUFS);
 +		}
 +
 +		MRT6STAT_INC(mrt6s_upcalls);
  
 -			if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 -				log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 -				    "socket queue full\n");
 -				MRT6STAT_INC(mrt6s_upq_sockfull);
 +		/* insert new entry at head of hash chain */
 +		bzero(rt, sizeof(*rt));
 +		rt->mf6c_origin.sin6_family = AF_INET6;
 +		rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 +		rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 +		rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 +		rt->mf6c_expire = UPCALL_EXPIRE;
 +		n6expire[hash]++;
 +		rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 +
 +		/* link into table */
 +		rt->mf6c_next  = mf6ctable[hash];
 +		mf6ctable[hash] = rt;
 +		/* Add this entry to the end of the queue */
 +		rt->mf6c_stall = rte;
 +	} else {
 +		/* determine if q has overflowed */
 +		struct rtdetq **p;
 +		int npkts = 0;
 +
 +		for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 +			if (++npkts > MAX_UPQ6) {
 +				MRT6STAT_INC(mrt6s_upq_ovflw);
  				free(rte, M_MRTABLE6);
  				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
  				MFC6_UNLOCK();
 -				return (ENOBUFS);
 +				return (0);
  			}
  
 -			MRT6STAT_INC(mrt6s_upcalls);
 -
 -			/* insert new entry at head of hash chain */
 -			bzero(rt, sizeof(*rt));
 -			rt->mf6c_origin.sin6_family = AF_INET6;
 -			rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 -			rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 -			rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 -			rt->mf6c_expire = UPCALL_EXPIRE;
 -			n6expire[hash]++;
 -			rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 -
 -			/* link into table */
 -			rt->mf6c_next  = mf6ctable[hash];
 -			mf6ctable[hash] = rt;
 -			/* Add this entry to the end of the queue */
 -			rt->mf6c_stall = rte;
 -		} else {
 -			/* determine if q has overflowed */
 -			struct rtdetq **p;
 -			int npkts = 0;
 -
 -			for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 -				if (++npkts > MAX_UPQ6) {
 -					MRT6STAT_INC(mrt6s_upq_ovflw);
 -					free(rte, M_MRTABLE6);
 -					m_freem(mb0);
 -					MFC6_UNLOCK();
 -					return (0);
 -				}
 -
 -			/* Add this entry to the end of the queue */
 -			*p = rte;
 -		}
 +		/* Add this entry to the end of the queue */
 +		*p = rte;
 +	}
  
 -		rte->next = NULL;
 -		rte->m = mb0;
 -		rte->ifp = ifp;
 +	rte->next = NULL;
 +	rte->m = mb0;
 +	rte->ifp = ifp;
  #ifdef UPCALL_TIMING
 -		rte->t = tp;
 +	rte->t = tp;
  #endif /* UPCALL_TIMING */
  
 -		MFC6_UNLOCK();
 +	MFC6_UNLOCK();
  
 -		return (0);
 -	}
 +	return (0);
  }
  
  /*
 
 Modified: stable/9/sys/netinet6/ip6_mroute.h
 ==============================================================================
 --- stable/9/sys/netinet6/ip6_mroute.h	Tue Jan 28 00:30:17 2014	(r261218)
 +++ stable/9/sys/netinet6/ip6_mroute.h	Tue Jan 28 00:31:48 2014	(r261219)
 @@ -145,11 +145,6 @@ struct mrt6stat {
  struct omrt6msg {
  	u_long	    unused1;
  	u_char	    im6_msgtype;		/* what type of message	    */
 -#if 0
 -#define MRT6MSG_NOCACHE	1
 -#define MRT6MSG_WRONGMIF	2
 -#define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
 -#endif
  	u_char	    im6_mbz;			/* must be zero		    */
  	u_char	    im6_mif;			/* mif rec'd on		    */
  	u_char	    unused2;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185148: commit references a PR
Date: Tue, 28 Jan 2014 00:30:25 +0000 (UTC)

 Author: ae
 Date: Tue Jan 28 00:30:17 2014
 New Revision: 261218
 URL: http://svnweb.freebsd.org/changeset/base/261218
 
 Log:
   MFC r260485,260496:
     Remove extra nesting from X_ip6_mforward() function.
     Also remove disabled definitions from ip6_mroute.h.
   
     PR:		185148
 
 Modified:
   stable/10/sys/netinet6/ip6_mroute.c
   stable/10/sys/netinet6/ip6_mroute.h
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- stable/10/sys/netinet6/ip6_mroute.c	Mon Jan 27 22:26:15 2014	(r261217)
 +++ stable/10/sys/netinet6/ip6_mroute.c	Tue Jan 28 00:30:17 2014	(r261218)
 @@ -1044,11 +1044,19 @@ socket_send(struct socket *s, struct mbu
  int
  X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
  {
 +	struct rtdetq *rte;
 +	struct mbuf *mb0;
  	struct mf6c *rt;
  	struct mif6 *mifp;
  	struct mbuf *mm;
 +	u_long hash;
  	mifi_t mifi;
  	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 +#ifdef UPCALL_TIMING
 +	struct timeval tp;
 +
 +	GET_TIME(tp);
 +#endif /* UPCALL_TIMING */
  
  	MRT6_DLOG(DEBUG_FORWARD, "src %s, dst %s, ifindex %d",
  	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 @@ -1096,200 +1104,178 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	if (rt) {
  		MFC6_UNLOCK();
  		return (ip6_mdq(m, ifp, rt));
 -	} else {
 -		/*
 -		 * If we don't have a route for packet's origin,
 -		 * Make a copy of the packet &
 -		 * send message to routing daemon
 -		 */
 +	}
  
 -		struct mbuf *mb0;
 -		struct rtdetq *rte;
 -		u_long hash;
 -/*		int i, npkts;*/
 -#ifdef UPCALL_TIMING
 -		struct timeval tp;
 +	/*
 +	 * If we don't have a route for packet's origin,
 +	 * Make a copy of the packet & send message to routing daemon.
 +	 */
 +	MRT6STAT_INC(mrt6s_no_route);
 +	MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 +	    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 +	    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
  
 -		GET_TIME(tp);
 -#endif /* UPCALL_TIMING */
 +	/*
 +	 * Allocate mbufs early so that we don't do extra work if we
 +	 * are just going to fail anyway.
 +	 */
 +	rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, M_NOWAIT);
 +	if (rte == NULL) {
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
 +	mb0 = m_copy(m, 0, M_COPYALL);
 +	/*
 +	 * Pullup packet header if needed before storing it,
 +	 * as other references may modify it in the meantime.
 +	 */
 +	if (mb0 && (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 +		mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 +	if (mb0 == NULL) {
 +		free(rte, M_MRTABLE6);
 +		MFC6_UNLOCK();
 +		return (ENOBUFS);
 +	}
  
 -		MRT6STAT_INC(mrt6s_no_route);
 -		MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
 -		    ip6_sprintf(ip6bufs, &ip6->ip6_src),
 -		    ip6_sprintf(ip6bufd, &ip6->ip6_dst));
 +	/* is there an upcall waiting for this packet? */
 +	hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 +	for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 +		if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 +		    &rt->mf6c_origin.sin6_addr) &&
 +		    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 +		    &rt->mf6c_mcastgrp.sin6_addr) && (rt->mf6c_stall != NULL))
 +			break;
 +	}
  
 -		/*
 -		 * Allocate mbufs early so that we don't do extra work if we
 -		 * are just going to fail anyway.
 -		 */
 -		rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6,
 -					      M_NOWAIT);
 -		if (rte == NULL) {
 +	if (rt == NULL) {
 +		struct mrt6msg *im;
 +#ifdef MRT6_OINIT
 +		struct omrt6msg *oim;
 +#endif
 +		/* no upcall, so make a new entry */
 +		rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6, M_NOWAIT);
 +		if (rt == NULL) {
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
 -		mb0 = m_copy(m, 0, M_COPYALL);
  		/*
 -		 * Pullup packet header if needed before storing it,
 -		 * as other references may modify it in the meantime.
 +		 * Make a copy of the header to send to the user
 +		 * level process
  		 */
 -		if (mb0 &&
 -		    (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr)))
 -			mb0 = m_pullup(mb0, sizeof(struct ip6_hdr));
 -		if (mb0 == NULL) {
 +		mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 +		if (mm == NULL) {
  			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
  			MFC6_UNLOCK();
  			return (ENOBUFS);
  		}
  
 -		/* is there an upcall waiting for this packet? */
 -		hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst);
 -		for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
 -			if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src,
 -					       &rt->mf6c_origin.sin6_addr) &&
 -			    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
 -					       &rt->mf6c_mcastgrp.sin6_addr) &&
 -			    (rt->mf6c_stall != NULL))
 -				break;
 -		}
 -
 -		if (rt == NULL) {
 -			struct mrt6msg *im;
 -#ifdef MRT6_OINIT
 -			struct omrt6msg *oim;
 -#endif
 -
 -			/* no upcall, so make a new entry */
 -			rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6,
 -						  M_NOWAIT);
 -			if (rt == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -			/*
 -			 * Make a copy of the header to send to the user
 -			 * level process
 -			 */
 -			mm = m_copy(mb0, 0, sizeof(struct ip6_hdr));
 -
 -			if (mm == NULL) {
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (ENOBUFS);
 -			}
 -
 -			/*
 -			 * Send message to routing daemon
 -			 */
 -			sin6.sin6_addr = ip6->ip6_src;
 -
 -			im = NULL;
 +		/*
 +		 * Send message to routing daemon
 +		 */
 +		sin6.sin6_addr = ip6->ip6_src;
 +		im = NULL;
  #ifdef MRT6_OINIT
 -			oim = NULL;
 +		oim = NULL;
  #endif
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim = mtod(mm, struct omrt6msg *);
 -				oim->im6_msgtype = MRT6MSG_NOCACHE;
 -				oim->im6_mbz = 0;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im = mtod(mm, struct mrt6msg *);
 -				im->im6_msgtype = MRT6MSG_NOCACHE;
 -				im->im6_mbz = 0;
 -				break;
 -			default:
 -				free(rte, M_MRTABLE6);
 -				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
 -				MFC6_UNLOCK();
 -				return (EINVAL);
 -			}
 -
 -			MRT6_DLOG(DEBUG_FORWARD,
 -			    "getting the iif info in the kernel");
 +		case MRT6_OINIT:
 +			oim = mtod(mm, struct omrt6msg *);
 +			oim->im6_msgtype = MRT6MSG_NOCACHE;
 +			oim->im6_mbz = 0;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im = mtod(mm, struct mrt6msg *);
 +			im->im6_msgtype = MRT6MSG_NOCACHE;
 +			im->im6_mbz = 0;
 +			break;
 +		default:
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (EINVAL);
 +		}
  
 -			for (mifp = mif6table, mifi = 0;
 -			     mifi < nummifs && mifp->m6_ifp != ifp;
 -			     mifp++, mifi++)
 +		MRT6_DLOG(DEBUG_FORWARD, "getting the iif info in the kernel");
 +		for (mifp = mif6table, mifi = 0;
 +		    mifi < nummifs && mifp->m6_ifp != ifp; mifp++, mifi++)
  				;
  
 -			switch (V_ip6_mrouter_ver) {
 +		switch (V_ip6_mrouter_ver) {
  #ifdef MRT6_OINIT
 -			case MRT6_OINIT:
 -				oim->im6_mif = mifi;
 -				break;
 -#endif
 -			case MRT6_INIT:
 -				im->im6_mif = mifi;
 -				break;
 -			}
 +		case MRT6_OINIT:
 +			oim->im6_mif = mifi;
 +			break;
 +#endif
 +		case MRT6_INIT:
 +			im->im6_mif = mifi;
 +			break;
 +		}
 +
 +		if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 +			log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 +			    "socket queue full\n");
 +			MRT6STAT_INC(mrt6s_upq_sockfull);
 +			free(rte, M_MRTABLE6);
 +			m_freem(mb0);
 +			free(rt, M_MRTABLE6);
 +			MFC6_UNLOCK();
 +			return (ENOBUFS);
 +		}
 +
 +		MRT6STAT_INC(mrt6s_upcalls);
  
 -			if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
 -				log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
 -				    "socket queue full\n");
 -				MRT6STAT_INC(mrt6s_upq_sockfull);
 +		/* insert new entry at head of hash chain */
 +		bzero(rt, sizeof(*rt));
 +		rt->mf6c_origin.sin6_family = AF_INET6;
 +		rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 +		rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 +		rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 +		rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 +		rt->mf6c_expire = UPCALL_EXPIRE;
 +		n6expire[hash]++;
 +		rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 +
 +		/* link into table */
 +		rt->mf6c_next  = mf6ctable[hash];
 +		mf6ctable[hash] = rt;
 +		/* Add this entry to the end of the queue */
 +		rt->mf6c_stall = rte;
 +	} else {
 +		/* determine if q has overflowed */
 +		struct rtdetq **p;
 +		int npkts = 0;
 +
 +		for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 +			if (++npkts > MAX_UPQ6) {
 +				MRT6STAT_INC(mrt6s_upq_ovflw);
  				free(rte, M_MRTABLE6);
  				m_freem(mb0);
 -				free(rt, M_MRTABLE6);
  				MFC6_UNLOCK();
 -				return (ENOBUFS);
 +				return (0);
  			}
  
 -			MRT6STAT_INC(mrt6s_upcalls);
 -
 -			/* insert new entry at head of hash chain */
 -			bzero(rt, sizeof(*rt));
 -			rt->mf6c_origin.sin6_family = AF_INET6;
 -			rt->mf6c_origin.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_origin.sin6_addr = ip6->ip6_src;
 -			rt->mf6c_mcastgrp.sin6_family = AF_INET6;
 -			rt->mf6c_mcastgrp.sin6_len = sizeof(struct sockaddr_in6);
 -			rt->mf6c_mcastgrp.sin6_addr = ip6->ip6_dst;
 -			rt->mf6c_expire = UPCALL_EXPIRE;
 -			n6expire[hash]++;
 -			rt->mf6c_parent = MF6C_INCOMPLETE_PARENT;
 -
 -			/* link into table */
 -			rt->mf6c_next  = mf6ctable[hash];
 -			mf6ctable[hash] = rt;
 -			/* Add this entry to the end of the queue */
 -			rt->mf6c_stall = rte;
 -		} else {
 -			/* determine if q has overflowed */
 -			struct rtdetq **p;
 -			int npkts = 0;
 -
 -			for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
 -				if (++npkts > MAX_UPQ6) {
 -					MRT6STAT_INC(mrt6s_upq_ovflw);
 -					free(rte, M_MRTABLE6);
 -					m_freem(mb0);
 -					MFC6_UNLOCK();
 -					return (0);
 -				}
 -
 -			/* Add this entry to the end of the queue */
 -			*p = rte;
 -		}
 +		/* Add this entry to the end of the queue */
 +		*p = rte;
 +	}
  
 -		rte->next = NULL;
 -		rte->m = mb0;
 -		rte->ifp = ifp;
 +	rte->next = NULL;
 +	rte->m = mb0;
 +	rte->ifp = ifp;
  #ifdef UPCALL_TIMING
 -		rte->t = tp;
 +	rte->t = tp;
  #endif /* UPCALL_TIMING */
  
 -		MFC6_UNLOCK();
 +	MFC6_UNLOCK();
  
 -		return (0);
 -	}
 +	return (0);
  }
  
  /*
 
 Modified: stable/10/sys/netinet6/ip6_mroute.h
 ==============================================================================
 --- stable/10/sys/netinet6/ip6_mroute.h	Mon Jan 27 22:26:15 2014	(r261217)
 +++ stable/10/sys/netinet6/ip6_mroute.h	Tue Jan 28 00:30:17 2014	(r261218)
 @@ -145,11 +145,6 @@ struct mrt6stat {
  struct omrt6msg {
  	u_long	    unused1;
  	u_char	    im6_msgtype;		/* what type of message	    */
 -#if 0
 -#define MRT6MSG_NOCACHE	1
 -#define MRT6MSG_WRONGMIF	2
 -#define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
 -#endif
  	u_char	    im6_mbz;			/* must be zero		    */
  	u_char	    im6_mif;			/* mif rec'd on		    */
  	u_char	    unused2;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
