Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/netinet6 Pull up revision 1.50 (requested by itojun...
details: https://anonhg.NetBSD.org/src/rev/a1ace35cef5c
branches: netbsd-1-6
changeset: 529420:a1ace35cef5c
user: he <he%NetBSD.org@localhost>
date: Thu Nov 21 17:53:47 2002 +0000
description:
Pull up revision 1.50 (requested by itojun in ticket #708):
Allow bind() of deprecated addresses, trusting userland
application knows what it's doing.
diffstat:
sys/netinet6/in6_pcb.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r f4b76f33bdf2 -r a1ace35cef5c sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c Thu Nov 21 17:48:00 2002 +0000
+++ b/sys/netinet6/in6_pcb.c Thu Nov 21 17:53:47 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.46.6.1 2002/08/27 09:33:35 lukem Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.46.6.2 2002/11/21 17:53:47 he 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.46.6.1 2002/08/27 09:33:35 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.46.6.2 2002/11/21 17:53:47 he 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
Home |
Main Index |
Thread Index |
Old Index