diff options
author | Hisao Tanabe <xtanabe@gmail.com> | 2014-04-27 06:03:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-28 13:28:43 -0400 |
commit | 5a2b646ffe21e6014314b4d1df040e2553e39a3b (patch) | |
tree | a8a4402bf56216a3cd635ef032716d9ca42e7799 | |
parent | 266a16468432a77f2e1395b3de5df3ca699b1a9a (diff) |
ipv4: Use predefined value for readability
Signed-off-by: Hisao Tanabe <xtanabe@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/ip_options.c | 6 |
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, | |||
364 | } | 364 | } |
365 | if (optptr[2] <= optlen) { | 365 | if (optptr[2] <= optlen) { |
366 | unsigned char *timeptr = NULL; | 366 | unsigned char *timeptr = NULL; |
367 | if (optptr[2]+3 > optptr[1]) { | 367 | if (optptr[2]+3 > optlen) { |
368 | pp_ptr = optptr + 2; | 368 | pp_ptr = optptr + 2; |
369 | goto error; | 369 | goto error; |
370 | } | 370 | } |
@@ -376,7 +376,7 @@ int ip_options_compile(struct net *net, | |||
376 | optptr[2] += 4; | 376 | optptr[2] += 4; |
377 | break; | 377 | break; |
378 | case IPOPT_TS_TSANDADDR: | 378 | case IPOPT_TS_TSANDADDR: |
379 | if (optptr[2]+7 > optptr[1]) { | 379 | if (optptr[2]+7 > optlen) { |
380 | pp_ptr = optptr + 2; | 380 | pp_ptr = optptr + 2; |
381 | goto error; | 381 | goto error; |
382 | } | 382 | } |
@@ -390,7 +390,7 @@ int ip_options_compile(struct net *net, | |||
390 | optptr[2] += 8; | 390 | optptr[2] += 8; |
391 | break; | 391 | break; |
392 | case IPOPT_TS_PRESPEC: | 392 | case IPOPT_TS_PRESPEC: |
393 | if (optptr[2]+7 > optptr[1]) { | 393 | if (optptr[2]+7 > optlen) { |
394 | pp_ptr = optptr + 2; | 394 | pp_ptr = optptr + 2; |
395 | goto error; | 395 | goto error; |
396 | } | 396 | } |