summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/net/raw_usrreq.c2
-rw-r--r--sys/netinet/tcp_subr.c4
-rw-r--r--sys/netinet/tcp_timewait.c4
-rw-r--r--sys/netinet6/in6_pcb.c2
-rw-r--r--sys/netipx/ipx_input.c2
-rw-r--r--sys/netipx/spx_usrreq.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c
index c45f119..4cb90ba 100644
--- a/sys/net/raw_usrreq.c
+++ b/sys/net/raw_usrreq.c
@@ -129,7 +129,7 @@ raw_ctlinput(cmd, arg, dummy)
void *dummy;
{
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
/* INCOMPLETE */
}
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 26aa1a6..6a176f3 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1138,7 +1138,7 @@ tcp_ctlinput(cmd, sa, vip)
notify = in_rtchange;
} else if (cmd == PRC_HOSTDEAD)
ip = 0;
- else if ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0)
+ else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0)
return;
if (ip) {
s = splnet();
@@ -1204,7 +1204,7 @@ tcp6_ctlinput(cmd, sa, d)
else if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
+ ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
return;
/* if the parameter is from icmp6, decode it. */
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 26aa1a6..6a176f3 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -1138,7 +1138,7 @@ tcp_ctlinput(cmd, sa, vip)
notify = in_rtchange;
} else if (cmd == PRC_HOSTDEAD)
ip = 0;
- else if ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0)
+ else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0)
return;
if (ip) {
s = splnet();
@@ -1204,7 +1204,7 @@ tcp6_ctlinput(cmd, sa, d)
else if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
+ ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
return;
/* if the parameter is from icmp6, decode it. */
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 84ea6a9..ab59d52 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -824,7 +824,7 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, notify)
u_int32_t flowinfo;
int errno, s;
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET6)
+ if ((unsigned)cmd >= PRC_NCMDS || dst->sa_family != AF_INET6)
return;
sa6_dst = (struct sockaddr_in6 *)dst;
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c
index 01e05a8..d62c95f 100644
--- a/sys/netipx/ipx_input.c
+++ b/sys/netipx/ipx_input.c
@@ -279,7 +279,7 @@ ipx_ctlinput(cmd, arg_as_sa, dummy)
caddr_t arg = (/* XXX */ caddr_t)arg_as_sa;
struct ipx_addr *ipx;
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
switch (cmd) {
struct sockaddr_ipx *sipx;
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index 8d9682b..371e85e 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -638,7 +638,7 @@ spx_ctlinput(cmd, arg_as_sa, dummy)
struct ipx_addr *na;
struct sockaddr_ipx *sipx;
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
switch (cmd) {
OpenPOWER on IntegriCloud