Skip to content

Commit ef72249

Browse files
dlunevdavem330
authored andcommitted
[IPV4]: Remove unused ip_options->is_data.
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>
1 parent 10fe7d8 commit ef72249

3 files changed

Lines changed: 1 addition & 8 deletions

File tree

‎include/net/inet_sock.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ struct ip_options {
4343
unsigned char srr;
4444
unsigned char rr;
4545
unsigned char ts;
46-
unsigned char is_data:1,
47-
is_strictroute:1,
46+
unsigned char is_strictroute:1,
4847
srr_is_hit:1,
4948
is_changed:1,
5049
rr_needaddr:1,

‎net/ipv4/cipso_ipv4.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,6 @@ int cipso_v4_sock_setattr(struct sock *sk,
18001800
}
18011801
memcpy(opt->__data, buf, buf_len);
18021802
opt->optlen = opt_len;
1803-
opt->is_data = 1;
18041803
opt->cipso = sizeof(struct iphdr);
18051804
kfree(buf);
18061805
buf = NULL;

‎net/ipv4/ip_options.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
4545
memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options));
4646
memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen);
4747
opt = &(IPCB(skb)->opt);
48-
opt->is_data = 0;
4948

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

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

98-
dopt->is_data = 1;
99-
10097
sopt = &(IPCB(skb)->opt);
10198

10299
if (sopt->optlen == 0) {
@@ -265,7 +262,6 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
265262
iph = skb_network_header(skb);
266263
opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
267264
optptr = iph + sizeof(struct iphdr);
268-
opt->is_data = 0;
269265
} else {
270266
optptr = opt->__data;
271267
iph = optptr - sizeof(struct iphdr);
@@ -519,7 +515,6 @@ static int ip_options_get_finish(struct ip_options **optp,
519515
while (optlen & 3)
520516
opt->__data[optlen++] = IPOPT_END;
521517
opt->optlen = optlen;
522-
opt->is_data = 1;
523518
if (optlen && ip_options_compile(opt, NULL)) {
524519
kfree(opt);
525520
return -EINVAL;

0 commit comments

Comments
 (0)