Skip to content

Commit

Permalink
ipv4: Use predefined value for readability
Browse files Browse the repository at this point in the history
Signed-off-by: Hisao Tanabe <xtanabe@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
xtanabe authored and davem330 committed Apr 28, 2014
1 parent 266a164 commit 5a2b646
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 5a2b646

Please sign in to comment.