Commit d27d367d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'inet-const'



Eric Dumazet says:

====================
inet: better const qualifier awareness

inet_sk() can be changed to propagate const qualifier,
thanks to container_of_const()

Following patches in this series add more const qualifiers.

Other helpers like tcp_sk(), udp_sk(), raw_sk(), ... will be handled
in following series.
====================

Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 82b32970 736c8b52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
			sockptr_t optval, sockptr_t optlen);
extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
			sockptr_t optval, size_t offset);
extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt,
extern int ip_mc_sf_allow(const struct sock *sk, __be32 local, __be32 rmt,
			  int dif, int sdif);
extern void ip_mc_init_dev(struct in_device *);
extern void ip_mc_destroy_dev(struct in_device *);
+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
		      const struct in6_addr *addr);
void __ipv6_sock_mc_close(struct sock *sk);
void ipv6_sock_mc_close(struct sock *sk);
bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
bool inet6_mc_check(const struct sock *sk, const struct in6_addr *mc_addr,
		    const struct in6_addr *src_addr);

int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
+1 −4
Original line number Diff line number Diff line
@@ -305,10 +305,7 @@ static inline struct sock *skb_to_full_sk(const struct sk_buff *skb)
	return sk_to_full_sk(skb->sk);
}

static inline struct inet_sock *inet_sk(const struct sock *sk)
{
	return (struct inet_sock *)sk;
}
#define inet_sk(ptr) container_of_const(ptr, struct inet_sock, sk)

static inline void __inet_sk_copy_descendant(struct sock *sk_to,
					     const struct sock *sk_from,
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
extern struct proto raw_prot;

extern struct raw_hashinfo raw_v4_hashinfo;
bool raw_v4_match(struct net *net, struct sock *sk, unsigned short num,
bool raw_v4_match(struct net *net, const struct sock *sk, unsigned short num,
		  __be32 raddr, __be32 laddr, int dif, int sdif);

int raw_abort(struct sock *sk, int err);
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#include <net/raw.h>

extern struct raw_hashinfo raw_v6_hashinfo;
bool raw_v6_match(struct net *net, struct sock *sk, unsigned short num,
bool raw_v6_match(struct net *net, const struct sock *sk, unsigned short num,
		  const struct in6_addr *loc_addr,
		  const struct in6_addr *rmt_addr, int dif, int sdif);

Loading