aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-03-22 19:35:29 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-22 19:35:29 -0400
commitef722495c8867aacc1db0675a6737e5cf1e72e07 (patch)
treeb0bdff4d9743ff790c57c9dafd232854f57df624
parent10fe7d85e2e4042f703a10bed4123f2105eadad2 (diff)
[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>
-rw-r--r--include/net/inet_sock.h3
-rw-r--r--net/ipv4/cipso_ipv4.c1
-rw-r--r--net/ipv4/ip_options.c5
3 files changed, 1 insertions, 8 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 8660cb0fa0dd..b6db16d2766a 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -43,8 +43,7 @@ struct ip_options {
43 unsigned char srr; 43 unsigned char srr;
44 unsigned char rr; 44 unsigned char rr;
45 unsigned char ts; 45 unsigned char ts;
46 unsigned char is_data:1, 46 unsigned char is_strictroute:1,
47 is_strictroute:1,
48 srr_is_hit:1, 47 srr_is_hit:1,
49 is_changed:1, 48 is_changed:1,
50 rr_needaddr:1, 49 rr_needaddr:1,
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 8cd357f41283..4637ded3dba8 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1800,7 +1800,6 @@ int cipso_v4_sock_setattr(struct sock *sk,
1800 } 1800 }
1801 memcpy(opt->__data, buf, buf_len); 1801 memcpy(opt->__data, buf, buf_len);
1802 opt->optlen = opt_len; 1802 opt->optlen = opt_len;
1803 opt->is_data = 1;
1804 opt->cipso = sizeof(struct iphdr); 1803 opt->cipso = sizeof(struct iphdr);
1805 kfree(buf); 1804 kfree(buf);
1806 buf = NULL; 1805 buf = NULL;
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 7e94bf850a07..2fa411381b11 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -45,7 +45,6 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
45 memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options)); 45 memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options));
46 memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen); 46 memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen);
47 opt = &(IPCB(skb)->opt); 47 opt = &(IPCB(skb)->opt);
48 opt->is_data = 0;
49 48
50 if (opt->srr) 49 if (opt->srr)
51 memcpy(iph+opt->srr+iph[opt->srr+1]-4, &daddr, 4); 50 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)
95 94
96 memset(dopt, 0, sizeof(struct ip_options)); 95 memset(dopt, 0, sizeof(struct ip_options));
97 96
98 dopt->is_data = 1;
99
100 sopt = &(IPCB(skb)->opt); 97 sopt = &(IPCB(skb)->opt);
101 98
102 if (sopt->optlen == 0) { 99 if (sopt->optlen == 0) {
@@ -265,7 +262,6 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
265 iph = skb_network_header(skb); 262 iph = skb_network_header(skb);
266 opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr); 263 opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
267 optptr = iph + sizeof(struct iphdr); 264 optptr = iph + sizeof(struct iphdr);
268 opt->is_data = 0;
269 } else { 265 } else {
270 optptr = opt->__data; 266 optptr = opt->__data;
271 iph = optptr - sizeof(struct iphdr); 267 iph = optptr - sizeof(struct iphdr);
@@ -519,7 +515,6 @@ static int ip_options_get_finish(struct ip_options **optp,
519 while (optlen & 3) 515 while (optlen & 3)
520 opt->__data[optlen++] = IPOPT_END; 516 opt->__data[optlen++] = IPOPT_END;
521 opt->optlen = optlen; 517 opt->optlen = optlen;
522 opt->is_data = 1;
523 if (optlen && ip_options_compile(opt, NULL)) { 518 if (optlen && ip_options_compile(opt, NULL)) {
524 kfree(opt); 519 kfree(opt);
525 return -EINVAL; 520 return -EINVAL;