From 34c3fec46966989b988175d8f51982b654e375b8 Mon Sep 17 00:00:00 2001 From: yamt Date: Fri, 29 Apr 2005 10:39:09 +0000 Subject: [PATCH] move decl of inetsw to its own header to avoid array of incomplete type. found by gcc4. reported by Adam Ciarcinski. --- sys/netinet/in_proto.c | 5 +++-- sys/netinet/in_proto.h | 39 +++++++++++++++++++++++++++++++++++++ sys/netinet/ip_icmp.c | 5 +++-- sys/netinet/ip_input.c | 5 +++-- sys/netinet/ip_var.h | 3 +-- sys/netinet/raw_ip.c | 5 +++-- sys/netinet6/ah_input.c | 5 +++-- sys/netinet6/esp_input.c | 5 +++-- sys/netinet6/ipcomp_input.c | 5 +++-- 9 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 sys/netinet/in_proto.h diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 78143a6b63d8..4b3f2fab8a4f 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,4 +1,4 @@ -/* $NetBSD: in_proto.c,v 1.68 2005/02/12 12:31:07 manu Exp $ */ +/* $NetBSD: in_proto.c,v 1.69 2005/04/29 10:39:09 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.68 2005/02/12 12:31:07 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.69 2005/04/29 10:39:09 yamt Exp $"); #include "opt_mrouting.h" #include "opt_eon.h" /* ISO CLNL over IP */ @@ -87,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.68 2005/02/12 12:31:07 manu Exp $"); #include #include #include +#include #ifdef INET6 #ifndef INET diff --git a/sys/netinet/in_proto.h b/sys/netinet/in_proto.h new file mode 100644 index 000000000000..6ce76734c254 --- /dev/null +++ b/sys/netinet/in_proto.h @@ -0,0 +1,39 @@ +/* $NetBSD: in_proto.h,v 1.1 2005/04/29 10:39:09 yamt Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_var.h 8.2 (Berkeley) 1/9/95 + */ + +#ifndef _NETINET_IN_PROTO_H_ +#define _NETINET_IN_PROTO_H_ + +extern const struct protosw inetsw[]; + +#endif /* _NETINET_IN_PROTO_H_ */ diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 026e9379cd5f..8b8b33380fec 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.91 2005/02/26 22:45:12 perry Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.92 2005/04/29 10:39:09 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -101,7 +101,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.91 2005/02/26 22:45:12 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.92 2005/04/29 10:39:09 yamt Exp $"); #include "opt_ipsec.h" @@ -126,6 +126,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.91 2005/02/26 22:45:12 perry Exp $"); #include #include #include +#include #include #ifdef IPSEC diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index e5248a4fa18b..0cf537a0e8f4 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.214 2005/04/18 21:50:25 yamt Exp $ */ +/* $NetBSD: ip_input.c,v 1.215 2005/04/29 10:39:09 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.214 2005/04/18 21:50:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.215 2005/04/29 10:39:09 yamt Exp $"); #include "opt_inet.h" #include "opt_gateway.h" @@ -131,6 +131,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.214 2005/04/18 21:50:25 yamt Exp $"); #include #include #include +#include #include #include #include diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index bad2961ce120..96156d1d46db 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_var.h,v 1.70 2005/04/07 12:22:47 yamt Exp $ */ +/* $NetBSD: ip_var.h,v 1.71 2005/04/29 10:39:09 yamt Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -192,7 +192,6 @@ struct ipflow { #define IP_HDR_ALIGNED_P(ip) ((((vaddr_t) (ip)) & 3) == 0) #endif -extern const struct protosw inetsw[]; extern struct domain inetdomain; extern struct ipstat ipstat; /* ip statistics */ diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 9c847729351e..221bf2132bfd 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.86 2005/03/11 06:16:16 atatat Exp $ */ +/* $NetBSD: raw_ip.c,v 1.87 2005/04/29 10:39:09 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.86 2005/03/11 06:16:16 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.87 2005/04/29 10:39:09 yamt Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -88,6 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.86 2005/03/11 06:16:16 atatat Exp $"); #include #include #include +#include #include #include diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index 7348a5a966de..d3ccbab7b7da 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ah_input.c,v 1.45 2005/04/23 14:05:28 manu Exp $ */ +/* $NetBSD: ah_input.c,v 1.46 2005/04/29 10:39:09 yamt Exp $ */ /* $KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ah_input.c,v 1.45 2005/04/23 14:05:28 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ah_input.c,v 1.46 2005/04/29 10:39:09 yamt Exp $"); #include "opt_inet.h" @@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: ah_input.c,v 1.45 2005/04/23 14:05:28 manu Exp $"); #include #include #include +#include #include #include #include diff --git a/sys/netinet6/esp_input.c b/sys/netinet6/esp_input.c index f33786f602ff..157cd3fe278f 100644 --- a/sys/netinet6/esp_input.c +++ b/sys/netinet6/esp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_input.c,v 1.36 2005/04/23 14:05:28 manu Exp $ */ +/* $NetBSD: esp_input.c,v 1.37 2005/04/29 10:39:09 yamt Exp $ */ /* $KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esp_input.c,v 1.36 2005/04/23 14:05:28 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esp_input.c,v 1.37 2005/04/29 10:39:09 yamt Exp $"); #include "opt_inet.h" @@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: esp_input.c,v 1.36 2005/04/23 14:05:28 manu Exp $"); #include #include #include +#include #include #include diff --git a/sys/netinet6/ipcomp_input.c b/sys/netinet6/ipcomp_input.c index 56fcb4ba89a0..dbd2315ccebe 100644 --- a/sys/netinet6/ipcomp_input.c +++ b/sys/netinet6/ipcomp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ipcomp_input.c,v 1.23 2005/04/23 14:05:28 manu Exp $ */ +/* $NetBSD: ipcomp_input.c,v 1.24 2005/04/29 10:39:09 yamt Exp $ */ /* $KAME: ipcomp_input.c,v 1.29 2001/09/04 08:43:19 itojun Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipcomp_input.c,v 1.23 2005/04/23 14:05:28 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipcomp_input.c,v 1.24 2005/04/29 10:39:09 yamt Exp $"); #include "opt_inet.h" @@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: ipcomp_input.c,v 1.23 2005/04/23 14:05:28 manu Exp $ #include #include #include +#include #include #include #include