aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs/ip_vs_ftp.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-10-15 03:53:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-15 15:26:29 -0400
commit3db05fea51cdb162cfa8f69e9cfb9e228919d2a9 (patch)
tree0d0e4c18cdf2dcb7321035f6614628a2ddfb502d /net/ipv4/ipvs/ip_vs_ftp.c
parent2ca7b0ac022aa0158599178fe1056b1ba9ec8b97 (diff)
[NETFILTER]: Replace sk_buff ** with sk_buff *
With all the users of the double pointers removed, this patch mops up by finally replacing all occurances of sk_buff ** in the netfilter API by sk_buff *. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ftp.c')
-rw-r--r--net/ipv4/ipvs/ip_vs_ftp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index 4167d419b666..59aa166b7678 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -136,7 +136,7 @@ static int ip_vs_ftp_get_addrport(char *data, char *data_limit,
136 * xxx,xxx,xxx,xxx is the server address, ppp,ppp is the server port number. 136 * xxx,xxx,xxx,xxx is the server address, ppp,ppp is the server port number.
137 */ 137 */
138static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, 138static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
139 struct sk_buff **pskb, int *diff) 139 struct sk_buff *skb, int *diff)
140{ 140{
141 struct iphdr *iph; 141 struct iphdr *iph;
142 struct tcphdr *th; 142 struct tcphdr *th;
@@ -156,14 +156,14 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
156 return 1; 156 return 1;
157 157
158 /* Linear packets are much easier to deal with. */ 158 /* Linear packets are much easier to deal with. */
159 if (!skb_make_writable(*pskb, (*pskb)->len)) 159 if (!skb_make_writable(skb, skb->len))
160 return 0; 160 return 0;
161 161
162 if (cp->app_data == &ip_vs_ftp_pasv) { 162 if (cp->app_data == &ip_vs_ftp_pasv) {
163 iph = ip_hdr(*pskb); 163 iph = ip_hdr(skb);
164 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); 164 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
165 data = (char *)th + (th->doff << 2); 165 data = (char *)th + (th->doff << 2);
166 data_limit = skb_tail_pointer(*pskb); 166 data_limit = skb_tail_pointer(skb);
167 167
168 if (ip_vs_ftp_get_addrport(data, data_limit, 168 if (ip_vs_ftp_get_addrport(data, data_limit,
169 SERVER_STRING, 169 SERVER_STRING,
@@ -214,7 +214,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
214 memcpy(start, buf, buf_len); 214 memcpy(start, buf, buf_len);
215 ret = 1; 215 ret = 1;
216 } else { 216 } else {
217 ret = !ip_vs_skb_replace(*pskb, GFP_ATOMIC, start, 217 ret = !ip_vs_skb_replace(skb, GFP_ATOMIC, start,
218 end-start, buf, buf_len); 218 end-start, buf, buf_len);
219 } 219 }
220 220
@@ -239,7 +239,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
239 * the client. 239 * the client.
240 */ 240 */
241static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, 241static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
242 struct sk_buff **pskb, int *diff) 242 struct sk_buff *skb, int *diff)
243{ 243{
244 struct iphdr *iph; 244 struct iphdr *iph;
245 struct tcphdr *th; 245 struct tcphdr *th;
@@ -257,20 +257,20 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
257 return 1; 257 return 1;
258 258
259 /* Linear packets are much easier to deal with. */ 259 /* Linear packets are much easier to deal with. */
260 if (!skb_make_writable(*pskb, (*pskb)->len)) 260 if (!skb_make_writable(skb, skb->len))
261 return 0; 261 return 0;
262 262
263 /* 263 /*
264 * Detecting whether it is passive 264 * Detecting whether it is passive
265 */ 265 */
266 iph = ip_hdr(*pskb); 266 iph = ip_hdr(skb);
267 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); 267 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
268 268
269 /* Since there may be OPTIONS in the TCP packet and the HLEN is 269 /* Since there may be OPTIONS in the TCP packet and the HLEN is
270 the length of the header in 32-bit multiples, it is accurate 270 the length of the header in 32-bit multiples, it is accurate
271 to calculate data address by th+HLEN*4 */ 271 to calculate data address by th+HLEN*4 */
272 data = data_start = (char *)th + (th->doff << 2); 272 data = data_start = (char *)th + (th->doff << 2);
273 data_limit = skb_tail_pointer(*pskb); 273 data_limit = skb_tail_pointer(skb);
274 274
275 while (data <= data_limit - 6) { 275 while (data <= data_limit - 6) {
276 if (strnicmp(data, "PASV\r\n", 6) == 0) { 276 if (strnicmp(data, "PASV\r\n", 6) == 0) {