Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 amove in6_{embed, recover}scope prototypes to in...
details: https://anonhg.NetBSD.org/src/rev/51037bce57cf
branches: trunk
changeset: 503546:51037bce57cf
user: itojun <itojun%NetBSD.org@localhost>
date: Thu Feb 08 14:56:15 2001 +0000
description:
amove in6_{embed,recover}scope prototypes to in6_var.h (kernel only).
add in6_clearscope. sync with kame
diffstat:
sys/netinet6/in6_pcb.h | 8 ++------
sys/netinet6/in6_src.c | 31 +++++++++++++++++++++++--------
sys/netinet6/in6_var.h | 11 +++++++++--
3 files changed, 34 insertions(+), 16 deletions(-)
diffs (106 lines):
diff -r 59addbdd29bb -r 51037bce57cf sys/netinet6/in6_pcb.h
--- a/sys/netinet6/in6_pcb.h Thu Feb 08 13:59:38 2001 +0000
+++ b/sys/netinet6/in6_pcb.h Thu Feb 08 14:56:15 2001 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: in6_pcb.h,v 1.13 2000/10/19 20:23:02 itojun Exp $ */
-/* $KAME: in6_pcb.h,v 1.28 2000/06/09 01:10:12 itojun Exp $ */
+/* $NetBSD: in6_pcb.h,v 1.14 2001/02/08 14:56:15 itojun Exp $ */
+/* $KAME: in6_pcb.h,v 1.44 2001/02/06 09:16:53 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -177,10 +177,6 @@
struct in6_addr *, int *));
int in6_selecthlim __P((struct in6pcb *, struct ifnet *));
int in6_pcbsetport __P((struct in6_addr *, struct in6pcb *));
-int in6_embedscope __P((struct in6_addr *, const struct sockaddr_in6 *,
- struct in6pcb *, struct ifnet **));
-int in6_recoverscope __P((struct sockaddr_in6 *, const struct in6_addr *,
- struct ifnet *));
extern struct rtentry *
in6_pcbrtentry __P((struct in6pcb *));
diff -r 59addbdd29bb -r 51037bce57cf sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c Thu Feb 08 13:59:38 2001 +0000
+++ b/sys/netinet6/in6_src.c Thu Feb 08 14:56:15 2001 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: in6_src.c,v 1.4 2000/08/26 11:03:46 itojun Exp $ */
-/* $KAME: in6_src.c,v 1.34 2000/08/26 10:00:45 itojun Exp $ */
+/* $NetBSD: in6_src.c,v 1.5 2001/02/08 14:56:16 itojun Exp $ */
+/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -102,9 +102,9 @@
extern struct ifnet loif[NLOOP];
/*
- * Return an IPv6 address, which is the most appropriate for given
+ * Return an IPv6 address, which is the most appropriate for a given
* destination and user specified options.
- * If necessary, this function lookups the routing table and return
+ * If necessary, this function lookups the routing table and returns
* an entry to the caller for later use.
*/
struct in6_addr *
@@ -246,12 +246,15 @@
}
if (ro->ro_rt == (struct rtentry *)0 ||
ro->ro_rt->rt_ifp == (struct ifnet *)0) {
+ struct sockaddr_in6 *sa6;
+
/* No route yet, so try to acquire one */
bzero(&ro->ro_dst, sizeof(struct sockaddr_in6));
- ro->ro_dst.sin6_family = AF_INET6;
- ro->ro_dst.sin6_len = sizeof(struct sockaddr_in6);
- ro->ro_dst.sin6_addr = *dst;
- ro->ro_dst.sin6_scope_id = dstsock->sin6_scope_id;
+ sa6 = (struct sockaddr_in6 *)&ro->ro_dst;
+ sa6->sin6_family = AF_INET6;
+ sa6->sin6_len = sizeof(struct sockaddr_in6);
+ sa6->sin6_addr = *dst;
+ sa6->sin6_scope_id = dstsock->sin6_scope_id;
if (IN6_IS_ADDR_MULTICAST(dst)) {
ro->ro_rt = rtalloc1(&((struct route *)ro)
->ro_dst, 0);
@@ -513,3 +516,15 @@
return 0;
}
+
+/*
+ * just clear the embedded scope identifer.
+ * XXX: currently used for bsdi4 only as a supplement function.
+ */
+void
+in6_clearscope(addr)
+ struct in6_addr *addr;
+{
+ if (IN6_IS_SCOPE_LINKLOCAL(addr))
+ addr->s6_addr16[1] = 0;
+}
diff -r 59addbdd29bb -r 51037bce57cf sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h Thu Feb 08 13:59:38 2001 +0000
+++ b/sys/netinet6/in6_var.h Thu Feb 08 14:56:15 2001 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: in6_var.h,v 1.16 2000/04/16 15:28:00 itojun Exp $ */
-/* $KAME: in6_var.h,v 1.31 2000/03/25 07:23:46 sumikawa Exp $ */
+/* $NetBSD: in6_var.h,v 1.17 2001/02/08 14:56:16 itojun Exp $ */
+/* $KAME: in6_var.h,v 1.52 2001/02/06 09:16:54 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -586,6 +586,13 @@
int in6_prefix_add_ifid __P((int iilen, struct in6_ifaddr *ia));
void in6_prefix_remove_ifid __P((int iilen, struct in6_ifaddr *ia));
void in6_purgeprefix __P((struct ifnet *));
+
+struct in6pcb;
+int in6_embedscope __P((struct in6_addr *, const struct sockaddr_in6 *,
+ struct in6pcb *, struct ifnet **));
+int in6_recoverscope __P((struct sockaddr_in6 *, const struct in6_addr *,
+ struct ifnet *));
+void in6_clearscope __P((struct in6_addr *));
#endif /* _KERNEL */
#endif /* _NETINET6_IN6_VAR_H_ */
Home |
Main Index |
Thread Index |
Old Index