summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHisao Tanabe <xtanabe@gmail.com>2014-04-27 14:03:45 +0400
committerDavid S. Miller <davem@davemloft.net>2014-04-28 21:28:43 +0400
commit5a2b646ffe21e6014314b4d1df040e2553e39a3b (patch)
treea8a4402bf56216a3cd635ef032716d9ca42e7799 /net
parent266a16468432a77f2e1395b3de5df3ca699b1a9a (diff)
downloadlinux-5a2b646ffe21e6014314b4d1df040e2553e39a3b.tar.xz
ipv4: Use predefined value for readability
Signed-off-by: Hisao Tanabe <xtanabe@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_options.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index f4ab72e19af9..5e7aecea05cd 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -364,7 +364,7 @@ int ip_options_compile(struct net *net,
}
if (optptr[2] <= optlen) {
unsigned char *timeptr = NULL;
- if (optptr[2]+3 > optptr[1]) {
+ if (optptr[2]+3 > optlen) {
pp_ptr = optptr + 2;
goto error;
}
@@ -376,7 +376,7 @@ int ip_options_compile(struct net *net,
optptr[2] += 4;
break;
case IPOPT_TS_TSANDADDR:
- if (optptr[2]+7 > optptr[1]) {
+ if (optptr[2]+7 > optlen) {
pp_ptr = optptr + 2;
goto error;
}
@@ -390,7 +390,7 @@ int ip_options_compile(struct net *net,
optptr[2] += 8;
break;
case IPOPT_TS_PRESPEC:
- if (optptr[2]+7 > optptr[1]) {
+ if (optptr[2]+7 > optlen) {
pp_ptr = optptr + 2;
goto error;
}