From 7017ab2caa8a94949cf2ae3d044a49408ce8d2e4 Mon Sep 17 00:00:00 2001 From: bluhm Date: Tue, 11 Sep 2018 21:04:03 +0000 Subject: [PATCH] Convert inetctlerrmap to u_char like inet6ctlerrmap. That is also what FreeBSD does. Remove old #if 0 version of inet6ctlerrmap. OK mpi@ --- sys/netinet/in.h | 6 +++--- sys/netinet/ip_input.c | 4 ++-- sys/netinet6/in6.h | 6 +++--- sys/netinet6/in6_pcb.c | 26 +------------------------- 4 files changed, 9 insertions(+), 33 deletions(-) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 7a83851a53a..5f7fb9e8a8c 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in.h,v 1.131 2018/07/10 11:34:12 mpi Exp $ */ +/* $OpenBSD: in.h,v 1.132 2018/09/11 21:04:03 bluhm Exp $ */ /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */ /* @@ -795,8 +795,8 @@ __END_DECLS #endif /* !_KERNEL */ #ifdef _KERNEL -extern const int inetctlerrmap[]; -extern const struct in_addr zeroin_addr; +extern const u_char inetctlerrmap[]; +extern const struct in_addr zeroin_addr; struct mbuf; struct sockaddr; diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 9d248132686..ced863c761a 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.340 2018/09/10 16:14:07 bluhm Exp $ */ +/* $OpenBSD: ip_input.c,v 1.341 2018/09/11 21:04:03 bluhm Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -1379,7 +1379,7 @@ ip_stripoptions(struct mbuf *m) ip->ip_len = htons(ntohs(ip->ip_len) - olen); } -const int inetctlerrmap[PRC_NCMDS] = { +const u_char inetctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 8381ba54f59..4afd4bbc602 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.102 2018/06/07 08:46:24 bluhm Exp $ */ +/* $OpenBSD: in6.h,v 1.103 2018/09/11 21:04:03 bluhm Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -404,8 +404,8 @@ typedef __socklen_t socklen_t; /* length type for network syscalls */ #endif /* __BSD_VISIBLE */ #ifdef _KERNEL -extern const u_char inet6ctlerrmap[]; -extern const struct in6_addr zeroin6_addr; +extern const u_char inet6ctlerrmap[]; +extern const struct in6_addr zeroin6_addr; struct mbuf; struct ifnet; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index a1c19967147..4dfc75bb246 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.105 2018/09/11 14:34:49 bluhm Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.106 2018/09/11 21:04:03 bluhm Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -119,32 +119,8 @@ #include -/* - * External globals - */ - -/* - * Globals - */ - const struct in6_addr zeroin6_addr; -/* - * Keep separate inet6ctlerrmap, because I may remap some of these. - * I also put it here, because, quite frankly, it belongs here, not in - * ip{v6,}_input(). - */ -#if 0 -u_char inet6ctlerrmap[PRC_NCMDS] = { - 0, 0, 0, 0, - 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, - EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, - EMSGSIZE, EHOSTUNREACH, 0, 0, - 0, 0, 0, 0, - ENOPROTOOPT -}; -#endif - struct inpcbhead * in6_pcbhash(struct inpcbtable *table, int rdom, const struct in6_addr *faddr, u_short fport, -- 2.20.1