Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 PR/47408: Anthony Mallet: sendto(2) issue with ...



details:   https://anonhg.NetBSD.org/src/rev/637e7566df80
branches:  trunk
changeset: 783725:637e7566df80
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 06 00:17:13 2013 +0000

description:
PR/47408: Anthony Mallet: sendto(2) issue with IPv6 UDP datagrams
- don't connect when the local port is 0, just set the local port number.
- remove redundant assignment
XXX: pullup-6

diffstat:

 sys/netinet6/udp6_output.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 34bf4865ec74 -r 637e7566df80 sys/netinet6/udp6_output.c
--- a/sys/netinet6/udp6_output.c        Sat Jan 05 23:34:16 2013 +0000
+++ b/sys/netinet6/udp6_output.c        Sun Jan 06 00:17:13 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $        */
+/*     $NetBSD: udp6_output.c,v 1.44 2013/01/06 00:17:13 christos Exp $        */
 /*     $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.44 2013/01/06 00:17:13 christos Exp $");
 
 #include "opt_inet.h"
 
@@ -177,8 +177,6 @@
 
 
        if (sin6) {
-               faddr = &sin6->sin6_addr;
-
                /*
                 * IPv4 version of udp_output calls in_pcbconnect in this case,
                 * which needs splnet and affects performance.
@@ -292,10 +290,12 @@
                        if (error)
                                goto release;
 
-                       error = in6_pcbconnect(in6p, addr6, l);
+                       error = in6_pcbsetport(&lsin6, in6p, l);
 
-                       if (error)
+                       if (error) {
+                               in6p->in6p_laddr = in6addr_any;
                                goto release;
+                       }
                }
        } else {
                if (IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) {



Home | Main Index | Thread Index | Old Index