From owner-p4-projects@FreeBSD.ORG Tue Mar 30 23:50:18 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7A1071065676; Tue, 30 Mar 2010 23:50:18 +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 3E8FF1065672 for ; Tue, 30 Mar 2010 23:50:18 +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 120828FC17 for ; Tue, 30 Mar 2010 23:50:18 +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 o2UNoHxt041126 for ; Tue, 30 Mar 2010 23:50:17 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o2UNoHc2041124 for perforce@freebsd.org; Tue, 30 Mar 2010 23:50:17 GMT (envelope-from anchie@FreeBSD.org) Date: Tue, 30 Mar 2010 23:50:17 GMT Message-Id: <201003302350.o2UNoHc2041124@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 Precedence: bulk Cc: Subject: PERFORCE change 176322 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 23:50:18 -0000 http://p4web.freebsd.org/chv.cgi?CH=176322 Change 176322 by anchie@anchie_malimis on 2010/03/30 23:50:16 Partial cleanup. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#38 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#38 (text+ko) ==== @@ -154,48 +154,6 @@ } static int -send_input(struct mbuf *m, struct ifnet *ifp, int direction, int msglen) -{ - u_int len; - void *data; - struct ip6_hdr *ip6; - - /* - * Make sure to clear any possible internally embedded scope before - * passing the packet to userspace for SeND cryptographic signature - * validation to succeed. - */ - ip6 = mtod(m, struct ip6_hdr *); - in6_clearscope(&ip6->ip6_src); - in6_clearscope(&ip6->ip6_dst); - - len = m_length(m, NULL); - if (len != msglen) - printf("XXX-BZ %s: (m)len=%u (ip6)msglen=%d", __func__, len, msglen); - - /* - * XXX-BZ we can save the alloc/free here if not relying on rtsock.c:rt_msg3() - * but using a version operating on mbuf-to-mbuf copy. - */ - data = malloc(msglen, M_SEND, M_NOWAIT); - if (data == NULL) { - m_freem(m); - return (ENOBUFS); - } - - m_copydata(m, 0, msglen, data); - - /* - * Send incoming or outgoing traffic to the user space either to be - * protected (outgoing) or validated (incoming) according to rfc3971. */ - rt_securendmsg(ifp, direction, data, msglen); - - free(data, M_SEND); - - return (0); -} - -static int send_uattach(struct socket *so, int proto, struct thread *td) { @@ -204,7 +162,7 @@ return (EEXIST); /* XXX: Revisit this, hardocoded! */ - so->so_snd.sb_hiwat = 8192; + //so->so_snd.sb_hiwat = 8192; V_send_so = so; @@ -232,7 +190,7 @@ m_move_pkthdr(m, m0); ifp = ifnet_byindex_ref(snd_hdr->ifidx); - m_adj(m, sizeof(struct snd_hdr)); + m_adj(m, SEND_HDR_LEN); if (ifp) { int error = send_output(m, ifp, snd_hdr->direction); printf("error: %d\n", error); @@ -296,23 +254,20 @@ static void send_close(struct socket *so) { - /* XXX-AK: Memory leakage! */ - if (V_send_so) - V_send_so = NULL; - printf("pru_detach: send_close\n"); - //soisdisconnected(so); + if (V_send_so) + V_send_so = NULL; } struct pr_usrreqs send_usrreqs = { - .pru_attach = send_uattach, - .pru_send = sosend_rcv, - .pru_detach = send_close + .pru_attach = send_uattach, + .pru_send = sosend_rcv, + .pru_detach = send_close }; struct protosw send_protosw = { - .pr_type = SOCK_RAW, - .pr_protocol = IPPROTO_SEND, - .pr_usrreqs = &send_usrreqs + .pr_type = SOCK_RAW, + .pr_protocol = IPPROTO_SEND, + .pr_usrreqs = &send_usrreqs }; static int