Commit a61ced5d authored by Al Viro's avatar Al Viro Committed by David S. Miller

[IPV4]: inet_select_addr() annotations

argument and return value are net-endian.  Annotated function and inferred
net-endian variables in callers.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 011a9261
...@@ -110,7 +110,7 @@ extern int devinet_ioctl(unsigned int cmd, void __user *); ...@@ -110,7 +110,7 @@ extern int devinet_ioctl(unsigned int cmd, void __user *);
extern void devinet_init(void); extern void devinet_init(void);
extern struct in_device *inetdev_init(struct net_device *dev); extern struct in_device *inetdev_init(struct net_device *dev);
extern struct in_device *inetdev_by_index(int); extern struct in_device *inetdev_by_index(int);
extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope); extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope); extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope);
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask);
extern void inet_forward_change(void); extern void inet_forward_change(void);
......
...@@ -330,10 +330,10 @@ static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb) ...@@ -330,10 +330,10 @@ static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb)
static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
{ {
u32 saddr = 0; __be32 saddr = 0;
u8 *dst_ha = NULL; u8 *dst_ha = NULL;
struct net_device *dev = neigh->dev; struct net_device *dev = neigh->dev;
u32 target = *(u32*)neigh->primary_key; __be32 target = *(__be32*)neigh->primary_key;
int probes = atomic_read(&neigh->probes); int probes = atomic_read(&neigh->probes);
struct in_device *in_dev = in_dev_get(dev); struct in_device *in_dev = in_dev_get(dev);
......
...@@ -876,9 +876,9 @@ static int inet_gifconf(struct net_device *dev, char __user *buf, int len) ...@@ -876,9 +876,9 @@ static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
return done; return done;
} }
u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope) __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope)
{ {
u32 addr = 0; __be32 addr = 0;
struct in_device *in_dev; struct in_device *in_dev;
rcu_read_lock(); rcu_read_lock();
......
...@@ -437,7 +437,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info) ...@@ -437,7 +437,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
struct icmp_bxm icmp_param; struct icmp_bxm icmp_param;
struct rtable *rt = (struct rtable *)skb_in->dst; struct rtable *rt = (struct rtable *)skb_in->dst;
struct ipcm_cookie ipc; struct ipcm_cookie ipc;
u32 saddr; __be32 saddr;
u8 tos; u8 tos;
if (!rt) if (!rt)
......
...@@ -464,7 +464,7 @@ join_mcast_group(struct sock *sk, struct in_addr *addr, char *ifname) ...@@ -464,7 +464,7 @@ join_mcast_group(struct sock *sk, struct in_addr *addr, char *ifname)
static int bind_mcastif_addr(struct socket *sock, char *ifname) static int bind_mcastif_addr(struct socket *sock, char *ifname)
{ {
struct net_device *dev; struct net_device *dev;
u32 addr; __be32 addr;
struct sockaddr_in sin; struct sockaddr_in sin;
if ((dev = __dev_get_by_name(ifname)) == NULL) if ((dev = __dev_get_by_name(ifname)) == NULL)
......
...@@ -70,7 +70,7 @@ masquerade_target(struct sk_buff **pskb, ...@@ -70,7 +70,7 @@ masquerade_target(struct sk_buff **pskb,
const struct ip_nat_multi_range_compat *mr; const struct ip_nat_multi_range_compat *mr;
struct ip_nat_range newrange; struct ip_nat_range newrange;
struct rtable *rt; struct rtable *rt;
u_int32_t newsrc; __be32 newsrc;
IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING); IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING);
......
...@@ -1532,7 +1532,7 @@ static int ip_rt_bug(struct sk_buff *skb) ...@@ -1532,7 +1532,7 @@ static int ip_rt_bug(struct sk_buff *skb)
void ip_rt_get_source(u8 *addr, struct rtable *rt) void ip_rt_get_source(u8 *addr, struct rtable *rt)
{ {
u32 src; __be32 src;
struct fib_result res; struct fib_result res;
if (rt->fl.iif == 0) if (rt->fl.iif == 0)
...@@ -1603,7 +1603,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, ...@@ -1603,7 +1603,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
{ {
unsigned hash; unsigned hash;
struct rtable *rth; struct rtable *rth;
u32 spec_dst; __be32 spec_dst;
struct in_device *in_dev = in_dev_get(dev); struct in_device *in_dev = in_dev_get(dev);
u32 itag = 0; u32 itag = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment