Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 Style, localify, remove dead code, and fix typo...
details: https://anonhg.NetBSD.org/src/rev/a4fa2504a844
branches: trunk
changeset: 359123:a4fa2504a844
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Jan 30 15:54:02 2018 +0000
description:
Style, localify, remove dead code, and fix typos. No functional change.
diffstat:
sys/netinet6/in6.h | 4 +-
sys/netinet6/ip6_input.c | 61 ++++++++---------------------------------------
sys/netinet6/ip6_var.h | 3 +-
3 files changed, 14 insertions(+), 54 deletions(-)
diffs (182 lines):
diff -r 99e285bcfc0b -r a4fa2504a844 sys/netinet6/in6.h
--- a/sys/netinet6/in6.h Tue Jan 30 15:35:31 2018 +0000
+++ b/sys/netinet6/in6.h Tue Jan 30 15:54:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.h,v 1.88 2018/01/10 10:56:30 knakahara Exp $ */
+/* $NetBSD: in6.h,v 1.89 2018/01/30 15:54:02 maxv Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -555,7 +555,7 @@
#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
-#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
+#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimum logging interval */
#define IPV6CTL_ACCEPT_RTADV 12
#define IPV6CTL_KEEPFAITH 13
#define IPV6CTL_LOG_INTERVAL 14
diff -r 99e285bcfc0b -r a4fa2504a844 sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c Tue Jan 30 15:35:31 2018 +0000
+++ b/sys/netinet6/ip6_input.c Tue Jan 30 15:54:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_input.c,v 1.188 2018/01/30 15:35:31 maxv Exp $ */
+/* $NetBSD: ip6_input.c,v 1.189 2018/01/30 15:54:02 maxv 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.188 2018/01/30 15:35:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.189 2018/01/30 15:54:02 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_gateway.h"
@@ -141,7 +141,7 @@
static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *);
static int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *,
- u_int32_t *);
+ u_int32_t *);
static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
static void sysctl_net_inet6_ip6_setup(struct sysctllog **);
@@ -855,14 +855,14 @@
/* validation of the length of the header */
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m,
- sizeof(struct ip6_hdr), sizeof(struct ip6_hbh));
+ sizeof(struct ip6_hdr), sizeof(struct ip6_hbh));
if (hbh == NULL) {
IP6_STATINC(IP6_STAT_TOOSHORT);
return -1;
}
hbhlen = (hbh->ip6h_len + 1) << 3;
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr),
- hbhlen);
+ hbhlen);
if (hbh == NULL) {
IP6_STATINC(IP6_STAT_TOOSHORT);
return -1;
@@ -872,12 +872,12 @@
hbhlen -= sizeof(struct ip6_hbh);
if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh),
- hbhlen, rtalertp, plenp) < 0)
- return (-1);
+ hbhlen, rtalertp, plenp) < 0)
+ return -1;
*offp = off;
*mp = m;
- return (0);
+ return 0;
}
/*
@@ -1402,7 +1402,7 @@
/*
* get next header offset. m will be retained.
*/
-int
+static int
ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp)
{
struct ip6_hdr ip6;
@@ -1411,7 +1411,7 @@
/* just in case */
if (m == NULL)
- panic("ip6_nexthdr: m == NULL");
+ panic("%s: m == NULL", __func__);
if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len < off)
return -1;
@@ -1566,11 +1566,6 @@
static void
sysctl_net_inet6_ip6_setup(struct sysctllog **clog)
{
-#ifdef RFC2292
-#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))
-#else
-#define IS2292(x, y) (y)
-#endif
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT,
@@ -1614,26 +1609,6 @@
CTL_NET, PF_INET6, IPPROTO_IPV6,
IPV6CTL_DEFMTU, CTL_EOL);
#endif
-#ifdef __no_idea__
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
- CTLTYPE_INT, "forwsrcrt", NULL,
- NULL, 0, &?, 0,
- CTL_NET, PF_INET6, IPPROTO_IPV6,
- IPV6CTL_FORWSRCRT, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
- CTLTYPE_STRUCT, "mrtstats", NULL,
- NULL, 0, &?, sizeof(?),
- CTL_NET, PF_INET6, IPPROTO_IPV6,
- IPV6CTL_MRTSTATS, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
- CTLTYPE_?, "mrtproto", NULL,
- NULL, 0, &?, sizeof(?),
- CTL_NET, PF_INET6, IPPROTO_IPV6,
- IPV6CTL_MRTPROTO, CTL_EOL);
-#endif
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "maxfragpackets",
@@ -1642,20 +1617,6 @@
NULL, 0, &ip6_maxfragpackets, 0,
CTL_NET, PF_INET6, IPPROTO_IPV6,
IPV6CTL_MAXFRAGPACKETS, CTL_EOL);
-#ifdef __no_idea__
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
- CTLTYPE_INT, "sourcecheck", NULL,
- NULL, 0, &?, 0,
- CTL_NET, PF_INET6, IPPROTO_IPV6,
- IPV6CTL_SOURCECHECK, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
- CTLTYPE_INT, "sourcecheck_logint", NULL,
- NULL, 0, &?, 0,
- CTL_NET, PF_INET6, IPPROTO_IPV6,
- IPV6CTL_SOURCECHECK_LOGINT, CTL_EOL);
-#endif
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "accept_rtadv",
@@ -1687,7 +1648,7 @@
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "log_interval",
- SYSCTL_DESCR("Minumum interval between logging "
+ SYSCTL_DESCR("Minimum interval between logging "
"unroutable packets"),
NULL, 0, &ip6_log_interval, 0,
CTL_NET, PF_INET6, IPPROTO_IPV6,
diff -r 99e285bcfc0b -r a4fa2504a844 sys/netinet6/ip6_var.h
--- a/sys/netinet6/ip6_var.h Tue Jan 30 15:35:31 2018 +0000
+++ b/sys/netinet6/ip6_var.h Tue Jan 30 15:54:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_var.h,v 1.78 2018/01/30 14:49:25 maxv Exp $ */
+/* $NetBSD: ip6_var.h,v 1.79 2018/01/30 15:54:02 maxv Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
@@ -287,7 +287,6 @@
void ip6_freemoptions(struct ip6_moptions *);
int ip6_unknown_opt(u_int8_t *, struct mbuf *, int);
int ip6_get_prevhdr(struct mbuf *, int);
-int ip6_nexthdr(struct mbuf *, int, int, int *);
int ip6_lasthdr(struct mbuf *, int, int, int *);
struct m_tag *ip6_addaux(struct mbuf *);
Home |
Main Index |
Thread Index |
Old Index