Skip to content

Commit

Permalink
[IPV4]: Remove unused ip_options->is_data.
Browse files Browse the repository at this point in the history
ip_options->is_data is assigned only and never checked. The structure is
not a part of kernel interface to the userspace. So, it is safe to remove
this field.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Mar 22, 2008
1 parent 10fe7d8 commit ef72249
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions include/net/inet_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ struct ip_options {
unsigned char srr;
unsigned char rr;
unsigned char ts;
unsigned char is_data:1,
is_strictroute:1,
unsigned char is_strictroute:1,
srr_is_hit:1,
is_changed:1,
rr_needaddr:1,
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/cipso_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,6 @@ int cipso_v4_sock_setattr(struct sock *sk,
}
memcpy(opt->__data, buf, buf_len);
opt->optlen = opt_len;
opt->is_data = 1;
opt->cipso = sizeof(struct iphdr);
kfree(buf);
buf = NULL;
Expand Down
5 changes: 0 additions & 5 deletions net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options));
memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen);
opt = &(IPCB(skb)->opt);
opt->is_data = 0;

if (opt->srr)
memcpy(iph+opt->srr+iph[opt->srr+1]-4, &daddr, 4);
Expand Down Expand Up @@ -95,8 +94,6 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)

memset(dopt, 0, sizeof(struct ip_options));

dopt->is_data = 1;

sopt = &(IPCB(skb)->opt);

if (sopt->optlen == 0) {
Expand Down Expand Up @@ -265,7 +262,6 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
iph = skb_network_header(skb);
opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
optptr = iph + sizeof(struct iphdr);
opt->is_data = 0;
} else {
optptr = opt->__data;
iph = optptr - sizeof(struct iphdr);
Expand Down Expand Up @@ -519,7 +515,6 @@ static int ip_options_get_finish(struct ip_options **optp,
while (optlen & 3)
opt->__data[optlen++] = IPOPT_END;
opt->optlen = optlen;
opt->is_data = 1;
if (optlen && ip_options_compile(opt, NULL)) {
kfree(opt);
return -EINVAL;
Expand Down

0 comments on commit ef72249

Please sign in to comment.