aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-03 13:18:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-03 13:18:21 -0400
commit4f9faaace217b854ae1e1746ee4ac44688ddadbd (patch)
tree34122d9e84349a394988d6bfc480115e4809776a /net/ipv4
parentbf640be423d60d954b9673527e106a461a129eb8 (diff)
parentf37f2c62a28e848e06399ea2f9be1e098212625c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits) rose: Wrong list_lock argument in rose_node seqops netns: Fix reassembly timer to use the right namespace netns: Fix device renaming for sysfs bnx2: Update version to 1.7.5. bnx2: Update RV2P firmware for 5709. bnx2: Zero out context memory for 5709. bnx2: Fix register test on 5709. bnx2: Fix remote PHY initial link state. bnx2: Refine remote PHY locking. bridge: forwarding table information for >256 devices tg3: Update version to 3.92 tg3: Add link state reporting to UMP firmware tg3: Fix ethtool loopback test for 5761 BX devices tg3: Fix 5761 NVRAM sizes tg3: Use constant 500KHz MI clock on adapters with a CPMU hci_usb.h: fix hard-to-trigger race dccp: ccid2.c, ccid3.c use clamp(), clamp_t() net: remove NR_CPUS arrays in net/core/dev.c net: use get/put_unaligned_* helpers bluetooth: use get/put_unaligned_* helpers ...
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/cipso_ipv4.c18
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c6
-rw-r--r--net/ipv4/tcp_hybla.c6
-rw-r--r--net/ipv4/tcp_input.c18
-rw-r--r--net/ipv4/tcp_ipv4.c10
-rw-r--r--net/ipv4/tcp_vegas.c6
-rw-r--r--net/ipv4/tcp_veno.c6
-rw-r--r--net/ipv4/udp.c7
8 files changed, 38 insertions, 39 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 4637ded3dba8..05afb576d935 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -983,7 +983,7 @@ static int cipso_v4_map_cat_enum_valid(const struct cipso_v4_doi *doi_def,
983 return -EFAULT; 983 return -EFAULT;
984 984
985 for (iter = 0; iter < enumcat_len; iter += 2) { 985 for (iter = 0; iter < enumcat_len; iter += 2) {
986 cat = ntohs(get_unaligned((__be16 *)&enumcat[iter])); 986 cat = get_unaligned_be16(&enumcat[iter]);
987 if (cat <= cat_prev) 987 if (cat <= cat_prev)
988 return -EFAULT; 988 return -EFAULT;
989 cat_prev = cat; 989 cat_prev = cat;
@@ -1052,7 +1052,7 @@ static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def,
1052 1052
1053 for (iter = 0; iter < net_cat_len; iter += 2) { 1053 for (iter = 0; iter < net_cat_len; iter += 2) {
1054 ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat, 1054 ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat,
1055 ntohs(get_unaligned((__be16 *)&net_cat[iter])), 1055 get_unaligned_be16(&net_cat[iter]),
1056 GFP_ATOMIC); 1056 GFP_ATOMIC);
1057 if (ret_val != 0) 1057 if (ret_val != 0)
1058 return ret_val; 1058 return ret_val;
@@ -1086,10 +1086,9 @@ static int cipso_v4_map_cat_rng_valid(const struct cipso_v4_doi *doi_def,
1086 return -EFAULT; 1086 return -EFAULT;
1087 1087
1088 for (iter = 0; iter < rngcat_len; iter += 4) { 1088 for (iter = 0; iter < rngcat_len; iter += 4) {
1089 cat_high = ntohs(get_unaligned((__be16 *)&rngcat[iter])); 1089 cat_high = get_unaligned_be16(&rngcat[iter]);
1090 if ((iter + 4) <= rngcat_len) 1090 if ((iter + 4) <= rngcat_len)
1091 cat_low = ntohs( 1091 cat_low = get_unaligned_be16(&rngcat[iter + 2]);
1092 get_unaligned((__be16 *)&rngcat[iter + 2]));
1093 else 1092 else
1094 cat_low = 0; 1093 cat_low = 0;
1095 1094
@@ -1188,10 +1187,9 @@ static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def,
1188 u16 cat_high; 1187 u16 cat_high;
1189 1188
1190 for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) { 1189 for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) {
1191 cat_high = ntohs(get_unaligned((__be16 *)&net_cat[net_iter])); 1190 cat_high = get_unaligned_be16(&net_cat[net_iter]);
1192 if ((net_iter + 4) <= net_cat_len) 1191 if ((net_iter + 4) <= net_cat_len)
1193 cat_low = ntohs( 1192 cat_low = get_unaligned_be16(&net_cat[net_iter + 2]);
1194 get_unaligned((__be16 *)&net_cat[net_iter + 2]));
1195 else 1193 else
1196 cat_low = 0; 1194 cat_low = 0;
1197 1195
@@ -1562,7 +1560,7 @@ int cipso_v4_validate(unsigned char **option)
1562 } 1560 }
1563 1561
1564 rcu_read_lock(); 1562 rcu_read_lock();
1565 doi_def = cipso_v4_doi_search(ntohl(get_unaligned((__be32 *)&opt[2]))); 1563 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
1566 if (doi_def == NULL) { 1564 if (doi_def == NULL) {
1567 err_offset = 2; 1565 err_offset = 2;
1568 goto validate_return_locked; 1566 goto validate_return_locked;
@@ -1843,7 +1841,7 @@ static int cipso_v4_getattr(const unsigned char *cipso,
1843 if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0) 1841 if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0)
1844 return 0; 1842 return 0;
1845 1843
1846 doi = ntohl(get_unaligned((__be32 *)&cipso[2])); 1844 doi = get_unaligned_be32(&cipso[2]);
1847 rcu_read_lock(); 1845 rcu_read_lock();
1848 doi_def = cipso_v4_doi_search(doi); 1846 doi_def = cipso_v4_doi_search(doi);
1849 if (doi_def == NULL) 1847 if (doi_def == NULL)
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 22d8e7cd9197..1819ad7ab910 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip,
169 169
170 /* create proc dir entry */ 170 /* create proc dir entry */
171 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); 171 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
172 c->pde = proc_create(buffer, S_IWUSR|S_IRUSR, 172 c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
173 clusterip_procdir, &clusterip_proc_fops); 173 clusterip_procdir,
174 &clusterip_proc_fops, c);
174 if (!c->pde) { 175 if (!c->pde) {
175 kfree(c); 176 kfree(c);
176 return NULL; 177 return NULL;
177 } 178 }
178 } 179 }
179 c->pde->data = c;
180#endif 180#endif
181 181
182 write_lock_bh(&clusterip_lock); 182 write_lock_bh(&clusterip_lock);
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index 44618b675916..bfcbd148a89d 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -101,8 +101,10 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
101 if (!tcp_is_cwnd_limited(sk, in_flight)) 101 if (!tcp_is_cwnd_limited(sk, in_flight))
102 return; 102 return;
103 103
104 if (!ca->hybla_en) 104 if (!ca->hybla_en) {
105 return tcp_reno_cong_avoid(sk, ack, in_flight); 105 tcp_reno_cong_avoid(sk, ack, in_flight);
106 return;
107 }
106 108
107 if (ca->rho == 0) 109 if (ca->rho == 0)
108 hybla_recalc_param(sk); 110 hybla_recalc_param(sk);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 0298f80681f2..eda4f4a233f3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1172,8 +1172,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
1172 struct tcp_sack_block_wire *sp, int num_sacks, 1172 struct tcp_sack_block_wire *sp, int num_sacks,
1173 u32 prior_snd_una) 1173 u32 prior_snd_una)
1174{ 1174{
1175 u32 start_seq_0 = ntohl(get_unaligned(&sp[0].start_seq)); 1175 u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq);
1176 u32 end_seq_0 = ntohl(get_unaligned(&sp[0].end_seq)); 1176 u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq);
1177 int dup_sack = 0; 1177 int dup_sack = 0;
1178 1178
1179 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) { 1179 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) {
@@ -1181,8 +1181,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
1181 tcp_dsack_seen(tp); 1181 tcp_dsack_seen(tp);
1182 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); 1182 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
1183 } else if (num_sacks > 1) { 1183 } else if (num_sacks > 1) {
1184 u32 end_seq_1 = ntohl(get_unaligned(&sp[1].end_seq)); 1184 u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq);
1185 u32 start_seq_1 = ntohl(get_unaligned(&sp[1].start_seq)); 1185 u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq);
1186 1186
1187 if (!after(end_seq_0, end_seq_1) && 1187 if (!after(end_seq_0, end_seq_1) &&
1188 !before(start_seq_0, start_seq_1)) { 1188 !before(start_seq_0, start_seq_1)) {
@@ -1453,8 +1453,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1453 for (i = 0; i < num_sacks; i++) { 1453 for (i = 0; i < num_sacks; i++) {
1454 int dup_sack = !i && found_dup_sack; 1454 int dup_sack = !i && found_dup_sack;
1455 1455
1456 sp[used_sacks].start_seq = ntohl(get_unaligned(&sp_wire[i].start_seq)); 1456 sp[used_sacks].start_seq = get_unaligned_be32(&sp_wire[i].start_seq);
1457 sp[used_sacks].end_seq = ntohl(get_unaligned(&sp_wire[i].end_seq)); 1457 sp[used_sacks].end_seq = get_unaligned_be32(&sp_wire[i].end_seq);
1458 1458
1459 if (!tcp_is_sackblock_valid(tp, dup_sack, 1459 if (!tcp_is_sackblock_valid(tp, dup_sack,
1460 sp[used_sacks].start_seq, 1460 sp[used_sacks].start_seq,
@@ -3340,7 +3340,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
3340 switch (opcode) { 3340 switch (opcode) {
3341 case TCPOPT_MSS: 3341 case TCPOPT_MSS:
3342 if (opsize == TCPOLEN_MSS && th->syn && !estab) { 3342 if (opsize == TCPOLEN_MSS && th->syn && !estab) {
3343 u16 in_mss = ntohs(get_unaligned((__be16 *)ptr)); 3343 u16 in_mss = get_unaligned_be16(ptr);
3344 if (in_mss) { 3344 if (in_mss) {
3345 if (opt_rx->user_mss && 3345 if (opt_rx->user_mss &&
3346 opt_rx->user_mss < in_mss) 3346 opt_rx->user_mss < in_mss)
@@ -3369,8 +3369,8 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
3369 ((estab && opt_rx->tstamp_ok) || 3369 ((estab && opt_rx->tstamp_ok) ||
3370 (!estab && sysctl_tcp_timestamps))) { 3370 (!estab && sysctl_tcp_timestamps))) {
3371 opt_rx->saw_tstamp = 1; 3371 opt_rx->saw_tstamp = 1;
3372 opt_rx->rcv_tsval = ntohl(get_unaligned((__be32 *)ptr)); 3372 opt_rx->rcv_tsval = get_unaligned_be32(ptr);
3373 opt_rx->rcv_tsecr = ntohl(get_unaligned((__be32 *)(ptr+4))); 3373 opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4);
3374 } 3374 }
3375 break; 3375 break;
3376 case TCPOPT_SACK_PERM: 3376 case TCPOPT_SACK_PERM:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0e9bc120707d..cd601a866c2f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2214,9 +2214,6 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
2214 struct tcp_iter_state *s; 2214 struct tcp_iter_state *s;
2215 int err; 2215 int err;
2216 2216
2217 if (unlikely(afinfo == NULL))
2218 return -EINVAL;
2219
2220 err = seq_open_net(inode, file, &afinfo->seq_ops, 2217 err = seq_open_net(inode, file, &afinfo->seq_ops,
2221 sizeof(struct tcp_iter_state)); 2218 sizeof(struct tcp_iter_state));
2222 if (err < 0) 2219 if (err < 0)
@@ -2241,10 +2238,9 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
2241 afinfo->seq_ops.next = tcp_seq_next; 2238 afinfo->seq_ops.next = tcp_seq_next;
2242 afinfo->seq_ops.stop = tcp_seq_stop; 2239 afinfo->seq_ops.stop = tcp_seq_stop;
2243 2240
2244 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); 2241 p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
2245 if (p) 2242 &afinfo->seq_fops, afinfo);
2246 p->data = afinfo; 2243 if (!p)
2247 else
2248 rc = -ENOMEM; 2244 rc = -ENOMEM;
2249 return rc; 2245 return rc;
2250} 2246}
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 0e1a8c91f78e..14504dada116 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -167,8 +167,10 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
167 struct tcp_sock *tp = tcp_sk(sk); 167 struct tcp_sock *tp = tcp_sk(sk);
168 struct vegas *vegas = inet_csk_ca(sk); 168 struct vegas *vegas = inet_csk_ca(sk);
169 169
170 if (!vegas->doing_vegas_now) 170 if (!vegas->doing_vegas_now) {
171 return tcp_reno_cong_avoid(sk, ack, in_flight); 171 tcp_reno_cong_avoid(sk, ack, in_flight);
172 return;
173 }
172 174
173 /* The key players are v_beg_snd_una and v_beg_snd_nxt. 175 /* The key players are v_beg_snd_una and v_beg_snd_nxt.
174 * 176 *
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 2bf618a3b00b..d08b2e855c22 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -119,8 +119,10 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
119 struct tcp_sock *tp = tcp_sk(sk); 119 struct tcp_sock *tp = tcp_sk(sk);
120 struct veno *veno = inet_csk_ca(sk); 120 struct veno *veno = inet_csk_ca(sk);
121 121
122 if (!veno->doing_veno_now) 122 if (!veno->doing_veno_now) {
123 return tcp_reno_cong_avoid(sk, ack, in_flight); 123 tcp_reno_cong_avoid(sk, ack, in_flight);
124 return;
125 }
124 126
125 /* limited by applications */ 127 /* limited by applications */
126 if (!tcp_is_cwnd_limited(sk, in_flight)) 128 if (!tcp_is_cwnd_limited(sk, in_flight))
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 1f535e315188..db1cb7c96d63 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1605,10 +1605,9 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
1605 afinfo->seq_ops.next = udp_seq_next; 1605 afinfo->seq_ops.next = udp_seq_next;
1606 afinfo->seq_ops.stop = udp_seq_stop; 1606 afinfo->seq_ops.stop = udp_seq_stop;
1607 1607
1608 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); 1608 p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
1609 if (p) 1609 &afinfo->seq_fops, afinfo);
1610 p->data = afinfo; 1610 if (!p)
1611 else
1612 rc = -ENOMEM; 1611 rc = -ENOMEM;
1613 return rc; 1612 return rc;
1614} 1613}