Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 Move in6_ifaddr_list to a more proper place (fr...
details: https://anonhg.NetBSD.org/src/rev/40e3a042447b
branches: trunk
changeset: 346304:40e3a042447b
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jul 06 10:49:49 2016 +0000
description:
Move in6_ifaddr_list to a more proper place (from ip6_input.c to in6.c)
It's a similar place as the IPv4 address list, i.e., in.c.
More varibles will join together.
diffstat:
sys/netinet6/in6.c | 13 +++++++++++--
sys/netinet6/in6_proto.c | 8 ++++----
sys/netinet6/in6_var.h | 4 +++-
sys/netinet6/ip6_input.c | 7 +++----
4 files changed, 21 insertions(+), 11 deletions(-)
diffs (129 lines):
diff -r 23f1e3491a02 -r 40e3a042447b sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Wed Jul 06 09:20:42 2016 +0000
+++ b/sys/netinet6/in6.c Wed Jul 06 10:49:49 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.205 2016/07/06 07:52:53 ozaki-r Exp $ */
+/* $NetBSD: in6.c,v 1.206 2016/07/06 10:49:49 ozaki-r Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.205 2016/07/06 07:52:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.206 2016/07/06 10:49:49 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -142,12 +142,21 @@
const struct sockaddr_in6 sa6_any = {sizeof(sa6_any), AF_INET6,
0, 0, IN6ADDR_ANY_INIT, 0};
+struct pslist_head in6_ifaddr_list;
+
static int in6_lifaddr_ioctl(struct socket *, u_long, void *,
struct ifnet *);
static int in6_ifinit(struct ifnet *, struct in6_ifaddr *,
const struct sockaddr_in6 *, int);
static void in6_unlink_ifa(struct in6_ifaddr *, struct ifnet *);
+void
+in6_init(void)
+{
+
+ PSLIST_INIT(&in6_ifaddr_list);
+}
+
/*
* Add ownaddr as loopback rtentry. We previously add the route only if
* necessary (ex. on a p2p link). However, since we now manage addresses
diff -r 23f1e3491a02 -r 40e3a042447b sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c Wed Jul 06 09:20:42 2016 +0000
+++ b/sys/netinet6/in6_proto.c Wed Jul 06 10:49:49 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_proto.c,v 1.112 2016/04/26 08:44:45 ozaki-r Exp $ */
+/* $NetBSD: in6_proto.c,v 1.113 2016/07/06 10:49:49 ozaki-r Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.112 2016/04/26 08:44:45 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.113 2016/07/06 10:49:49 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_gateway.h"
@@ -421,7 +421,7 @@
bool in6_present = false;
static void
-in6_init(void)
+in6_dom_init(void)
{
in6_present = true;
@@ -429,7 +429,7 @@
struct domain inet6domain = {
.dom_family = AF_INET6, .dom_name = "internet6",
- .dom_init = in6_init, .dom_externalize = NULL, .dom_dispose = NULL,
+ .dom_init = in6_dom_init, .dom_externalize = NULL, .dom_dispose = NULL,
.dom_protosw = (const struct protosw *)inet6sw,
.dom_protoswNPROTOSW = (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])],
.dom_rtattach = rt_inithead,
diff -r 23f1e3491a02 -r 40e3a042447b sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h Wed Jul 06 09:20:42 2016 +0000
+++ b/sys/netinet6/in6_var.h Wed Jul 06 10:49:49 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_var.h,v 1.80 2016/07/06 07:52:53 ozaki-r Exp $ */
+/* $NetBSD: in6_var.h,v 1.81 2016/07/06 10:49:49 ozaki-r Exp $ */
/* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */
/*
@@ -730,6 +730,8 @@
} while (/*CONSTCOND*/ 0)
#endif
+void in6_init(void);
+
struct in6_multi *in6_addmulti(struct in6_addr *, struct ifnet *,
int *, int);
void in6_delmulti(struct in6_multi *);
diff -r 23f1e3491a02 -r 40e3a042447b sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c Wed Jul 06 09:20:42 2016 +0000
+++ b/sys/netinet6/ip6_input.c Wed Jul 06 10:49:49 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_input.c,v 1.162 2016/07/04 06:48:14 ozaki-r Exp $ */
+/* $NetBSD: ip6_input.c,v 1.163 2016/07/06 10:49:49 ozaki-r Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.162 2016/07/04 06:48:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.163 2016/07/06 10:49:49 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_gateway.h"
@@ -133,7 +133,6 @@
extern struct domain inet6domain;
u_char ip6_protox[IPPROTO_MAX];
-struct pslist_head in6_ifaddr_list;
pktqueue_t *ip6_pktq __read_mostly;
int ip6_forward_srcrt; /* XXX */
@@ -163,7 +162,7 @@
const struct ip6protosw *pr;
int i;
- PSLIST_INIT(&in6_ifaddr_list);
+ in6_init();
sysctl_net_inet6_ip6_setup(NULL);
pr = (const struct ip6protosw *)pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW);
Home |
Main Index |
Thread Index |
Old Index