aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-28 17:22:24 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:03:02 -0400
commit6a19d61472d0802a24493c0d200e88f99ad39cd8 (patch)
tree0689ae578aec5d32fdf5e53875a4b90cbfdf97ae
parenta76b11dd25957287af12ce6855be6d7fd415b3a9 (diff)
[NETFILTER]: ipt annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c14
-rw-r--r--net/ipv4/netfilter/ipt_ECN.c12
-rw-r--r--net/ipv4/netfilter/ipt_NETMAP.c2
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c4
-rw-r--r--net/ipv4/netfilter/ipt_SAME.c3
-rw-r--r--net/ipv4/netfilter/ipt_TCPMSS.c17
-rw-r--r--net/ipv4/netfilter/ipt_TOS.c4
-rw-r--r--net/ipv4/netfilter/ipt_TTL.c4
-rw-r--r--net/ipv4/netfilter/ipt_hashlimit.c16
-rw-r--r--net/ipv4/netfilter/ipt_recent.c15
-rw-r--r--net/ipv4/netfilter/iptable_mangle.c2
12 files changed, 49 insertions, 46 deletions
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 3ecb3bd63676..34ab0fb736e2 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -8,7 +8,7 @@
8 8
9struct ipt_iprange { 9struct ipt_iprange {
10 /* Inclusive: network order. */ 10 /* Inclusive: network order. */
11 u_int32_t min_ip, max_ip; 11 __be32 min_ip, max_ip;
12}; 12};
13 13
14struct ipt_iprange_info 14struct ipt_iprange_info
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 41589665fc5d..7a29d6e7baa7 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -52,7 +52,7 @@ struct clusterip_config {
52 atomic_t entries; /* number of entries/rules 52 atomic_t entries; /* number of entries/rules
53 * referencing us */ 53 * referencing us */
54 54
55 u_int32_t clusterip; /* the IP address */ 55 __be32 clusterip; /* the IP address */
56 u_int8_t clustermac[ETH_ALEN]; /* the MAC address */ 56 u_int8_t clustermac[ETH_ALEN]; /* the MAC address */
57 struct net_device *dev; /* device */ 57 struct net_device *dev; /* device */
58 u_int16_t num_total_nodes; /* total number of nodes */ 58 u_int16_t num_total_nodes; /* total number of nodes */
@@ -119,7 +119,7 @@ clusterip_config_entry_put(struct clusterip_config *c)
119} 119}
120 120
121static struct clusterip_config * 121static struct clusterip_config *
122__clusterip_config_find(u_int32_t clusterip) 122__clusterip_config_find(__be32 clusterip)
123{ 123{
124 struct list_head *pos; 124 struct list_head *pos;
125 125
@@ -136,7 +136,7 @@ __clusterip_config_find(u_int32_t clusterip)
136} 136}
137 137
138static inline struct clusterip_config * 138static inline struct clusterip_config *
139clusterip_config_find_get(u_int32_t clusterip, int entry) 139clusterip_config_find_get(__be32 clusterip, int entry)
140{ 140{
141 struct clusterip_config *c; 141 struct clusterip_config *c;
142 142
@@ -166,7 +166,7 @@ clusterip_config_init_nodelist(struct clusterip_config *c,
166} 166}
167 167
168static struct clusterip_config * 168static struct clusterip_config *
169clusterip_config_init(struct ipt_clusterip_tgt_info *i, u_int32_t ip, 169clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
170 struct net_device *dev) 170 struct net_device *dev)
171{ 171{
172 struct clusterip_config *c; 172 struct clusterip_config *c;
@@ -387,7 +387,7 @@ checkentry(const char *tablename,
387 return 0; 387 return 0;
388 388
389 } 389 }
390 if (e->ip.dmsk.s_addr != 0xffffffff 390 if (e->ip.dmsk.s_addr != htonl(0xffffffff)
391 || e->ip.dst.s_addr == 0) { 391 || e->ip.dst.s_addr == 0) {
392 printk(KERN_ERR "CLUSTERIP: Please specify destination IP\n"); 392 printk(KERN_ERR "CLUSTERIP: Please specify destination IP\n");
393 return 0; 393 return 0;
@@ -476,9 +476,9 @@ static struct ipt_target clusterip_tgt = {
476/* hardcoded for 48bit ethernet and 32bit ipv4 addresses */ 476/* hardcoded for 48bit ethernet and 32bit ipv4 addresses */
477struct arp_payload { 477struct arp_payload {
478 u_int8_t src_hw[ETH_ALEN]; 478 u_int8_t src_hw[ETH_ALEN];
479 u_int32_t src_ip; 479 __be32 src_ip;
480 u_int8_t dst_hw[ETH_ALEN]; 480 u_int8_t dst_hw[ETH_ALEN];
481 u_int32_t dst_ip; 481 __be32 dst_ip;
482} __attribute__ ((packed)); 482} __attribute__ ((packed));
483 483
484#ifdef CLUSTERIP_DEBUG 484#ifdef CLUSTERIP_DEBUG
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
index 23f9c7ebe7eb..12a818a2462f 100644
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -28,7 +28,7 @@ static inline int
28set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo) 28set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
29{ 29{
30 struct iphdr *iph = (*pskb)->nh.iph; 30 struct iphdr *iph = (*pskb)->nh.iph;
31 u_int16_t oldtos; 31 __be16 oldtos;
32 32
33 if ((iph->tos & IPT_ECN_IP_MASK) != (einfo->ip_ect & IPT_ECN_IP_MASK)) { 33 if ((iph->tos & IPT_ECN_IP_MASK) != (einfo->ip_ect & IPT_ECN_IP_MASK)) {
34 if (!skb_make_writable(pskb, sizeof(struct iphdr))) 34 if (!skb_make_writable(pskb, sizeof(struct iphdr)))
@@ -37,7 +37,7 @@ set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
37 oldtos = iph->tos; 37 oldtos = iph->tos;
38 iph->tos &= ~IPT_ECN_IP_MASK; 38 iph->tos &= ~IPT_ECN_IP_MASK;
39 iph->tos |= (einfo->ip_ect & IPT_ECN_IP_MASK); 39 iph->tos |= (einfo->ip_ect & IPT_ECN_IP_MASK);
40 iph->check = nf_csum_update(oldtos ^ 0xFFFF, iph->tos, 40 iph->check = nf_csum_update(oldtos ^ htons(0xFFFF), iph->tos,
41 iph->check); 41 iph->check);
42 } 42 }
43 return 1; 43 return 1;
@@ -48,7 +48,7 @@ static inline int
48set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo) 48set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
49{ 49{
50 struct tcphdr _tcph, *tcph; 50 struct tcphdr _tcph, *tcph;
51 u_int16_t oldval; 51 __be16 oldval;
52 52
53 /* Not enought header? */ 53 /* Not enought header? */
54 tcph = skb_header_pointer(*pskb, (*pskb)->nh.iph->ihl*4, 54 tcph = skb_header_pointer(*pskb, (*pskb)->nh.iph->ihl*4,
@@ -66,15 +66,15 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
66 return 0; 66 return 0;
67 tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; 67 tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;
68 68
69 oldval = ((u_int16_t *)tcph)[6]; 69 oldval = ((__be16 *)tcph)[6];
70 if (einfo->operation & IPT_ECN_OP_SET_ECE) 70 if (einfo->operation & IPT_ECN_OP_SET_ECE)
71 tcph->ece = einfo->proto.tcp.ece; 71 tcph->ece = einfo->proto.tcp.ece;
72 if (einfo->operation & IPT_ECN_OP_SET_CWR) 72 if (einfo->operation & IPT_ECN_OP_SET_CWR)
73 tcph->cwr = einfo->proto.tcp.cwr; 73 tcph->cwr = einfo->proto.tcp.cwr;
74 74
75 tcph->check = nf_proto_csum_update((*pskb), 75 tcph->check = nf_proto_csum_update((*pskb),
76 oldval ^ 0xFFFF, 76 oldval ^ htons(0xFFFF),
77 ((u_int16_t *)tcph)[6], 77 ((__be16 *)tcph)[6],
78 tcph->check, 0); 78 tcph->check, 0);
79 return 1; 79 return 1;
80} 80}
diff --git a/net/ipv4/netfilter/ipt_NETMAP.c b/net/ipv4/netfilter/ipt_NETMAP.c
index beb2914225ff..58a88f227108 100644
--- a/net/ipv4/netfilter/ipt_NETMAP.c
+++ b/net/ipv4/netfilter/ipt_NETMAP.c
@@ -58,7 +58,7 @@ target(struct sk_buff **pskb,
58{ 58{
59 struct ip_conntrack *ct; 59 struct ip_conntrack *ct;
60 enum ip_conntrack_info ctinfo; 60 enum ip_conntrack_info ctinfo;
61 u_int32_t new_ip, netmask; 61 __be32 new_ip, netmask;
62 const struct ip_nat_multi_range_compat *mr = targinfo; 62 const struct ip_nat_multi_range_compat *mr = targinfo;
63 struct ip_nat_range newrange; 63 struct ip_nat_range newrange;
64 64
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index b81821edd893..fd0c05efed8a 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -104,8 +104,8 @@ static void send_reset(struct sk_buff *oldskb, int hook)
104 struct iphdr *iph = oldskb->nh.iph; 104 struct iphdr *iph = oldskb->nh.iph;
105 struct tcphdr _otcph, *oth, *tcph; 105 struct tcphdr _otcph, *oth, *tcph;
106 struct rtable *rt; 106 struct rtable *rt;
107 u_int16_t tmp_port; 107 __be16 tmp_port;
108 u_int32_t tmp_addr; 108 __be32 tmp_addr;
109 int needs_ack; 109 int needs_ack;
110 int hh_len; 110 int hh_len;
111 111
diff --git a/net/ipv4/netfilter/ipt_SAME.c b/net/ipv4/netfilter/ipt_SAME.c
index efbcb1198832..b38b13328d73 100644
--- a/net/ipv4/netfilter/ipt_SAME.c
+++ b/net/ipv4/netfilter/ipt_SAME.c
@@ -135,7 +135,8 @@ same_target(struct sk_buff **pskb,
135{ 135{
136 struct ip_conntrack *ct; 136 struct ip_conntrack *ct;
137 enum ip_conntrack_info ctinfo; 137 enum ip_conntrack_info ctinfo;
138 u_int32_t tmpip, aindex, new_ip; 138 u_int32_t tmpip, aindex;
139 __be32 new_ip;
139 const struct ipt_same_info *same = targinfo; 140 const struct ipt_same_info *same = targinfo;
140 struct ip_nat_range newrange; 141 struct ip_nat_range newrange;
141 const struct ip_conntrack_tuple *t; 142 const struct ip_conntrack_tuple *t;
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c
index 4246c4321e5b..108b6b76311f 100644
--- a/net/ipv4/netfilter/ipt_TCPMSS.c
+++ b/net/ipv4/netfilter/ipt_TCPMSS.c
@@ -42,7 +42,8 @@ ipt_tcpmss_target(struct sk_buff **pskb,
42 const struct ipt_tcpmss_info *tcpmssinfo = targinfo; 42 const struct ipt_tcpmss_info *tcpmssinfo = targinfo;
43 struct tcphdr *tcph; 43 struct tcphdr *tcph;
44 struct iphdr *iph; 44 struct iphdr *iph;
45 u_int16_t tcplen, newtotlen, oldval, newmss; 45 u_int16_t tcplen, newmss;
46 __be16 newtotlen, oldval;
46 unsigned int i; 47 unsigned int i;
47 u_int8_t *opt; 48 u_int8_t *opt;
48 49
@@ -97,7 +98,7 @@ ipt_tcpmss_target(struct sk_buff **pskb,
97 opt[i+3] = (newmss & 0x00ff); 98 opt[i+3] = (newmss & 0x00ff);
98 99
99 tcph->check = nf_proto_csum_update(*pskb, 100 tcph->check = nf_proto_csum_update(*pskb,
100 htons(oldmss)^0xFFFF, 101 htons(oldmss)^htons(0xFFFF),
101 htons(newmss), 102 htons(newmss),
102 tcph->check, 0); 103 tcph->check, 0);
103 return IPT_CONTINUE; 104 return IPT_CONTINUE;
@@ -126,7 +127,7 @@ ipt_tcpmss_target(struct sk_buff **pskb,
126 memmove(opt + TCPOLEN_MSS, opt, tcplen - sizeof(struct tcphdr)); 127 memmove(opt + TCPOLEN_MSS, opt, tcplen - sizeof(struct tcphdr));
127 128
128 tcph->check = nf_proto_csum_update(*pskb, 129 tcph->check = nf_proto_csum_update(*pskb,
129 htons(tcplen) ^ 0xFFFF, 130 htons(tcplen) ^ htons(0xFFFF),
130 htons(tcplen + TCPOLEN_MSS), 131 htons(tcplen + TCPOLEN_MSS),
131 tcph->check, 1); 132 tcph->check, 1);
132 opt[0] = TCPOPT_MSS; 133 opt[0] = TCPOPT_MSS;
@@ -134,18 +135,18 @@ ipt_tcpmss_target(struct sk_buff **pskb,
134 opt[2] = (newmss & 0xff00) >> 8; 135 opt[2] = (newmss & 0xff00) >> 8;
135 opt[3] = (newmss & 0x00ff); 136 opt[3] = (newmss & 0x00ff);
136 137
137 tcph->check = nf_proto_csum_update(*pskb, ~0, *((u_int32_t *)opt), 138 tcph->check = nf_proto_csum_update(*pskb, htonl(~0), *((__be32 *)opt),
138 tcph->check, 0); 139 tcph->check, 0);
139 140
140 oldval = ((u_int16_t *)tcph)[6]; 141 oldval = ((__be16 *)tcph)[6];
141 tcph->doff += TCPOLEN_MSS/4; 142 tcph->doff += TCPOLEN_MSS/4;
142 tcph->check = nf_proto_csum_update(*pskb, 143 tcph->check = nf_proto_csum_update(*pskb,
143 oldval ^ 0xFFFF, 144 oldval ^ htons(0xFFFF),
144 ((u_int16_t *)tcph)[6], 145 ((__be16 *)tcph)[6],
145 tcph->check, 0); 146 tcph->check, 0);
146 147
147 newtotlen = htons(ntohs(iph->tot_len) + TCPOLEN_MSS); 148 newtotlen = htons(ntohs(iph->tot_len) + TCPOLEN_MSS);
148 iph->check = nf_csum_update(iph->tot_len ^ 0xFFFF, 149 iph->check = nf_csum_update(iph->tot_len ^ htons(0xFFFF),
149 newtotlen, iph->check); 150 newtotlen, iph->check);
150 iph->tot_len = newtotlen; 151 iph->tot_len = newtotlen;
151 return IPT_CONTINUE; 152 return IPT_CONTINUE;
diff --git a/net/ipv4/netfilter/ipt_TOS.c b/net/ipv4/netfilter/ipt_TOS.c
index 471a4c438b0a..6b8b14ccc3d3 100644
--- a/net/ipv4/netfilter/ipt_TOS.c
+++ b/net/ipv4/netfilter/ipt_TOS.c
@@ -30,7 +30,7 @@ target(struct sk_buff **pskb,
30{ 30{
31 const struct ipt_tos_target_info *tosinfo = targinfo; 31 const struct ipt_tos_target_info *tosinfo = targinfo;
32 struct iphdr *iph = (*pskb)->nh.iph; 32 struct iphdr *iph = (*pskb)->nh.iph;
33 u_int16_t oldtos; 33 __be16 oldtos;
34 34
35 if ((iph->tos & IPTOS_TOS_MASK) != tosinfo->tos) { 35 if ((iph->tos & IPTOS_TOS_MASK) != tosinfo->tos) {
36 if (!skb_make_writable(pskb, sizeof(struct iphdr))) 36 if (!skb_make_writable(pskb, sizeof(struct iphdr)))
@@ -38,7 +38,7 @@ target(struct sk_buff **pskb,
38 iph = (*pskb)->nh.iph; 38 iph = (*pskb)->nh.iph;
39 oldtos = iph->tos; 39 oldtos = iph->tos;
40 iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos; 40 iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos;
41 iph->check = nf_csum_update(oldtos ^ 0xFFFF, iph->tos, 41 iph->check = nf_csum_update(oldtos ^ htons(0xFFFF), iph->tos,
42 iph->check); 42 iph->check);
43 } 43 }
44 return IPT_CONTINUE; 44 return IPT_CONTINUE;
diff --git a/net/ipv4/netfilter/ipt_TTL.c b/net/ipv4/netfilter/ipt_TTL.c
index 96e79cc6d0f2..ac9517d62af0 100644
--- a/net/ipv4/netfilter/ipt_TTL.c
+++ b/net/ipv4/netfilter/ipt_TTL.c
@@ -54,8 +54,8 @@ ipt_ttl_target(struct sk_buff **pskb,
54 } 54 }
55 55
56 if (new_ttl != iph->ttl) { 56 if (new_ttl != iph->ttl) {
57 iph->check = nf_csum_update(ntohs((iph->ttl << 8)) ^ 0xFFFF, 57 iph->check = nf_csum_update(htons((iph->ttl << 8)) ^ htons(0xFFFF),
58 ntohs(new_ttl << 8), 58 htons(new_ttl << 8),
59 iph->check); 59 iph->check);
60 iph->ttl = new_ttl; 60 iph->ttl = new_ttl;
61 } 61 }
diff --git a/net/ipv4/netfilter/ipt_hashlimit.c b/net/ipv4/netfilter/ipt_hashlimit.c
index 4f73a61aa3dd..33ccdbf8e794 100644
--- a/net/ipv4/netfilter/ipt_hashlimit.c
+++ b/net/ipv4/netfilter/ipt_hashlimit.c
@@ -50,11 +50,11 @@ static struct file_operations dl_file_ops;
50/* hash table crap */ 50/* hash table crap */
51 51
52struct dsthash_dst { 52struct dsthash_dst {
53 u_int32_t src_ip; 53 __be32 src_ip;
54 u_int32_t dst_ip; 54 __be32 dst_ip;
55 /* ports have to be consecutive !!! */ 55 /* ports have to be consecutive !!! */
56 u_int16_t src_port; 56 __be16 src_port;
57 u_int16_t dst_port; 57 __be16 dst_port;
58}; 58};
59 59
60struct dsthash_ent { 60struct dsthash_ent {
@@ -106,8 +106,10 @@ static inline int dst_cmp(const struct dsthash_ent *ent, struct dsthash_dst *b)
106static inline u_int32_t 106static inline u_int32_t
107hash_dst(const struct ipt_hashlimit_htable *ht, const struct dsthash_dst *dst) 107hash_dst(const struct ipt_hashlimit_htable *ht, const struct dsthash_dst *dst)
108{ 108{
109 return (jhash_3words(dst->dst_ip, (dst->dst_port<<16 | dst->src_port), 109 return (jhash_3words((__force u32)dst->dst_ip,
110 dst->src_ip, ht->rnd) % ht->cfg.size); 110 ((__force u32)dst->dst_port<<16 |
111 (__force u32)dst->src_port),
112 (__force u32)dst->src_ip, ht->rnd) % ht->cfg.size);
111} 113}
112 114
113static inline struct dsthash_ent * 115static inline struct dsthash_ent *
@@ -406,7 +408,7 @@ hashlimit_match(const struct sk_buff *skb,
406 dst.src_ip = skb->nh.iph->saddr; 408 dst.src_ip = skb->nh.iph->saddr;
407 if (hinfo->cfg.mode & IPT_HASHLIMIT_HASH_DPT 409 if (hinfo->cfg.mode & IPT_HASHLIMIT_HASH_DPT
408 ||hinfo->cfg.mode & IPT_HASHLIMIT_HASH_SPT) { 410 ||hinfo->cfg.mode & IPT_HASHLIMIT_HASH_SPT) {
409 u_int16_t _ports[2], *ports; 411 __be16 _ports[2], *ports;
410 412
411 switch (skb->nh.iph->protocol) { 413 switch (skb->nh.iph->protocol) {
412 case IPPROTO_TCP: 414 case IPPROTO_TCP:
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 32ae8d7ac506..126db44e71a8 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -50,11 +50,10 @@ MODULE_PARM_DESC(ip_list_perms, "permissions on /proc/net/ipt_recent/* files");
50MODULE_PARM_DESC(ip_list_uid,"owner of /proc/net/ipt_recent/* files"); 50MODULE_PARM_DESC(ip_list_uid,"owner of /proc/net/ipt_recent/* files");
51MODULE_PARM_DESC(ip_list_gid,"owning group of /proc/net/ipt_recent/* files"); 51MODULE_PARM_DESC(ip_list_gid,"owning group of /proc/net/ipt_recent/* files");
52 52
53
54struct recent_entry { 53struct recent_entry {
55 struct list_head list; 54 struct list_head list;
56 struct list_head lru_list; 55 struct list_head lru_list;
57 u_int32_t addr; 56 __be32 addr;
58 u_int8_t ttl; 57 u_int8_t ttl;
59 u_int8_t index; 58 u_int8_t index;
60 u_int16_t nstamps; 59 u_int16_t nstamps;
@@ -85,17 +84,17 @@ static struct file_operations recent_fops;
85static u_int32_t hash_rnd; 84static u_int32_t hash_rnd;
86static int hash_rnd_initted; 85static int hash_rnd_initted;
87 86
88static unsigned int recent_entry_hash(u_int32_t addr) 87static unsigned int recent_entry_hash(__be32 addr)
89{ 88{
90 if (!hash_rnd_initted) { 89 if (!hash_rnd_initted) {
91 get_random_bytes(&hash_rnd, 4); 90 get_random_bytes(&hash_rnd, 4);
92 hash_rnd_initted = 1; 91 hash_rnd_initted = 1;
93 } 92 }
94 return jhash_1word(addr, hash_rnd) & (ip_list_hash_size - 1); 93 return jhash_1word((__force u32)addr, hash_rnd) & (ip_list_hash_size - 1);
95} 94}
96 95
97static struct recent_entry * 96static struct recent_entry *
98recent_entry_lookup(const struct recent_table *table, u_int32_t addr, u_int8_t ttl) 97recent_entry_lookup(const struct recent_table *table, __be32 addr, u_int8_t ttl)
99{ 98{
100 struct recent_entry *e; 99 struct recent_entry *e;
101 unsigned int h; 100 unsigned int h;
@@ -116,7 +115,7 @@ static void recent_entry_remove(struct recent_table *t, struct recent_entry *e)
116} 115}
117 116
118static struct recent_entry * 117static struct recent_entry *
119recent_entry_init(struct recent_table *t, u_int32_t addr, u_int8_t ttl) 118recent_entry_init(struct recent_table *t, __be32 addr, u_int8_t ttl)
120{ 119{
121 struct recent_entry *e; 120 struct recent_entry *e;
122 121
@@ -178,7 +177,7 @@ ipt_recent_match(const struct sk_buff *skb,
178 const struct ipt_recent_info *info = matchinfo; 177 const struct ipt_recent_info *info = matchinfo;
179 struct recent_table *t; 178 struct recent_table *t;
180 struct recent_entry *e; 179 struct recent_entry *e;
181 u_int32_t addr; 180 __be32 addr;
182 u_int8_t ttl; 181 u_int8_t ttl;
183 int ret = info->invert; 182 int ret = info->invert;
184 183
@@ -406,7 +405,7 @@ static ssize_t recent_proc_write(struct file *file, const char __user *input,
406 struct recent_table *t = pde->data; 405 struct recent_table *t = pde->data;
407 struct recent_entry *e; 406 struct recent_entry *e;
408 char buf[sizeof("+255.255.255.255")], *c = buf; 407 char buf[sizeof("+255.255.255.255")], *c = buf;
409 u_int32_t addr; 408 __be32 addr;
410 int add; 409 int add;
411 410
412 if (size > sizeof(buf)) 411 if (size > sizeof(buf))
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index 79336cb42527..e62ea2bb9c0a 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -131,7 +131,7 @@ ipt_local_hook(unsigned int hook,
131{ 131{
132 unsigned int ret; 132 unsigned int ret;
133 u_int8_t tos; 133 u_int8_t tos;
134 u_int32_t saddr, daddr; 134 __be32 saddr, daddr;
135 unsigned long nfmark; 135 unsigned long nfmark;
136 136
137 /* root is playing with raw sockets. */ 137 /* root is playing with raw sockets. */