From owner-p4-projects@FreeBSD.ORG Fri Aug 28 23:30:09 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 356EA106591B; Fri, 28 Aug 2009 23:30:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE41C106593F for ; Fri, 28 Aug 2009 23:30:08 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DCF918FC22 for ; Fri, 28 Aug 2009 23:30:08 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7SNU8Uj093821 for ; Fri, 28 Aug 2009 23:30:08 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7SNU8n3093819 for perforce@freebsd.org; Fri, 28 Aug 2009 23:30:08 GMT (envelope-from anchie@FreeBSD.org) Date: Fri, 28 Aug 2009 23:30:08 GMT Message-Id: <200908282330.n7SNU8n3093819@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to anchie@FreeBSD.org using -f From: Ana Kukec To: Perforce Change Reviews Cc: Subject: PERFORCE change 167941 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2009 23:30:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=167941 Change 167941 by anchie@anchie_malimis on 2009/08/28 23:29:47 Add tags to the outgoing RS/RA messages. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#9 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/raw_ip6.c#4 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#28 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#9 (text+ko) ==== @@ -628,6 +628,7 @@ struct llentry *ln = NULL; union nd_opts ndopts; struct mbuf *chain = NULL; + struct m_tag *mtag; struct sockaddr_in6 sin6; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/raw_ip6.c#4 (text+ko) ==== @@ -99,6 +99,7 @@ #include #include #include +#include #ifdef IPSEC #include @@ -367,6 +368,7 @@ #endif { struct mbuf *control; + struct m_tag *mtag; struct socket *so; struct sockaddr_in6 *dstsock; struct in6_addr *dst; @@ -506,6 +508,23 @@ *p = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen); } + /* Send RA/RS messages to user land for protection, before sending + * them to rtadvd/rtsol. + */ + if (send_input_hook != NULL) { + 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); + } + } + } + error = ip6_output(m, optp, NULL, 0, in6p->in6p_moptions, &oifp, in6p); if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { if (oifp) ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#28 (text+ko) ==== @@ -31,7 +31,7 @@ struct sockaddr_in6 dst; struct icmp6_hdr *icmp6; int icmp6len; - //int *offp = NULL; + int offp; printf("send.c: send_output()\n"); @@ -97,8 +97,8 @@ return (ENOSYS); } - //*offp = sizeof (struct ip6_hdr); - //icmp6_rip6_input(&m, *offp); + offp = sizeof (struct ip6_hdr); + icmp6_rip6_input(&m, offp); /* * No error returned from nd6_??_input() so the only thing