diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-04-22 00:53:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-22 14:04:14 -0400 |
commit | b71d1d426d263b0b6cb5760322efebbfc89d4463 (patch) | |
tree | 226ca7390bd6187ec9139d2ccedd26fd94d8e57a /net/ipv4/ipip.c | |
parent | 5f8629c526b4f7e529a6d27bbd802c0dc7fcc357 (diff) |
inet: constify ip headers and in6_addr
Add const qualifiers to structs iphdr, ipv6hdr and in6_addr pointers
where possible, to make code intention more obvious.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index bfc17c5914e7..ef16377ec73f 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -319,7 +319,7 @@ static int ipip_err(struct sk_buff *skb, u32 info) | |||
319 | 8 bytes of packet payload. It means, that precise relaying of | 319 | 8 bytes of packet payload. It means, that precise relaying of |
320 | ICMP in the real Internet is absolutely infeasible. | 320 | ICMP in the real Internet is absolutely infeasible. |
321 | */ | 321 | */ |
322 | struct iphdr *iph = (struct iphdr *)skb->data; | 322 | const struct iphdr *iph = (const struct iphdr *)skb->data; |
323 | const int type = icmp_hdr(skb)->type; | 323 | const int type = icmp_hdr(skb)->type; |
324 | const int code = icmp_hdr(skb)->code; | 324 | const int code = icmp_hdr(skb)->code; |
325 | struct ip_tunnel *t; | 325 | struct ip_tunnel *t; |
@@ -433,12 +433,12 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
433 | { | 433 | { |
434 | struct ip_tunnel *tunnel = netdev_priv(dev); | 434 | struct ip_tunnel *tunnel = netdev_priv(dev); |
435 | struct pcpu_tstats *tstats; | 435 | struct pcpu_tstats *tstats; |
436 | struct iphdr *tiph = &tunnel->parms.iph; | 436 | const struct iphdr *tiph = &tunnel->parms.iph; |
437 | u8 tos = tunnel->parms.iph.tos; | 437 | u8 tos = tunnel->parms.iph.tos; |
438 | __be16 df = tiph->frag_off; | 438 | __be16 df = tiph->frag_off; |
439 | struct rtable *rt; /* Route to the other host */ | 439 | struct rtable *rt; /* Route to the other host */ |
440 | struct net_device *tdev; /* Device to other host */ | 440 | struct net_device *tdev; /* Device to other host */ |
441 | struct iphdr *old_iph = ip_hdr(skb); | 441 | const struct iphdr *old_iph = ip_hdr(skb); |
442 | struct iphdr *iph; /* Our new IP header */ | 442 | struct iphdr *iph; /* Our new IP header */ |
443 | unsigned int max_headroom; /* The extra header space needed */ | 443 | unsigned int max_headroom; /* The extra header space needed */ |
444 | __be32 dst = tiph->daddr; | 444 | __be32 dst = tiph->daddr; |
@@ -572,7 +572,7 @@ static void ipip_tunnel_bind_dev(struct net_device *dev) | |||
572 | { | 572 | { |
573 | struct net_device *tdev = NULL; | 573 | struct net_device *tdev = NULL; |
574 | struct ip_tunnel *tunnel; | 574 | struct ip_tunnel *tunnel; |
575 | struct iphdr *iph; | 575 | const struct iphdr *iph; |
576 | 576 | ||
577 | tunnel = netdev_priv(dev); | 577 | tunnel = netdev_priv(dev); |
578 | iph = &tunnel->parms.iph; | 578 | iph = &tunnel->parms.iph; |