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>
This commit is contained in:

committed by
David S. Miller

parent
5f8629c526
commit
b71d1d426d
@@ -54,8 +54,8 @@ static void dccp_v6_hash(struct sock *sk)
|
||||
|
||||
/* add pseudo-header to DCCP checksum stored in skb->csum */
|
||||
static inline __sum16 dccp_v6_csum_finish(struct sk_buff *skb,
|
||||
struct in6_addr *saddr,
|
||||
struct in6_addr *daddr)
|
||||
const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr)
|
||||
{
|
||||
return csum_ipv6_magic(saddr, daddr, skb->len, IPPROTO_DCCP, skb->csum);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb)
|
||||
static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
||||
u8 type, u8 code, int offset, __be32 info)
|
||||
{
|
||||
struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data;
|
||||
const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data;
|
||||
const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset);
|
||||
struct dccp_sock *dp;
|
||||
struct ipv6_pinfo *np;
|
||||
@@ -296,7 +296,7 @@ static void dccp_v6_reqsk_destructor(struct request_sock *req)
|
||||
|
||||
static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
|
||||
{
|
||||
struct ipv6hdr *rxip6h;
|
||||
const struct ipv6hdr *rxip6h;
|
||||
struct sk_buff *skb;
|
||||
struct flowi6 fl6;
|
||||
struct net *net = dev_net(skb_dst(rxskb)->dev);
|
||||
|
Reference in New Issue
Block a user