Skip to content

Commit

Permalink
[IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile.
Browse files Browse the repository at this point in the history
There is the only way to reach ip_options compile with opt != NULL:

ip_options_get_finish
    opt->is_data = 1;
    ip_options_compile(opt, NULL)

So, checking for is_data inside opt != NULL branch is not needed.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
dlunev authored and davem330 committed Mar 22, 2008
1 parent ec3c098 commit 10fe7d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
optptr = iph + sizeof(struct iphdr);
opt->is_data = 0;
} else {
optptr = opt->is_data ? opt->__data :
(unsigned char *)&(ip_hdr(skb)[1]);
optptr = opt->__data;
iph = optptr - sizeof(struct iphdr);
}

Expand Down

0 comments on commit 10fe7d8

Please sign in to comment.