PERFORCE change 167950 for review

Ana Kukec anchie at FreeBSD.org
Sat Aug 29 09:22:58 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167950

Change 167950 by anchie at anchie_malimis on 2009/08/29 09:22:09

	Additional check before tagging RS/RA messages.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/raw_ip6.c#5 edit

Differences ...

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/raw_ip6.c#5 (text+ko) ====

@@ -508,20 +508,20 @@
 		*p = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
 	}
 
-	/* Send RA/RS messages to user land for protection, before sending 
+	/* 
+	 * Send RA/RS messages to user land for protection, before sending 
 	 * them to rtadvd/rtsol.
 	 */
-	if (send_input_hook != NULL) {
+	if (send_input_hook != NULL && 
+		so->so_proto->pr_protocol == IPPROTO_ICMPV6) {
 		switch (type) {
 		case ND_ROUTER_ADVERT:
 		case ND_ROUTER_SOLICIT:
-			if (send_input_hook != NULL) {
-				mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, 
-					sizeof(unsigned short), M_NOWAIT);
-				if (mtag == NULL)
-					goto bad;
-				m_tag_prepend(m, mtag);
-			}
+			mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, 
+				sizeof(unsigned short), M_NOWAIT);
+			if (mtag == NULL)
+				goto bad;
+			m_tag_prepend(m, mtag);
 		}
 	}
 


More information about the p4-projects mailing list