Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 move ia6->ia6_dad_ch to dp->dad_timer_ch, to ea...
details: https://anonhg.NetBSD.org/src/rev/6bbbda67bef4
branches: trunk
changeset: 484050:6bbbda67bef4
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Mar 24 04:09:04 2000 +0000
description:
move ia6->ia6_dad_ch to dp->dad_timer_ch, to ease KAME code sharing.
now in6_var.h does not need to pull sys/callout.h in.
diffstat:
sys/netinet6/in6.c | 3 +--
sys/netinet6/in6_ifattach.c | 5 ++---
sys/netinet6/in6_var.h | 6 +-----
sys/netinet6/nd6_nbr.c | 13 ++++++++-----
4 files changed, 12 insertions(+), 15 deletions(-)
diffs (132 lines):
diff -r 0fd7a68ffb95 -r 6bbbda67bef4 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Fri Mar 24 02:02:03 2000 +0000
+++ b/sys/netinet6/in6.c Fri Mar 24 04:09:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.27 2000/03/23 07:03:29 thorpej Exp $ */
+/* $NetBSD: in6.c,v 1.28 2000/03/24 04:09:04 itojun Exp $ */
/* $KAME: in6.c,v 1.63 2000/03/21 05:18:38 itojun Exp $ */
/*
@@ -461,7 +461,6 @@
if (ia == NULL)
return (ENOBUFS);
bzero((caddr_t)ia, sizeof(*ia));
- callout_init(&ia->ia6_dad_ch);
/* Initialize the address and masks */
ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
diff -r 0fd7a68ffb95 -r 6bbbda67bef4 sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c Fri Mar 24 02:02:03 2000 +0000
+++ b/sys/netinet6/in6_ifattach.c Fri Mar 24 04:09:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_ifattach.c,v 1.22 2000/03/23 07:03:29 thorpej Exp $ */
+/* $NetBSD: in6_ifattach.c,v 1.23 2000/03/24 04:09:05 itojun Exp $ */
/* $KAME: in6_ifattach.c,v 1.39 2000/03/02 09:24:45 itojun Exp $ */
/*
@@ -339,8 +339,7 @@
*/
ia = (struct in6_ifaddr *)malloc(sizeof(*ia), M_IFADDR, M_WAITOK);
bzero((caddr_t)ia, sizeof(*ia));
- callout_init(&ia->ia6_dad_ch);
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
+ ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
if (ifp->if_flags & IFF_POINTOPOINT)
ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&ia->ia_dstaddr;
else
diff -r 0fd7a68ffb95 -r 6bbbda67bef4 sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h Fri Mar 24 02:02:03 2000 +0000
+++ b/sys/netinet6/in6_var.h Fri Mar 24 04:09:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_var.h,v 1.13 2000/03/23 07:03:30 thorpej Exp $ */
+/* $NetBSD: in6_var.h,v 1.14 2000/03/24 04:09:05 itojun Exp $ */
/* $KAME: in6_var.h,v 1.29 2000/02/25 05:20:58 itojun Exp $ */
/*
@@ -68,8 +68,6 @@
#ifndef _NETINET6_IN6_VAR_H_
#define _NETINET6_IN6_VAR_H_
-#include <sys/callout.h>
-
/*
* Interface address, Internet version. One of these structures
* is allocated for each interface with an Internet address.
@@ -108,8 +106,6 @@
struct in6_addrlifetime ia6_lifetime; /* NULL = infty */
struct ifprefix *ia6_ifpr; /* back pointer to ifprefix */
-
- struct callout ia6_dad_ch;
};
/*
diff -r 0fd7a68ffb95 -r 6bbbda67bef4 sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c Fri Mar 24 02:02:03 2000 +0000
+++ b/sys/netinet6/nd6_nbr.c Fri Mar 24 04:09:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6_nbr.c,v 1.20 2000/03/23 07:03:31 thorpej Exp $ */
+/* $NetBSD: nd6_nbr.c,v 1.21 2000/03/24 04:09:05 itojun Exp $ */
/* $KAME: nd6_nbr.c,v 1.28 2000/02/26 06:53:11 itojun Exp $ */
/*
@@ -45,6 +45,7 @@
#include <sys/ioctl.h>
#include <sys/syslog.h>
#include <sys/queue.h>
+#include <sys/callout.h>
#include <net/if.h>
#include <net/if_types.h>
@@ -942,6 +943,7 @@
int dad_ns_ocount; /* NS sent so far */
int dad_ns_icount;
int dad_na_icount;
+ struct callout dad_timer_ch;
};
static struct dadq_head dadq;
@@ -1016,6 +1018,7 @@
return;
}
bzero(dp, sizeof(*dp));
+ callout_init(&dp->dad_timer_ch);
TAILQ_INSERT_TAIL(&dadq, (struct dadq *)dp, dad_list);
#ifdef ND6_DEBUG
@@ -1036,7 +1039,7 @@
dp->dad_ns_ocount = dp->dad_ns_tcount = 0;
if (!tick) {
nd6_dad_ns_output(dp, ifa);
- callout_reset(&ia->ia6_dad_ch,
+ callout_reset(&dp->dad_timer_ch,
nd_ifinfo[ifa->ifa_ifp->if_index].retrans * hz / 1000,
(void (*) __P((void *)))nd6_dad_timer, ifa);
} else {
@@ -1047,7 +1050,7 @@
else
ntick = *tick + random() % (hz / 2);
*tick = ntick;
- callout_reset(&ia->ia6_dad_ch, ntick,
+ callout_reset(&dp->dad_timer_ch, ntick,
(void (*) __P((void *)))nd6_dad_timer, ifa);
}
}
@@ -1105,7 +1108,7 @@
* We have more NS to go. Send NS packet for DAD.
*/
nd6_dad_ns_output(dp, ifa);
- callout_reset(&ia->ia6_dad_ch,
+ callout_reset(&dp->dad_timer_ch,
nd_ifinfo[ifa->ifa_ifp->if_index].retrans * hz / 1000,
(void (*) __P((void *)))nd6_dad_timer, ifa);
} else {
@@ -1206,7 +1209,7 @@
ia->ia6_flags |= IN6_IFF_DUPLICATED;
/* We are done with DAD, with duplicated address found. (failure) */
- callout_stop(&ia->ia6_dad_ch);
+ callout_stop(&dp->dad_timer_ch);
log(LOG_ERR, "%s: DAD complete for %s - duplicate found\n",
if_name(ifa->ifa_ifp), ip6_sprintf(&ia->ia_addr.sin6_addr));
Home |
Main Index |
Thread Index |
Old Index