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

[IPV4]: inet_addr_type() annotations

argument and inferred net-endian variables in callers annotated.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e4883014
...@@ -8067,7 +8067,7 @@ qeth_arp_constructor(struct neighbour *neigh) ...@@ -8067,7 +8067,7 @@ qeth_arp_constructor(struct neighbour *neigh)
neigh->parms = neigh_parms_clone(parms); neigh->parms = neigh_parms_clone(parms);
rcu_read_unlock(); rcu_read_unlock();
neigh->type = inet_addr_type(*(u32 *) neigh->primary_key); neigh->type = inet_addr_type(*(__be32 *) neigh->primary_key);
neigh->nud_state = NUD_NOARP; neigh->nud_state = NUD_NOARP;
neigh->ops = arp_direct_ops; neigh->ops = arp_direct_ops;
neigh->output = neigh->ops->queue_xmit; neigh->output = neigh->ops->queue_xmit;
......
...@@ -120,7 +120,7 @@ extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, stru ...@@ -120,7 +120,7 @@ extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, stru
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
extern void ip_rt_send_redirect(struct sk_buff *skb); extern void ip_rt_send_redirect(struct sk_buff *skb);
extern unsigned inet_addr_type(u32 addr); extern unsigned inet_addr_type(__be32 addr);
extern void ip_rt_multicast_event(struct in_device *); extern void ip_rt_multicast_event(struct in_device *);
extern int ip_rt_ioctl(unsigned int cmd, void __user *arg); extern int ip_rt_ioctl(unsigned int cmd, void __user *arg);
extern void ip_rt_get_source(u8 *src, struct rtable *rt); extern void ip_rt_get_source(u8 *src, struct rtable *rt);
......
...@@ -234,7 +234,7 @@ static u32 arp_hash(const void *pkey, const struct net_device *dev) ...@@ -234,7 +234,7 @@ static u32 arp_hash(const void *pkey, const struct net_device *dev)
static int arp_constructor(struct neighbour *neigh) static int arp_constructor(struct neighbour *neigh)
{ {
u32 addr = *(u32*)neigh->primary_key; __be32 addr = *(__be32*)neigh->primary_key;
struct net_device *dev = neigh->dev; struct net_device *dev = neigh->dev;
struct in_device *in_dev; struct in_device *in_dev;
struct neigh_parms *parms; struct neigh_parms *parms;
...@@ -470,7 +470,7 @@ static int arp_set_predefined(int addr_hint, unsigned char * haddr, u32 paddr, s ...@@ -470,7 +470,7 @@ static int arp_set_predefined(int addr_hint, unsigned char * haddr, u32 paddr, s
int arp_find(unsigned char *haddr, struct sk_buff *skb) int arp_find(unsigned char *haddr, struct sk_buff *skb)
{ {
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
u32 paddr; __be32 paddr;
struct neighbour *n; struct neighbour *n;
if (!skb->dst) { if (!skb->dst) {
......
...@@ -146,7 +146,7 @@ out: ...@@ -146,7 +146,7 @@ out:
return dev; return dev;
} }
unsigned inet_addr_type(u32 addr) unsigned inet_addr_type(__be32 addr)
{ {
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } };
struct fib_result res; struct fib_result res;
......
...@@ -148,7 +148,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb) ...@@ -148,7 +148,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
dopt->ts_needtime = 0; dopt->ts_needtime = 0;
if (soffset + 8 <= optlen) { if (soffset + 8 <= optlen) {
__u32 addr; __be32 addr;
memcpy(&addr, sptr+soffset-1, 4); memcpy(&addr, sptr+soffset-1, 4);
if (inet_addr_type(addr) != RTN_LOCAL) { if (inet_addr_type(addr) != RTN_LOCAL) {
...@@ -396,7 +396,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) ...@@ -396,7 +396,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
} }
opt->ts = optptr - iph; opt->ts = optptr - iph;
{ {
u32 addr; __be32 addr;
memcpy(&addr, &optptr[optptr[2]-1], 4); memcpy(&addr, &optptr[optptr[2]-1], 4);
if (inet_addr_type(addr) == RTN_UNICAST) if (inet_addr_type(addr) == RTN_UNICAST)
break; break;
......
...@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL"); ...@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_DESCRIPTION("iptables addrtype match"); MODULE_DESCRIPTION("iptables addrtype match");
static inline int match_type(u_int32_t addr, u_int16_t mask) static inline int match_type(__be32 addr, u_int16_t mask)
{ {
return !!(mask & (1 << inet_addr_type(addr))); return !!(mask & (1 << inet_addr_type(addr)));
} }
......
...@@ -246,7 +246,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -246,7 +246,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
__u32 v4addr = 0; __be32 v4addr = 0;
unsigned short snum; unsigned short snum;
int addr_type = 0; int addr_type = 0;
int err = 0; int err = 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