Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Change global head-of-local-IP-address list from in_ifad...
details: https://anonhg.NetBSD.org/src/rev/15b704ca0507
branches: trunk
changeset: 555216:15b704ca0507
user: jonathan <jonathan%NetBSD.org@localhost>
date: Tue Nov 11 20:25:26 2003 +0000
description:
Change global head-of-local-IP-address list from in_ifaddr to
in_ifaddrhead. Recent changes in struct names caused a namespace
collision in fast-ipsec, which are most cleanly fixed by using
"in_ifaddrhead" as the listhead name.
diffstat:
sys/netccitt/if_x25subr.c | 6 +++---
sys/netinet/in.c | 18 +++++++++---------
sys/netinet/in_gif.c | 6 +++---
sys/netinet/in_pcb.c | 14 +++++++-------
sys/netinet/in_var.h | 4 ++--
sys/netinet/ip_icmp.c | 6 +++---
sys/netinet/ip_input.c | 10 +++++-----
sys/netipsec/ipsec_osdep.h | 6 ++----
8 files changed, 34 insertions(+), 36 deletions(-)
diffs (truncated from 305 to 300 lines):
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netccitt/if_x25subr.c
--- a/sys/netccitt/if_x25subr.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netccitt/if_x25subr.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_x25subr.c,v 1.32 2003/08/07 16:33:01 agc Exp $ */
+/* $NetBSD: if_x25subr.c,v 1.33 2003/11/11 20:25:26 jonathan Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_x25subr.c,v 1.32 2003/08/07 16:33:01 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_x25subr.c,v 1.33 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_inet.h"
#include "opt_iso.h"
@@ -622,7 +622,7 @@
*/
struct in_ifaddr *ina;
- for (ina = in_ifaddr.tqh_first; ina != 0;
+ for (ina = in_ifaddrhead.tqh_first; ina != 0;
ina = ina->ia_list.tqe_next)
if (ina->ia_ifp == ia->ia_ifp) {
my_addr = ina->ia_addr.sin_addr;
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/in.c
--- a/sys/netinet/in.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/in.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.92 2003/10/23 20:55:08 mycroft Exp $ */
+/* $NetBSD: in.c,v 1.93 2003/11/11 20:25:26 jonathan Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.92 2003/10/23 20:55:08 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.93 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_inet.h"
#include "opt_inet_conf.h"
@@ -170,11 +170,11 @@
struct in_ifaddr *ia;
if (subnetsarelocal) {
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list)
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list)
if ((in.s_addr & ia->ia_netmask) == ia->ia_net)
return (1);
} else {
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list)
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list)
if ((in.s_addr & ia->ia_subnetmask) == ia->ia_subnet)
return (1);
}
@@ -254,7 +254,7 @@
struct ifnet *ifp;
unsigned long maxmtu = 0;
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if ((ifp = ia->ia_ifp) == 0)
continue;
if ((ifp->if_flags & (IFF_UP|IFF_LOOPBACK)) != IFF_UP)
@@ -385,7 +385,7 @@
if (ia == 0)
return (ENOBUFS);
bzero((caddr_t)ia, sizeof *ia);
- TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list);
+ TAILQ_INSERT_TAIL(&in_ifaddrhead, ia, ia_list);
IFAREF(&ia->ia_ifa);
TAILQ_INSERT_TAIL(&ifp->if_addrlist, &ia->ia_ifa,
ifa_list);
@@ -547,7 +547,7 @@
LIST_REMOVE(ia, ia_hash);
TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list);
IFAFREE(&ia->ia_ifa);
- TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
+ TAILQ_REMOVE(&in_ifaddrhead, ia, ia_list);
if (ia->ia_allhosts != NULL)
in_delmulti(ia->ia_allhosts);
IFAFREE(&ia->ia_ifa);
@@ -896,7 +896,7 @@
prefix.s_addr &= mask.s_addr;
}
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if (rtinitflags(ia))
p = ia->ia_dstaddr.sin_addr;
else {
@@ -948,7 +948,7 @@
prefix.s_addr &= mask.s_addr;
}
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if (rtinitflags(ia))
p = ia->ia_dstaddr.sin_addr;
else {
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/in_gif.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.33 2003/08/22 21:53:03 itojun Exp $ */
+/* $NetBSD: in_gif.c,v 1.34 2003/11/11 20:25:26 jonathan Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.33 2003/08/22 21:53:03 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.34 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_inet.h"
#include "opt_iso.h"
@@ -336,7 +336,7 @@
return 0;
}
/* reject packets with broadcast on source */
- TAILQ_FOREACH(ia4, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia4, &in_ifaddrhead, ia_list) {
if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0)
continue;
if (ip->ip_src.s_addr == ia4->ia_broadaddr.sin_addr.s_addr)
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/in_pcb.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.90 2003/10/28 17:18:37 provos Exp $ */
+/* $NetBSD: in_pcb.c,v 1.91 2003/11/11 20:25:26 jonathan Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.90 2003/10/28 17:18:37 provos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.91 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -238,7 +238,7 @@
if (inp->inp_af != AF_INET)
return (EINVAL);
- if (TAILQ_FIRST(&in_ifaddr) == 0)
+ if (TAILQ_FIRST(&in_ifaddrhead) == 0)
return (EADDRNOTAVAIL);
if (inp->inp_lport || !in_nullhost(inp->inp_laddr))
return (EINVAL);
@@ -390,7 +390,7 @@
return (EAFNOSUPPORT);
if (sin->sin_port == 0)
return (EADDRNOTAVAIL);
- if (TAILQ_FIRST(&in_ifaddr) != 0) {
+ if (TAILQ_FIRST(&in_ifaddrhead) != 0) {
/*
* If the destination address is INADDR_ANY,
* use any local address (likely loopback).
@@ -401,9 +401,9 @@
if (in_nullhost(sin->sin_addr)) {
sin->sin_addr =
- TAILQ_FIRST(&in_ifaddr)->ia_addr.sin_addr;
+ TAILQ_FIRST(&in_ifaddrhead)->ia_addr.sin_addr;
} else if (sin->sin_addr.s_addr == INADDR_BROADCAST) {
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if (ia->ia_ifp->if_flags & IFF_BROADCAST) {
sin->sin_addr =
ia->ia_broadaddr.sin_addr;
@@ -992,7 +992,7 @@
sin->sin_port = fport;
if (ia == 0) {
/* Find 1st non-loopback AF_INET address */
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if (!(ia->ia_ifp->if_flags & IFF_LOOPBACK))
break;
}
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/in_var.h
--- a/sys/netinet/in_var.h Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/in_var.h Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_var.h,v 1.50 2003/10/23 20:55:08 mycroft Exp $ */
+/* $NetBSD: in_var.h,v 1.51 2003/11/11 20:25:26 jonathan Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
extern u_long in_ifaddrhash; /* size of hash table - 1 */
extern int in_ifaddrentries; /* total number of addrs */
extern struct in_ifaddrhashhead *in_ifaddrhashtbl; /* Hash table head */
-extern struct in_ifaddrhead in_ifaddr; /* List head (in ip_input) */
+extern struct in_ifaddrhead in_ifaddrhead; /* List head (in ip_input) */
extern u_long in_multihash; /* size of hash table - 1 */
extern int in_multientries; /* total number of addrs */
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/ip_icmp.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_icmp.c,v 1.78 2003/08/22 22:00:36 itojun Exp $ */
+/* $NetBSD: ip_icmp.c,v 1.79 2003/11/11 20:25:26 jonathan Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.78 2003/08/22 22:00:36 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.79 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_ipsec.h"
@@ -744,7 +744,7 @@
* interface.
*/
if (sin == (struct sockaddr_in *)0)
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {
if (ia->ia_ifp->if_flags & IFF_LOOPBACK)
continue;
sin = &ia->ia_addr;
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netinet/ip_input.c Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.180 2003/11/10 20:03:29 jonathan Exp $ */
+/* $NetBSD: ip_input.c,v 1.181 2003/11/11 20:25:26 jonathan Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.180 2003/11/10 20:03:29 jonathan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.181 2003/11/11 20:25:26 jonathan Exp $");
#include "opt_gateway.h"
#include "opt_pfil_hooks.h"
@@ -219,7 +219,7 @@
int ipqmaxlen = IFQ_MAXLEN;
u_long in_ifaddrhash; /* size of hash table - 1 */
int in_ifaddrentries; /* total number of addrs */
-struct in_ifaddrhead in_ifaddr;
+struct in_ifaddrhead in_ifaddrhead;
struct in_ifaddrhashhead *in_ifaddrhashtbl;
u_long in_multihash; /* size of hash table - 1 */
int in_multientries; /* total number of addrs */
@@ -360,7 +360,7 @@
ip_protox[pr->pr_protocol] = pr - inetsw;
LIST_INIT(&ipq);
ipintrq.ifq_maxlen = ipqmaxlen;
- TAILQ_INIT(&in_ifaddr);
+ TAILQ_INIT(&in_ifaddrhead);
in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IFADDR,
M_WAITOK, &in_ifaddrhash);
in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IPMADDR,
@@ -448,7 +448,7 @@
* If no IP addresses have been set yet but the interfaces
* are receiving, can't do anything with incoming packets yet.
*/
- if (TAILQ_FIRST(&in_ifaddr) == 0)
+ if (TAILQ_FIRST(&in_ifaddrhead) == 0)
goto bad;
ipstat.ips_total++;
/*
diff -r 07884b6e7f5d -r 15b704ca0507 sys/netipsec/ipsec_osdep.h
--- a/sys/netipsec/ipsec_osdep.h Tue Nov 11 19:18:14 2003 +0000
+++ b/sys/netipsec/ipsec_osdep.h Tue Nov 11 20:25:26 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec_osdep.h,v 1.3 2003/10/06 22:05:15 tls Exp $ */
+/* $NetBSD: ipsec_osdep.h,v 1.4 2003/11/11 20:25:26 jonathan Exp $ */
#ifndef NETIPSEC_OSDEP_H
#define NETIPSEC_OSDEP_H
@@ -214,7 +214,7 @@
/*
* 10. List of all known network interfaces.
- * FreeBSD has listhead in_ifaddread, with ia_link as link.
+ * FreeBSD has listhead in_ifaddrhead, with ia_link as link.
* NetBSD has listhead in_ifaddr, with ia_list as link.
* No name-clahses, so just #define the appropriate names on NetBSD.
* NB: Is it worth introducing iterator (find-first-list/find-next-list)
@@ -224,8 +224,6 @@
/* nothing to do for raw interface list */
#endif /* FreeBSD */
#ifdef __NetBSD__
Home |
Main Index |
Thread Index |
Old Index