提交 5a2b646f 编写于 作者: H Hisao Tanabe 提交者: David S. Miller

ipv4: Use predefined value for readability

Signed-off-by: NHisao Tanabe <xtanabe@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 266a1646
...@@ -364,7 +364,7 @@ int ip_options_compile(struct net *net, ...@@ -364,7 +364,7 @@ int ip_options_compile(struct net *net,
} }
if (optptr[2] <= optlen) { if (optptr[2] <= optlen) {
unsigned char *timeptr = NULL; unsigned char *timeptr = NULL;
if (optptr[2]+3 > optptr[1]) { if (optptr[2]+3 > optlen) {
pp_ptr = optptr + 2; pp_ptr = optptr + 2;
goto error; goto error;
} }
...@@ -376,7 +376,7 @@ int ip_options_compile(struct net *net, ...@@ -376,7 +376,7 @@ int ip_options_compile(struct net *net,
optptr[2] += 4; optptr[2] += 4;
break; break;
case IPOPT_TS_TSANDADDR: case IPOPT_TS_TSANDADDR:
if (optptr[2]+7 > optptr[1]) { if (optptr[2]+7 > optlen) {
pp_ptr = optptr + 2; pp_ptr = optptr + 2;
goto error; goto error;
} }
...@@ -390,7 +390,7 @@ int ip_options_compile(struct net *net, ...@@ -390,7 +390,7 @@ int ip_options_compile(struct net *net,
optptr[2] += 8; optptr[2] += 8;
break; break;
case IPOPT_TS_PRESPEC: case IPOPT_TS_PRESPEC:
if (optptr[2]+7 > optptr[1]) { if (optptr[2]+7 > optlen) {
pp_ptr = optptr + 2; pp_ptr = optptr + 2;
goto error; goto error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册