Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 sync up use_deprecated handling with latest kame.



details:   https://anonhg.NetBSD.org/src/rev/13813b0bddde
branches:  trunk
changeset: 535520:13813b0bddde
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Aug 20 22:06:04 2002 +0000

description:
sync up use_deprecated handling with latest kame.
- bind(deprecated) is allowed, trusting userland app is doing the right thing
- use_deprecated default to 1

diffstat:

 sys/netinet6/in6_pcb.c   |  16 +++++++++++-----
 sys/netinet6/in6_proto.c |   6 +++---
 2 files changed, 14 insertions(+), 8 deletions(-)

diffs (68 lines):

diff -r e1f1ba97e7f3 -r 13813b0bddde sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c    Tue Aug 20 16:56:05 2002 +0000
+++ b/sys/netinet6/in6_pcb.c    Tue Aug 20 22:06:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_pcb.c,v 1.49 2002/06/11 19:40:00 itojun Exp $      */
+/*     $NetBSD: in6_pcb.c,v 1.50 2002/08/20 22:06:04 itojun Exp $      */
 /*     $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $        */
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.49 2002/06/11 19:40:00 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.50 2002/08/20 22:06:04 itojun Exp $");
 
 #include "opt_ipsec.h"
 
@@ -228,13 +228,19 @@
                         * bind to an anycast address might accidentally
                         * cause sending a packet with an anycast source
                         * address, so we forbid it.
+                        *
+                        * We should allow to bind to a deprecated address,
+                        * since the application dare to use it.
+                        * But, can we assume that they are careful enough
+                        * to check if the address is deprecated or not?
+                        * Maybe, as a safeguard, we should have a setsockopt
+                        * flag to control the bind(2) behavior against
+                        * deprecated addresses (default: forbid bind(2)).
                         */
                        if (ia &&
                            ((struct in6_ifaddr *)ia)->ia6_flags &
-                           (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|
-                            IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) {
+                           (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|IN6_IFF_DETACHED))
                                return(EADDRNOTAVAIL);
-                       }
                }
                if (lport) {
 #ifndef IPNOPRIVPORTS
diff -r e1f1ba97e7f3 -r 13813b0bddde sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c  Tue Aug 20 16:56:05 2002 +0000
+++ b/sys/netinet6/in6_proto.c  Tue Aug 20 22:06:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_proto.c,v 1.44 2002/08/17 22:15:58 itojun Exp $    */
+/*     $NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $    */
 /*     $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $      */
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.44 2002/08/17 22:15:58 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -270,7 +270,7 @@
 int    ip6_dad_count = 1;      /* DupAddrDetectionTransmits */
 u_int32_t ip6_flow_seq;
 int    ip6_auto_flowlabel = 1;
-int    ip6_use_deprecated = 0; /* allow deprecated addr (RFC2462 5.5.4) */
+int    ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
 int    ip6_rr_prune = 5;       /* router renumbering prefix
                                 * walk list every 5 sec. */
 int    ip6_v6only = 1;



Home | Main Index | Thread Index | Old Index