From owner-p4-projects@FreeBSD.ORG Wed Jul 8 11:09:02 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CF93B1065678; Wed, 8 Jul 2009 11:09:01 +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 8D2471065672 for ; Wed, 8 Jul 2009 11:09:01 +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 5ED288FC0C for ; Wed, 8 Jul 2009 11:09:01 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n68B91TZ024635 for ; Wed, 8 Jul 2009 11:09:01 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n68B9145024633 for perforce@freebsd.org; Wed, 8 Jul 2009 11:09:01 GMT (envelope-from anchie@FreeBSD.org) Date: Wed, 8 Jul 2009 11:09:01 GMT Message-Id: <200907081109.n68B9145024633@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 165816 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: Wed, 08 Jul 2009 11:09:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=165816 Change 165816 by anchie@anchie_malimis on 2009/07/08 11:08:26 Reversed names for the input and output hook. Now, the input hook is used in the path that receives a packet from the wire and passes it up the stack to the user space. The output hook is used in the path where packets traverse from the user space to ND in kernel. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#16 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#14 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#5 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#15 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#14 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#16 (text+ko) ==== @@ -765,8 +765,8 @@ /* give up local */ /* Send incoming SeND-protected/ND packet to user space. */ - if (send_output_hook != NULL) - send_output_hook(m, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(m, ifp, SND_IN, ip6len); else { /* give up local */ nd6_rs_input(m, off, icmp6len); @@ -774,8 +774,8 @@ m = NULL; goto freeit; } - if (send_output_hook != NULL) - send_output_hook(n, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(n, ifp, SND_IN, ip6len); else nd6_rs_input(n, off, icmp6len); /* m stays. */ @@ -790,15 +790,15 @@ if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ - if (send_output_hook != NULL) - send_output_hook(m, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(m, ifp, SND_IN, ip6len); else nd6_ra_input(m, off, icmp6len); m = NULL; goto freeit; } - if (send_output_hook != NULL) - send_output_hoo(n, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(n, ifp, SND_IN, ip6len); else nd6_ra_input(n, off, icmp6len); /* m stays. */ @@ -813,8 +813,8 @@ if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ - if (send_output_hook != NULL) - send_output_hook(m, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(m, ifp, SND_IN, ip6len); else { /* give up local */ nd6_ns_input(m, off, icmp6len); @@ -822,8 +822,8 @@ m = NULL; goto freeit; } - if (send_output_hook != NULL) - send_output_hook(n, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(n, ifp, SND_IN, ip6len); else nd6_ns_input(n, off, icmp6len); /* m stays. */ @@ -838,8 +838,8 @@ if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ - if (send_output_hook != NULL) - send_output_hook(m, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(m, ifp, SND_IN, ip6len); else { /* give up local */ nd6_na_input(m, off, icmp6len); @@ -847,8 +847,8 @@ m = NULL; goto freeit; } - if (send_output_hook != NULL) - send_output_hook(n, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(n, ifp, SND_IN, ip6len); else nd6_na_input(n, off, icmp6len); /* m stays. */ @@ -863,8 +863,8 @@ if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ - if (send_output_hook != NULL) - send_output_hook(m, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(m, ifp, SND_IN, ip6len); else { /* give up local */ icmp6_redirect_input(m, off); @@ -872,8 +872,8 @@ m = NULL; goto freeit; } - if (send_output_hook != NULL) - send_output_hook(n, ifp, SND_IN, ip6len); + if (send_input_hook != NULL) + send_input_hook(n, ifp, SND_IN, ip6len); else icmp6_redirect_input(n, off); /* m stays. */ @@ -2780,7 +2780,7 @@ nd_rd->nd_rd_cksum = in6_cksum(m, IPPROTO_ICMPV6, sizeof(*ip6), ntohs(ip6->ip6_plen)); - if (send_output_hook != NULL) { + if (send_input_hook != NULL) { mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), M_NOWAIT); if (mtag == NULL) ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#14 (text+ko) ==== @@ -113,8 +113,8 @@ static struct sockaddr_in6 all1_sa; -int (*send_output_hook)(struct mbuf*, struct ifnet *, int, int); -int (*send_input_hook)(void); +int (*send_input_hook)(struct mbuf*, struct ifnet *, int, int); +int (*send_output_hook)(void); static int nd6_is_new_addr_neighbor __P((struct sockaddr_in6 *, struct ifnet *)); @@ -1911,12 +1911,12 @@ #endif /* send outgoing NS/NA/REDIRECT packet to sendd. */ - if (send_output_hook != NULL) { + if (send_input_hook != NULL) { mtag = m_tag_find(m, PACKET_TAG_ND_OUTGOING, NULL); if (mtag != NULL) { printf("%s: ND_OUTGOING tag found.\n", __FUNCTION__); nd_type = (unsigned short *)(mtag + 1); - send_output_hook(m, ifp, 0, ip6len); + send_input_hook(m, ifp, 0, ip6len); } else error = EOPNOTSUPP; ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#5 (text+ko) ==== @@ -564,7 +564,7 @@ nd_ns->nd_ns_cksum = in6_cksum(m, IPPROTO_ICMPV6, sizeof(*ip6), icmp6len); - if (send_output_hook != NULL) { + if (send_input_hook != NULL) { mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), M_NOWAIT); if (mtag == NULL) @@ -1080,7 +1080,7 @@ nd_na->nd_na_cksum = in6_cksum(m, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), icmp6len); - if (send_output_hook != NULL) { + if (send_input_hook != NULL) { mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), M_NOWAIT); if (mtag == NULL) ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#15 (text+ko) ==== @@ -12,7 +12,7 @@ #include static int -send_input(void) +send_output-ok(void) { /* @@ -25,7 +25,7 @@ } static int -send_output(struct mbuf *m, struct ifnet *ifp, int in, int msglen) +send_input(struct mbuf *m, struct ifnet *ifp, int in, int msglen) { struct ip6_hdr *ip6; ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#14 (text+ko) ==== @@ -1,6 +1,6 @@ /* send.c */ -extern int (*send_output_hook)(struct mbuf *, struct ifnet *, int, int); -extern int (*send_input_hook)(void); +extern int (*send_input_hook)(struct mbuf *, struct ifnet *, int, int); +extern int (*send_output_hook)(void); /* Message formats for messages from ND to applications (i.e. sendd) via the * routing socket. These messages are appended to an if_announcemsghdr