mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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
+11
-11
@@ -61,16 +61,16 @@ extern int addrconf_set_dstaddr(struct net *net,
|
||||
void __user *arg);
|
||||
|
||||
extern int ipv6_chk_addr(struct net *net,
|
||||
struct in6_addr *addr,
|
||||
const struct in6_addr *addr,
|
||||
struct net_device *dev,
|
||||
int strict);
|
||||
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
extern int ipv6_chk_home_addr(struct net *net,
|
||||
struct in6_addr *addr);
|
||||
const struct in6_addr *addr);
|
||||
#endif
|
||||
|
||||
extern int ipv6_chk_prefix(struct in6_addr *addr,
|
||||
extern int ipv6_chk_prefix(const struct in6_addr *addr,
|
||||
struct net_device *dev);
|
||||
|
||||
extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
|
||||
@@ -89,9 +89,9 @@ extern int ipv6_get_lladdr(struct net_device *dev,
|
||||
extern int ipv6_rcv_saddr_equal(const struct sock *sk,
|
||||
const struct sock *sk2);
|
||||
extern void addrconf_join_solict(struct net_device *dev,
|
||||
struct in6_addr *addr);
|
||||
const struct in6_addr *addr);
|
||||
extern void addrconf_leave_solict(struct inet6_dev *idev,
|
||||
struct in6_addr *addr);
|
||||
const struct in6_addr *addr);
|
||||
|
||||
static inline unsigned long addrconf_timeout_fixup(u32 timeout,
|
||||
unsigned unit)
|
||||
@@ -158,15 +158,15 @@ extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);
|
||||
/*
|
||||
* anycast prototypes (anycast.c)
|
||||
*/
|
||||
extern int ipv6_sock_ac_join(struct sock *sk,int ifindex,struct in6_addr *addr);
|
||||
extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex,struct in6_addr *addr);
|
||||
extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr);
|
||||
extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr);
|
||||
extern void ipv6_sock_ac_close(struct sock *sk);
|
||||
extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex);
|
||||
extern int inet6_ac_check(struct sock *sk, const struct in6_addr *addr, int ifindex);
|
||||
|
||||
extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr);
|
||||
extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr);
|
||||
extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
|
||||
extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
|
||||
extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
|
||||
struct in6_addr *addr);
|
||||
const struct in6_addr *addr);
|
||||
|
||||
|
||||
/* Device notifier */
|
||||
|
||||
@@ -196,7 +196,7 @@ struct inet6_dev {
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
|
||||
static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf)
|
||||
{
|
||||
/*
|
||||
* +-------+-------+-------+-------+-------+-------+
|
||||
@@ -210,7 +210,7 @@ static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
|
||||
memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32));
|
||||
}
|
||||
|
||||
static inline void ipv6_tr_mc_map(struct in6_addr *addr, char *buf)
|
||||
static inline void ipv6_tr_mc_map(const struct in6_addr *addr, char *buf)
|
||||
{
|
||||
/* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
|
||||
return inet_getpeer(&daddr, create);
|
||||
}
|
||||
|
||||
static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create)
|
||||
static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, int create)
|
||||
{
|
||||
struct inetpeer_addr daddr;
|
||||
|
||||
|
||||
@@ -198,12 +198,12 @@ extern struct dst_entry *fib6_rule_lookup(struct net *net,
|
||||
pol_lookup_t lookup);
|
||||
|
||||
extern struct fib6_node *fib6_lookup(struct fib6_node *root,
|
||||
struct in6_addr *daddr,
|
||||
struct in6_addr *saddr);
|
||||
const struct in6_addr *daddr,
|
||||
const struct in6_addr *saddr);
|
||||
|
||||
struct fib6_node *fib6_locate(struct fib6_node *root,
|
||||
struct in6_addr *daddr, int dst_len,
|
||||
struct in6_addr *saddr, int src_len);
|
||||
const struct in6_addr *daddr, int dst_len,
|
||||
const struct in6_addr *saddr, int src_len);
|
||||
|
||||
extern void fib6_clean_all(struct net *net,
|
||||
int (*func)(struct rt6_info *, void *arg),
|
||||
|
||||
@@ -86,7 +86,7 @@ extern int ip6_del_rt(struct rt6_info *);
|
||||
|
||||
extern int ip6_route_get_saddr(struct net *net,
|
||||
struct rt6_info *rt,
|
||||
struct in6_addr *daddr,
|
||||
const struct in6_addr *daddr,
|
||||
unsigned int prefs,
|
||||
struct in6_addr *saddr);
|
||||
|
||||
@@ -112,9 +112,9 @@ extern int ip6_dst_hoplimit(struct dst_entry *dst);
|
||||
* support functions for ND
|
||||
*
|
||||
*/
|
||||
extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr,
|
||||
extern struct rt6_info * rt6_get_dflt_router(const struct in6_addr *addr,
|
||||
struct net_device *dev);
|
||||
extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr,
|
||||
extern struct rt6_info * rt6_add_dflt_router(const struct in6_addr *gwaddr,
|
||||
struct net_device *dev,
|
||||
unsigned int pref);
|
||||
|
||||
@@ -122,17 +122,17 @@ extern void rt6_purge_dflt_routers(struct net *net);
|
||||
|
||||
extern int rt6_route_rcv(struct net_device *dev,
|
||||
u8 *opt, int len,
|
||||
struct in6_addr *gwaddr);
|
||||
const struct in6_addr *gwaddr);
|
||||
|
||||
extern void rt6_redirect(struct in6_addr *dest,
|
||||
struct in6_addr *src,
|
||||
struct in6_addr *saddr,
|
||||
extern void rt6_redirect(const struct in6_addr *dest,
|
||||
const struct in6_addr *src,
|
||||
const struct in6_addr *saddr,
|
||||
struct neighbour *neigh,
|
||||
u8 *lladdr,
|
||||
int on_link);
|
||||
|
||||
extern void rt6_pmtu_discovery(struct in6_addr *daddr,
|
||||
struct in6_addr *saddr,
|
||||
extern void rt6_pmtu_discovery(const struct in6_addr *daddr,
|
||||
const struct in6_addr *saddr,
|
||||
struct net_device *dev,
|
||||
u32 pmtu);
|
||||
|
||||
|
||||
+2
-2
@@ -376,8 +376,8 @@ enum ip6_defrag_users {
|
||||
struct ip6_create_arg {
|
||||
__be32 id;
|
||||
u32 user;
|
||||
struct in6_addr *src;
|
||||
struct in6_addr *dst;
|
||||
const struct in6_addr *src;
|
||||
const struct in6_addr *dst;
|
||||
};
|
||||
|
||||
void ip6_frag_init(struct inet_frag_queue *q, void *a);
|
||||
|
||||
+2
-1
@@ -102,7 +102,8 @@ extern void ndisc_send_redirect(struct sk_buff *skb,
|
||||
struct neighbour *neigh,
|
||||
const struct in6_addr *target);
|
||||
|
||||
extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
|
||||
extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
|
||||
struct net_device *dev, int dir);
|
||||
|
||||
extern struct sk_buff *ndisc_build_skb(struct net_device *dev,
|
||||
const struct in6_addr *daddr,
|
||||
|
||||
+2
-1
@@ -191,7 +191,8 @@ static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 s
|
||||
return ip_route_input_common(skb, dst, src, tos, devin, true);
|
||||
}
|
||||
|
||||
extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
|
||||
extern unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph,
|
||||
unsigned short new_mtu, struct net_device *dev);
|
||||
extern void ip_rt_send_redirect(struct sk_buff *skb);
|
||||
|
||||
extern unsigned inet_addr_type(struct net *net, __be32 addr);
|
||||
|
||||
+3
-3
@@ -1475,7 +1475,7 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
|
||||
extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family);
|
||||
extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family);
|
||||
extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr);
|
||||
extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr);
|
||||
extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr);
|
||||
extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb);
|
||||
extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb);
|
||||
extern int xfrm6_output(struct sk_buff *skb);
|
||||
@@ -1569,8 +1569,8 @@ static inline int xfrm_addr_cmp(const xfrm_address_t *a,
|
||||
case AF_INET:
|
||||
return (__force u32)a->a4 - (__force u32)b->a4;
|
||||
case AF_INET6:
|
||||
return ipv6_addr_cmp((struct in6_addr *)a,
|
||||
(struct in6_addr *)b);
|
||||
return ipv6_addr_cmp((const struct in6_addr *)a,
|
||||
(const struct in6_addr *)b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ out:
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
|
||||
struct in6_addr *group)
|
||||
const struct in6_addr *group)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct ipv6hdr *ip6h;
|
||||
@@ -1115,7 +1115,7 @@ static int br_ip4_multicast_query(struct net_bridge *br,
|
||||
struct net_bridge_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct igmphdr *ih = igmp_hdr(skb);
|
||||
struct net_bridge_mdb_entry *mp;
|
||||
struct igmpv3_query *ih3;
|
||||
@@ -1190,7 +1190,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
|
||||
struct net_bridge_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
struct mld_msg *mld = (struct mld_msg *) icmp6_hdr(skb);
|
||||
struct net_bridge_mdb_entry *mp;
|
||||
struct mld2_query *mld2q;
|
||||
@@ -1198,7 +1198,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
|
||||
struct net_bridge_port_group __rcu **pp;
|
||||
unsigned long max_delay;
|
||||
unsigned long now = jiffies;
|
||||
struct in6_addr *group = NULL;
|
||||
const struct in6_addr *group = NULL;
|
||||
int err = 0;
|
||||
|
||||
spin_lock(&br->multicast_lock);
|
||||
@@ -1356,7 +1356,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct sk_buff *skb2 = skb;
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
struct igmphdr *ih;
|
||||
unsigned len;
|
||||
unsigned offset;
|
||||
@@ -1452,7 +1452,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct sk_buff *skb2;
|
||||
struct ipv6hdr *ip6h;
|
||||
const struct ipv6hdr *ip6h;
|
||||
struct icmp6hdr *icmp6h;
|
||||
u8 nexthdr;
|
||||
unsigned len;
|
||||
|
||||
@@ -219,7 +219,7 @@ static inline void nf_bridge_update_protocol(struct sk_buff *skb)
|
||||
static int br_parse_ip_options(struct sk_buff *skb)
|
||||
{
|
||||
struct ip_options *opt;
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
struct net_device *dev = skb->dev;
|
||||
u32 len;
|
||||
|
||||
@@ -554,7 +554,7 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
|
||||
const struct net_device *out,
|
||||
int (*okfn)(struct sk_buff *))
|
||||
{
|
||||
struct ipv6hdr *hdr;
|
||||
const struct ipv6hdr *hdr;
|
||||
u32 pkt_len;
|
||||
|
||||
if (skb->len < sizeof(struct ipv6hdr))
|
||||
|
||||
+4
-4
@@ -2502,8 +2502,8 @@ static inline void ____napi_schedule(struct softnet_data *sd,
|
||||
__u32 __skb_get_rxhash(struct sk_buff *skb)
|
||||
{
|
||||
int nhoff, hash = 0, poff;
|
||||
struct ipv6hdr *ip6;
|
||||
struct iphdr *ip;
|
||||
const struct ipv6hdr *ip6;
|
||||
const struct iphdr *ip;
|
||||
u8 ip_proto;
|
||||
u32 addr1, addr2, ihl;
|
||||
union {
|
||||
@@ -2518,7 +2518,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
|
||||
if (!pskb_may_pull(skb, sizeof(*ip) + nhoff))
|
||||
goto done;
|
||||
|
||||
ip = (struct iphdr *) (skb->data + nhoff);
|
||||
ip = (const struct iphdr *) (skb->data + nhoff);
|
||||
if (ip->frag_off & htons(IP_MF | IP_OFFSET))
|
||||
ip_proto = 0;
|
||||
else
|
||||
@@ -2531,7 +2531,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
|
||||
if (!pskb_may_pull(skb, sizeof(*ip6) + nhoff))
|
||||
goto done;
|
||||
|
||||
ip6 = (struct ipv6hdr *) (skb->data + nhoff);
|
||||
ip6 = (const struct ipv6hdr *) (skb->data + nhoff);
|
||||
ip_proto = ip6->nexthdr;
|
||||
addr1 = (__force u32) ip6->saddr.s6_addr32[3];
|
||||
addr2 = (__force u32) ip6->daddr.s6_addr32[3];
|
||||
|
||||
+1
-1
@@ -539,7 +539,7 @@ int __netpoll_rx(struct sk_buff *skb)
|
||||
{
|
||||
int proto, len, ulen;
|
||||
int hits = 0;
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
struct udphdr *uh;
|
||||
struct netpoll_info *npinfo = skb->dev->npinfo;
|
||||
struct netpoll *np, *tmp;
|
||||
|
||||
+4
-4
@@ -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);
|
||||
|
||||
+2
-2
@@ -1186,7 +1186,7 @@ EXPORT_SYMBOL(inet_sk_rebuild_header);
|
||||
|
||||
static int inet_gso_send_check(struct sk_buff *skb)
|
||||
{
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
const struct net_protocol *ops;
|
||||
int proto;
|
||||
int ihl;
|
||||
@@ -1293,7 +1293,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
|
||||
const struct net_protocol *ops;
|
||||
struct sk_buff **pp = NULL;
|
||||
struct sk_buff *p;
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
unsigned int hlen;
|
||||
unsigned int off;
|
||||
unsigned int id;
|
||||
|
||||
+4
-3
@@ -73,7 +73,7 @@ static inline struct scatterlist *ah_req_sg(struct crypto_ahash *ahash,
|
||||
* into IP header for icv calculation. Options are already checked
|
||||
* for validity, so paranoia is not required. */
|
||||
|
||||
static int ip_clear_mutable_options(struct iphdr *iph, __be32 *daddr)
|
||||
static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr)
|
||||
{
|
||||
unsigned char * optptr = (unsigned char*)(iph+1);
|
||||
int l = iph->ihl*4 - sizeof(struct iphdr);
|
||||
@@ -396,7 +396,7 @@ out:
|
||||
static void ah4_err(struct sk_buff *skb, u32 info)
|
||||
{
|
||||
struct net *net = dev_net(skb->dev);
|
||||
struct iphdr *iph = (struct iphdr *)skb->data;
|
||||
const struct iphdr *iph = (const struct iphdr *)skb->data;
|
||||
struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2));
|
||||
struct xfrm_state *x;
|
||||
|
||||
@@ -404,7 +404,8 @@ static void ah4_err(struct sk_buff *skb, u32 info)
|
||||
icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
|
||||
return;
|
||||
|
||||
x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET);
|
||||
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
|
||||
ah->spi, IPPROTO_AH, AF_INET);
|
||||
if (!x)
|
||||
return;
|
||||
printk(KERN_DEBUG "pmtu discovery on SA AH/%08x/%08x\n",
|
||||
|
||||
+4
-3
@@ -276,7 +276,7 @@ error:
|
||||
|
||||
static int esp_input_done2(struct sk_buff *skb, int err)
|
||||
{
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
struct xfrm_state *x = xfrm_input_state(skb);
|
||||
struct esp_data *esp = x->data;
|
||||
struct crypto_aead *aead = esp->aead;
|
||||
@@ -484,7 +484,7 @@ static u32 esp4_get_mtu(struct xfrm_state *x, int mtu)
|
||||
static void esp4_err(struct sk_buff *skb, u32 info)
|
||||
{
|
||||
struct net *net = dev_net(skb->dev);
|
||||
struct iphdr *iph = (struct iphdr *)skb->data;
|
||||
const struct iphdr *iph = (const struct iphdr *)skb->data;
|
||||
struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2));
|
||||
struct xfrm_state *x;
|
||||
|
||||
@@ -492,7 +492,8 @@ static void esp4_err(struct sk_buff *skb, u32 info)
|
||||
icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
|
||||
return;
|
||||
|
||||
x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET);
|
||||
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
|
||||
esph->spi, IPPROTO_ESP, AF_INET);
|
||||
if (!x)
|
||||
return;
|
||||
NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
|
||||
|
||||
+6
-6
@@ -373,7 +373,7 @@ out_unlock:
|
||||
}
|
||||
|
||||
static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
|
||||
struct iphdr *iph,
|
||||
const struct iphdr *iph,
|
||||
__be32 saddr, u8 tos,
|
||||
int type, int code,
|
||||
struct icmp_bxm *param)
|
||||
@@ -637,7 +637,7 @@ EXPORT_SYMBOL(icmp_send);
|
||||
|
||||
static void icmp_unreach(struct sk_buff *skb)
|
||||
{
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
struct icmphdr *icmph;
|
||||
int hash, protocol;
|
||||
const struct net_protocol *ipprot;
|
||||
@@ -656,7 +656,7 @@ static void icmp_unreach(struct sk_buff *skb)
|
||||
goto out_err;
|
||||
|
||||
icmph = icmp_hdr(skb);
|
||||
iph = (struct iphdr *)skb->data;
|
||||
iph = (const struct iphdr *)skb->data;
|
||||
|
||||
if (iph->ihl < 5) /* Mangled header, drop. */
|
||||
goto out_err;
|
||||
@@ -729,7 +729,7 @@ static void icmp_unreach(struct sk_buff *skb)
|
||||
if (!pskb_may_pull(skb, iph->ihl * 4 + 8))
|
||||
goto out;
|
||||
|
||||
iph = (struct iphdr *)skb->data;
|
||||
iph = (const struct iphdr *)skb->data;
|
||||
protocol = iph->protocol;
|
||||
|
||||
/*
|
||||
@@ -758,7 +758,7 @@ out_err:
|
||||
|
||||
static void icmp_redirect(struct sk_buff *skb)
|
||||
{
|
||||
struct iphdr *iph;
|
||||
const struct iphdr *iph;
|
||||
|
||||
if (skb->len < sizeof(struct iphdr))
|
||||
goto out_err;
|
||||
@@ -769,7 +769,7 @@ static void icmp_redirect(struct sk_buff *skb)
|
||||
if (!pskb_may_pull(skb, sizeof(struct iphdr)))
|
||||
goto out;
|
||||
|
||||
iph = (struct iphdr *)skb->data;
|
||||
iph = (const struct iphdr *)skb->data;
|
||||
|
||||
switch (icmp_hdr(skb)->code & 7) {
|
||||
case ICMP_REDIR_NET:
|
||||
|
||||
@@ -124,7 +124,7 @@ static int inet_csk_diag_fill(struct sock *sk,
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
|
||||
if (r->idiag_family == AF_INET6) {
|
||||
struct ipv6_pinfo *np = inet6_sk(sk);
|
||||
const struct ipv6_pinfo *np = inet6_sk(sk);
|
||||
|
||||
ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
|
||||
&np->rcv_saddr);
|
||||
|
||||
+2
-2
@@ -51,8 +51,8 @@ MODULE_DESCRIPTION("Large Receive Offload (ipv4 / tcp)");
|
||||
* Basic tcp checks whether packet is suitable for LRO
|
||||
*/
|
||||
|
||||
static int lro_tcp_ip_check(struct iphdr *iph, struct tcphdr *tcph,
|
||||
int len, struct net_lro_desc *lro_desc)
|
||||
static int lro_tcp_ip_check(const struct iphdr *iph, const struct tcphdr *tcph,
|
||||
int len, const struct net_lro_desc *lro_desc)
|
||||
{
|
||||
/* check ip header: don't aggregate padded frames */
|
||||
if (ntohs(iph->tot_len) != len)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user