From owner-p4-projects@FreeBSD.ORG Fri May 7 14:48:32 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 386C61065674; Fri, 7 May 2010 14:48:32 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F11F01065670 for ; Fri, 7 May 2010 14:48:31 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id DF7398FC17 for ; Fri, 7 May 2010 14:48:31 +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 o47EmV66017937 for ; Fri, 7 May 2010 14:48:31 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o47EmVmp017935 for perforce@freebsd.org; Fri, 7 May 2010 14:48:31 GMT (envelope-from anchie@FreeBSD.org) Date: Fri, 7 May 2010 14:48:31 GMT Message-Id: <201005071448.o47EmVmp017935@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 177906 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: Fri, 07 May 2010 14:48:32 -0000 http://p4web.freebsd.org/@@177906?ac=10 Change 177906 by anchie@anchie_malimis on 2010/05/07 14:48:07 Minor modifications of netinet6/send.c Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#40 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#30 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#17 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#44 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#40 (text+ko) ==== @@ -786,15 +786,11 @@ error = send_sendso_input_hook(m, SND_IN, ip6len); /* -1 == no app on SEND socket */ - if (!error) - return (IPPROTO_DONE); + if (error == -1) + nd6_rs_input(m, off, icmp6len); } - if ((send_sendso_input_hook != NULL - && error == -1) || - send_sendso_input_hook == NULL) { - /* give up local */ + if (send_sendso_input_hook == NULL) nd6_rs_input(m, off, icmp6len); - } m = NULL; goto freeit; } @@ -804,13 +800,11 @@ error = send_sendso_input_hook(n, SND_IN, ip6len); /* -1 == no app on SEND socket */ - if (!error) - return (IPPROTO_DONE); + if (error == -1) + nd6_rs_input(n, off, icmp6len); } - if ((send_sendso_input_hook != NULL && error == -1) - || (send_sendso_input_hook == NULL)) { + if (send_sendso_input_hook == NULL) nd6_rs_input(n, off, icmp6len); - } /* m stays. */ break; @@ -826,27 +820,22 @@ if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, SND_IN, ip6len); - if (!error) - return (IPPROTO_DONE); + if (error == -1) + nd6_ra_input(m, off, icmp6len); } - if ((send_sendso_input_hook != NULL - && error == -1) || - send_sendso_input_hook == NULL) { + if (send_sendso_input_hook == NULL) nd6_ra_input(m, off, icmp6len); - } m = NULL; goto freeit; } if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(n, SND_IN, ip6len); - if (!error) - return (IPPROTO_DONE); + if (error == -1) + nd6_ra_input(n, off, icmp6len); } - if ((send_sendso_input_hook != NULL && error == -1) - || (send_sendso_input_hook == NULL)) { + if (send_sendso_input_hook == NULL) nd6_ra_input(n, off, icmp6len); - } /* m stays. */ break; @@ -860,24 +849,23 @@ if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, SND_IN, ip6len); + if (error == -1) + nd6_ns_input(m, off, icmp6len); + } - if ((send_sendso_input_hook != NULL - && error == -1) || - send_sendso_input_hook == NULL) { - /* give up local */ + if (send_sendso_input_hook == NULL) nd6_ns_input(m, off, icmp6len); - } m = NULL; goto freeit; } if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(n, SND_IN, ip6len); + if (error == -1) + nd6_ns_input(n, off, icmp6len); } - if ((send_sendso_input_hook != NULL && error == -1) - || (send_sendso_input_hook == NULL)) { + if (send_sendso_input_hook == NULL) nd6_ns_input(n, off, icmp6len); - } /* m stays. */ break; @@ -893,26 +881,22 @@ if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, SND_IN, ip6len); - if (!error) - return (IPPROTO_DONE); + if (error == -1) + nd6_na_input(m, off, icmp6len); } - if ((send_sendso_input_hook != NULL - && error == -1) || - send_sendso_input_hook == NULL) { - /* give up local */ + if (send_sendso_input_hook == NULL) nd6_na_input(m, off, icmp6len); - } m = NULL; goto freeit; } if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(n, SND_IN, ip6len); + if (error == -1) + nd6_na_input(n, off, icmp6len); } - if ((send_sendso_input_hook != NULL && error == -1) - || (send_sendso_input_hook == NULL)) { + if (send_sendso_input_hook == NULL) nd6_na_input(n, off, icmp6len); - } /* m stays. */ break; @@ -924,34 +908,24 @@ goto badlen; if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { if (send_sendso_input_hook != NULL) { - error = send_sendso_input_hook(m, + error = send_sendso_input_hook(m, SND_IN, ip6len); - if (!error) - return (IPPROTO_DONE); - else - goto freeit; + if (error == -1) + icmp6_redirect_input(m, off); } - if ((send_sendso_input_hook != NULL - && error == -1) || - send_sendso_input_hook == NULL) { - /* give up local */ + if (send_sendso_input_hook == NULL) icmp6_redirect_input(m, off); - } m = NULL; goto freeit; } if (send_sendso_input_hook != NULL) { - error = send_sendso_input_hook(n, - SND_IN, ip6len); - if (!error) - return (IPPROTO_DONE); - else - goto freeit; + error = send_sendso_input_hook(n, + SND_IN, ip6len); + if (error == -1) + icmp6_redirect_input(n, off); } - if ((send_sendso_input_hook != NULL && error == -1) - || (send_sendso_input_hook == NULL)) { + if (send_sendso_input_hook == NULL) icmp6_redirect_input(n, off); - } /* m stays. */ break; ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#30 (text+ko) ==== ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#17 (text+ko) ==== ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#44 (text+ko) ==== @@ -91,7 +91,7 @@ icmp6 = (struct icmp6_hdr *)(ip6 + 1); /* - * Output the packet as icmp6.c:incpm6_input() would do. + * Output the packet as icmp6.c:icpm6_input() would do. * The mbuf is always consumed, so we do not have to * care about that. */ @@ -202,7 +202,7 @@ struct snd_hdr *snd_hdr = NULL; if (V_send_so == NULL) - goto freeit; + return (-1); /* * Make sure to clear any possible internally embedded scope before @@ -232,10 +232,6 @@ sbappendrecord_locked(&s->so_rcv, m); sorwakeup_locked(s); return (0); - -freeit: - m_freem(m); - return (-1); } static void