From owner-p4-projects@FreeBSD.ORG Wed Jul 15 16:38:38 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 281A61065674; Wed, 15 Jul 2009 16:38:38 +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 DC5A81065672 for ; Wed, 15 Jul 2009 16:38:37 +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 CA2758FC1D for ; Wed, 15 Jul 2009 16:38:37 +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 n6FGcbip002058 for ; Wed, 15 Jul 2009 16:38:37 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6FGcba7002056 for perforce@freebsd.org; Wed, 15 Jul 2009 16:38:37 GMT (envelope-from anchie@FreeBSD.org) Date: Wed, 15 Jul 2009 16:38:37 GMT Message-Id: <200907151638.n6FGcba7002056@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 166137 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, 15 Jul 2009 16:38:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=166137 Change 166137 by anchie@anchie_malimis on 2009/07/15 16:38:14 Pass mbuf containing SEND message to if_output(). Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#8 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#15 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#16 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#15 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#8 (text+ko) ==== @@ -506,7 +506,6 @@ info.rti_info[RTAX_DST]->sa_family >= AF_MAX || (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) { - printf("EINVAL 3"); senderr(EINVAL); } } @@ -525,7 +524,12 @@ case RTM_SND: printf("RTM_SND!"); - + m_adj(m, sizeof (struct rt_msghdr)); + printf("rtm->rtm_index = %d\n", rtm->rtm_index); + ifp = ifnet_byindex(rtm->rtm_index); + if (ifp) + send_output_hook(m, ifp, SND_OUT); + break; case RTM_ADD: if (info.rti_info[RTAX_GATEWAY] == NULL) senderr(EINVAL); ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#15 (text+ko) ==== @@ -113,8 +113,8 @@ static struct sockaddr_in6 all1_sa; -int (*send_input_hook)(struct mbuf*, struct ifnet *, int, int); -int (*send_output_hook)(void); +int (*send_input_hook)(struct mbuf *, struct ifnet *, int, int); +int (*send_output_hook)(struct mbuf *, struct ifnet *, int); static int nd6_is_new_addr_neighbor __P((struct sockaddr_in6 *, struct ifnet *)); @@ -1958,12 +1958,11 @@ */ if ((ifp->if_flags & IFF_LOOPBACK) != 0) { - printf("%s %d: if_output()...\n", __FUNCTION__, __LINE__); return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL)); } + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL); printf("%s %d: nakon if_output()\n", __FUNCTION__, __LINE__); - error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL); } return (error); ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#16 (text+ko) ==== @@ -4,24 +4,40 @@ #include #include #include +#include #include #include +#include +#include + #include +#include #include +#include static int -send_output-ok(void) +send_output(struct mbuf *m, struct ifnet *ifp, int in) { + struct ip6_hdr *ip6; + + printf("send_output\n"); /* - * Receive incoming (SEND-protected) or outgoing traffic (SEND-validated) - * from the SEND user space application. + * Receive incoming (SEND-protected) or outgoing traffic + * (SEND-validated) from the SEND user space application. * Outgoing packets are sent out using if_output(). - */ + */ + + ip6 = mtod(m, struct ip6_hdr *); + struct in6_addr dst = ip6->ip6_dst; - return (0); + /* + * From nd6.c: nd6_output_lle(). + * ToFix: kernel panic: Duplicate free of item (mbuf). + */ + return (*ifp->if_output)(ifp, m, (struct sockaddr *)&dst, NULL); } static int ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#15 (text+ko) ==== @@ -1,6 +1,6 @@ /* send.c */ extern int (*send_input_hook)(struct mbuf *, struct ifnet *, int, int); -extern int (*send_output_hook)(void); +extern int (*send_output_hook)(struct mbuf *, struct ifnet *, int); /* Message formats for messages from ND to applications (i.e. sendd) via the * routing socket. These messages are appended to an if_announcemsghdr