inet: constify ip headers and in6_addr
[deliverable/linux.git] / net / ipv4 / raw.c
index 2b50cc2da90a43dbe36496499b7382d49d266532..abf14dbcb3b9e22f47bf7a690b50f98c936a76c3 100644 (file)
@@ -154,7 +154,7 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
  * RFC 1122: SHOULD pass TOS value up to the transport layer.
  * -> It does. And not only TOS, but all IP header.
  */
-static int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash)
+static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash)
 {
        struct sock *sk;
        struct hlist_head *head;
@@ -247,7 +247,7 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
        }
 
        if (inet->recverr) {
-               struct iphdr *iph = (struct iphdr *)skb->data;
+               const struct iphdr *iph = (const struct iphdr *)skb->data;
                u8 *payload = skb->data + (iph->ihl << 2);
 
                if (inet->hdrincl)
@@ -265,7 +265,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
 {
        int hash;
        struct sock *raw_sk;
-       struct iphdr *iph;
+       const struct iphdr *iph;
        struct net *net;
 
        hash = protocol & (RAW_HTABLE_SIZE - 1);
@@ -273,7 +273,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
        read_lock(&raw_v4_hashinfo.lock);
        raw_sk = sk_head(&raw_v4_hashinfo.ht[hash]);
        if (raw_sk != NULL) {
-               iph = (struct iphdr *)skb->data;
+               iph = (const struct iphdr *)skb->data;
                net = dev_net(skb->dev);
 
                while ((raw_sk = __raw_v4_lookup(net, raw_sk, protocol,
@@ -281,7 +281,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
                                                skb->dev->ifindex)) != NULL) {
                        raw_err(raw_sk, skb, info);
                        raw_sk = sk_next(raw_sk);
-                       iph = (struct iphdr *)skb->data;
+                       iph = (const struct iphdr *)skb->data;
                }
        }
        read_unlock(&raw_v4_hashinfo.lock);
This page took 0.024603 seconds and 5 git commands to generate.