aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-28 21:00:55 -0400
committerDavid S. Miller <davem@davemloft.net>2006-09-28 21:00:55 -0400
commita144ea4b7a13087081ab5402fa9ad0bcfd249e67 (patch)
treea0452a546c231d85a89e8920c26e5dec4595ba54 /net/ipv4
parent6d85c10abe840e98cbac673202fe7cc9ada2180c (diff)
[IPV4]: annotate struct in_ifaddr
ifa_local, ifa_address, ifa_mask, ifa_broadcast and ifa_anycast are net-endian. Annotated them and variables that are inferred to be net-endian. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/devinet.c4
-rw-r--r--net/ipv4/fib_frontend.c12
-rw-r--r--net/ipv4/icmp.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netbios_ns.c2
-rw-r--r--net/ipv4/netfilter/ipt_REDIRECT.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5988584f6a6d..a0a7780e7515 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -805,7 +805,7 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
805 break; 805 break;
806 ret = 0; 806 ret = 0;
807 if (ifa->ifa_mask != sin->sin_addr.s_addr) { 807 if (ifa->ifa_mask != sin->sin_addr.s_addr) {
808 u32 old_mask = ifa->ifa_mask; 808 __be32 old_mask = ifa->ifa_mask;
809 inet_del_ifa(in_dev, ifap, 0); 809 inet_del_ifa(in_dev, ifap, 0);
810 ifa->ifa_mask = sin->sin_addr.s_addr; 810 ifa->ifa_mask = sin->sin_addr.s_addr;
811 ifa->ifa_prefixlen = inet_mask_len(ifa->ifa_mask); 811 ifa->ifa_prefixlen = inet_mask_len(ifa->ifa_mask);
@@ -931,7 +931,7 @@ static u32 confirm_addr_indev(struct in_device *in_dev, u32 dst,
931 u32 local, int scope) 931 u32 local, int scope)
932{ 932{
933 int same = 0; 933 int same = 0;
934 u32 addr = 0; 934 __be32 addr = 0;
935 935
936 for_ifa(in_dev) { 936 for_ifa(in_dev) {
937 if (!addr && 937 if (!addr &&
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 7f5217907e5a..62ee71ee6bc9 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -667,9 +667,9 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
667 struct in_device *in_dev = ifa->ifa_dev; 667 struct in_device *in_dev = ifa->ifa_dev;
668 struct net_device *dev = in_dev->dev; 668 struct net_device *dev = in_dev->dev;
669 struct in_ifaddr *prim = ifa; 669 struct in_ifaddr *prim = ifa;
670 u32 mask = ifa->ifa_mask; 670 __be32 mask = ifa->ifa_mask;
671 u32 addr = ifa->ifa_local; 671 __be32 addr = ifa->ifa_local;
672 u32 prefix = ifa->ifa_address&mask; 672 __be32 prefix = ifa->ifa_address&mask;
673 673
674 if (ifa->ifa_flags&IFA_F_SECONDARY) { 674 if (ifa->ifa_flags&IFA_F_SECONDARY) {
675 prim = inet_ifa_byprefix(in_dev, prefix, mask); 675 prim = inet_ifa_byprefix(in_dev, prefix, mask);
@@ -685,7 +685,7 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
685 return; 685 return;
686 686
687 /* Add broadcast address, if it is explicitly assigned. */ 687 /* Add broadcast address, if it is explicitly assigned. */
688 if (ifa->ifa_broadcast && ifa->ifa_broadcast != 0xFFFFFFFF) 688 if (ifa->ifa_broadcast && ifa->ifa_broadcast != htonl(0xFFFFFFFF))
689 fib_magic(RTM_NEWROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim); 689 fib_magic(RTM_NEWROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim);
690 690
691 if (!ZERONET(prefix) && !(ifa->ifa_flags&IFA_F_SECONDARY) && 691 if (!ZERONET(prefix) && !(ifa->ifa_flags&IFA_F_SECONDARY) &&
@@ -707,8 +707,8 @@ static void fib_del_ifaddr(struct in_ifaddr *ifa)
707 struct net_device *dev = in_dev->dev; 707 struct net_device *dev = in_dev->dev;
708 struct in_ifaddr *ifa1; 708 struct in_ifaddr *ifa1;
709 struct in_ifaddr *prim = ifa; 709 struct in_ifaddr *prim = ifa;
710 u32 brd = ifa->ifa_address|~ifa->ifa_mask; 710 __be32 brd = ifa->ifa_address|~ifa->ifa_mask;
711 u32 any = ifa->ifa_address&ifa->ifa_mask; 711 __be32 any = ifa->ifa_address&ifa->ifa_mask;
712#define LOCAL_OK 1 712#define LOCAL_OK 1
713#define BRD_OK 2 713#define BRD_OK 2
714#define BRD0_OK 4 714#define BRD0_OK 4
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index fd39685241c1..428f1c91ec45 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -895,7 +895,7 @@ static void icmp_address_reply(struct sk_buff *skb)
895 if (in_dev->ifa_list && 895 if (in_dev->ifa_list &&
896 IN_DEV_LOG_MARTIANS(in_dev) && 896 IN_DEV_LOG_MARTIANS(in_dev) &&
897 IN_DEV_FORWARD(in_dev)) { 897 IN_DEV_FORWARD(in_dev)) {
898 u32 _mask, *mp; 898 __be32 _mask, *mp;
899 899
900 mp = skb_header_pointer(skb, 0, sizeof(_mask), &_mask); 900 mp = skb_header_pointer(skb, 0, sizeof(_mask), &_mask);
901 BUG_ON(mp == NULL); 901 BUG_ON(mp == NULL);
diff --git a/net/ipv4/netfilter/ip_conntrack_netbios_ns.c b/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
index 3d0b438783db..4adec47aae32 100644
--- a/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
+++ b/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
@@ -48,7 +48,7 @@ static int help(struct sk_buff **pskb,
48 struct iphdr *iph = (*pskb)->nh.iph; 48 struct iphdr *iph = (*pskb)->nh.iph;
49 struct rtable *rt = (struct rtable *)(*pskb)->dst; 49 struct rtable *rt = (struct rtable *)(*pskb)->dst;
50 struct in_device *in_dev; 50 struct in_device *in_dev;
51 u_int32_t mask = 0; 51 __be32 mask = 0;
52 52
53 /* we're only interested in locally generated packets */ 53 /* we're only interested in locally generated packets */
54 if ((*pskb)->sk == NULL) 54 if ((*pskb)->sk == NULL)
diff --git a/net/ipv4/netfilter/ipt_REDIRECT.c b/net/ipv4/netfilter/ipt_REDIRECT.c
index f03d43671c6d..c0dcfe9d610c 100644
--- a/net/ipv4/netfilter/ipt_REDIRECT.c
+++ b/net/ipv4/netfilter/ipt_REDIRECT.c
@@ -61,7 +61,7 @@ redirect_target(struct sk_buff **pskb,
61{ 61{
62 struct ip_conntrack *ct; 62 struct ip_conntrack *ct;
63 enum ip_conntrack_info ctinfo; 63 enum ip_conntrack_info ctinfo;
64 u_int32_t newdst; 64 __be32 newdst;
65 const struct ip_nat_multi_range_compat *mr = targinfo; 65 const struct ip_nat_multi_range_compat *mr = targinfo;
66 struct ip_nat_range newrange; 66 struct ip_nat_range newrange;
67 67