aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-04-22 00:53:02 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-22 14:04:14 -0400
commitb71d1d426d263b0b6cb5760322efebbfc89d4463 (patch)
tree226ca7390bd6187ec9139d2ccedd26fd94d8e57a /net/ipv4/tcp_ipv4.c
parent5f8629c526b4f7e529a6d27bbd802c0dc7fcc357 (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/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index f7e6c2c2d2bb..edf18bd74b87 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -279,7 +279,7 @@ EXPORT_SYMBOL(tcp_v4_connect);
279/* 279/*
280 * This routine does path mtu discovery as defined in RFC1191. 280 * This routine does path mtu discovery as defined in RFC1191.
281 */ 281 */
282static void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu) 282static void do_pmtu_discovery(struct sock *sk, const struct iphdr *iph, u32 mtu)
283{ 283{
284 struct dst_entry *dst; 284 struct dst_entry *dst;
285 struct inet_sock *inet = inet_sk(sk); 285 struct inet_sock *inet = inet_sk(sk);
@@ -341,7 +341,7 @@ static void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu)
341 341
342void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) 342void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
343{ 343{
344 struct iphdr *iph = (struct iphdr *)icmp_skb->data; 344 const struct iphdr *iph = (const struct iphdr *)icmp_skb->data;
345 struct tcphdr *th = (struct tcphdr *)(icmp_skb->data + (iph->ihl << 2)); 345 struct tcphdr *th = (struct tcphdr *)(icmp_skb->data + (iph->ihl << 2));
346 struct inet_connection_sock *icsk; 346 struct inet_connection_sock *icsk;
347 struct tcp_sock *tp; 347 struct tcp_sock *tp;
@@ -2527,7 +2527,7 @@ void tcp4_proc_exit(void)
2527 2527
2528struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb) 2528struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
2529{ 2529{
2530 struct iphdr *iph = skb_gro_network_header(skb); 2530 const struct iphdr *iph = skb_gro_network_header(skb);
2531 2531
2532 switch (skb->ip_summed) { 2532 switch (skb->ip_summed) {
2533 case CHECKSUM_COMPLETE: 2533 case CHECKSUM_COMPLETE:
@@ -2548,7 +2548,7 @@ struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
2548 2548
2549int tcp4_gro_complete(struct sk_buff *skb) 2549int tcp4_gro_complete(struct sk_buff *skb)
2550{ 2550{
2551 struct iphdr *iph = ip_hdr(skb); 2551 const struct iphdr *iph = ip_hdr(skb);
2552 struct tcphdr *th = tcp_hdr(skb); 2552 struct tcphdr *th = tcp_hdr(skb);
2553 2553
2554 th->check = ~tcp_v4_check(skb->len - skb_transport_offset(skb), 2554 th->check = ~tcp_v4_check(skb->len - skb_transport_offset(skb),