PERFORCE change 167941 for review
Ana Kukec
anchie at FreeBSD.org
Fri Aug 28 23:30:09 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167941
Change 167941 by anchie at 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 <netinet6/nd6.h>
#include <netinet6/raw_ip6.h>
#include <netinet6/scope6_var.h>
+#include <netinet6/send.h>
#ifdef IPSEC
#include <netipsec/ipsec.h>
@@ -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
More information about the p4-projects
mailing list