diff options
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_app.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_app.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 341474eefa55..664cb8e97c1c 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
26 | #include <linux/in.h> | 26 | #include <linux/in.h> |
27 | #include <linux/ip.h> | 27 | #include <linux/ip.h> |
28 | #include <linux/netfilter.h> | ||
28 | #include <net/net_namespace.h> | 29 | #include <net/net_namespace.h> |
29 | #include <net/protocol.h> | 30 | #include <net/protocol.h> |
30 | #include <net/tcp.h> | 31 | #include <net/tcp.h> |
@@ -328,18 +329,18 @@ static inline void vs_seq_update(struct ip_vs_conn *cp, struct ip_vs_seq *vseq, | |||
328 | spin_unlock(&cp->lock); | 329 | spin_unlock(&cp->lock); |
329 | } | 330 | } |
330 | 331 | ||
331 | static inline int app_tcp_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb, | 332 | static inline int app_tcp_pkt_out(struct ip_vs_conn *cp, struct sk_buff *skb, |
332 | struct ip_vs_app *app) | 333 | struct ip_vs_app *app) |
333 | { | 334 | { |
334 | int diff; | 335 | int diff; |
335 | const unsigned int tcp_offset = ip_hdrlen(*pskb); | 336 | const unsigned int tcp_offset = ip_hdrlen(skb); |
336 | struct tcphdr *th; | 337 | struct tcphdr *th; |
337 | __u32 seq; | 338 | __u32 seq; |
338 | 339 | ||
339 | if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th))) | 340 | if (!skb_make_writable(skb, tcp_offset + sizeof(*th))) |
340 | return 0; | 341 | return 0; |
341 | 342 | ||
342 | th = (struct tcphdr *)(skb_network_header(*pskb) + tcp_offset); | 343 | th = (struct tcphdr *)(skb_network_header(skb) + tcp_offset); |
343 | 344 | ||
344 | /* | 345 | /* |
345 | * Remember seq number in case this pkt gets resized | 346 | * Remember seq number in case this pkt gets resized |
@@ -360,7 +361,7 @@ static inline int app_tcp_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb, | |||
360 | if (app->pkt_out == NULL) | 361 | if (app->pkt_out == NULL) |
361 | return 1; | 362 | return 1; |
362 | 363 | ||
363 | if (!app->pkt_out(app, cp, pskb, &diff)) | 364 | if (!app->pkt_out(app, cp, skb, &diff)) |
364 | return 0; | 365 | return 0; |
365 | 366 | ||
366 | /* | 367 | /* |
@@ -378,7 +379,7 @@ static inline int app_tcp_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb, | |||
378 | * called by ipvs packet handler, assumes previously checked cp!=NULL | 379 | * called by ipvs packet handler, assumes previously checked cp!=NULL |
379 | * returns false if it can't handle packet (oom) | 380 | * returns false if it can't handle packet (oom) |
380 | */ | 381 | */ |
381 | int ip_vs_app_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb) | 382 | int ip_vs_app_pkt_out(struct ip_vs_conn *cp, struct sk_buff *skb) |
382 | { | 383 | { |
383 | struct ip_vs_app *app; | 384 | struct ip_vs_app *app; |
384 | 385 | ||
@@ -391,7 +392,7 @@ int ip_vs_app_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb) | |||
391 | 392 | ||
392 | /* TCP is complicated */ | 393 | /* TCP is complicated */ |
393 | if (cp->protocol == IPPROTO_TCP) | 394 | if (cp->protocol == IPPROTO_TCP) |
394 | return app_tcp_pkt_out(cp, pskb, app); | 395 | return app_tcp_pkt_out(cp, skb, app); |
395 | 396 | ||
396 | /* | 397 | /* |
397 | * Call private output hook function | 398 | * Call private output hook function |
@@ -399,22 +400,22 @@ int ip_vs_app_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb) | |||
399 | if (app->pkt_out == NULL) | 400 | if (app->pkt_out == NULL) |
400 | return 1; | 401 | return 1; |
401 | 402 | ||
402 | return app->pkt_out(app, cp, pskb, NULL); | 403 | return app->pkt_out(app, cp, skb, NULL); |
403 | } | 404 | } |
404 | 405 | ||
405 | 406 | ||
406 | static inline int app_tcp_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb, | 407 | static inline int app_tcp_pkt_in(struct ip_vs_conn *cp, struct sk_buff *skb, |
407 | struct ip_vs_app *app) | 408 | struct ip_vs_app *app) |
408 | { | 409 | { |
409 | int diff; | 410 | int diff; |
410 | const unsigned int tcp_offset = ip_hdrlen(*pskb); | 411 | const unsigned int tcp_offset = ip_hdrlen(skb); |
411 | struct tcphdr *th; | 412 | struct tcphdr *th; |
412 | __u32 seq; | 413 | __u32 seq; |
413 | 414 | ||
414 | if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th))) | 415 | if (!skb_make_writable(skb, tcp_offset + sizeof(*th))) |
415 | return 0; | 416 | return 0; |
416 | 417 | ||
417 | th = (struct tcphdr *)(skb_network_header(*pskb) + tcp_offset); | 418 | th = (struct tcphdr *)(skb_network_header(skb) + tcp_offset); |
418 | 419 | ||
419 | /* | 420 | /* |
420 | * Remember seq number in case this pkt gets resized | 421 | * Remember seq number in case this pkt gets resized |
@@ -435,7 +436,7 @@ static inline int app_tcp_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb, | |||
435 | if (app->pkt_in == NULL) | 436 | if (app->pkt_in == NULL) |
436 | return 1; | 437 | return 1; |
437 | 438 | ||
438 | if (!app->pkt_in(app, cp, pskb, &diff)) | 439 | if (!app->pkt_in(app, cp, skb, &diff)) |
439 | return 0; | 440 | return 0; |
440 | 441 | ||
441 | /* | 442 | /* |
@@ -453,7 +454,7 @@ static inline int app_tcp_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb, | |||
453 | * called by ipvs packet handler, assumes previously checked cp!=NULL. | 454 | * called by ipvs packet handler, assumes previously checked cp!=NULL. |
454 | * returns false if can't handle packet (oom). | 455 | * returns false if can't handle packet (oom). |
455 | */ | 456 | */ |
456 | int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb) | 457 | int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff *skb) |
457 | { | 458 | { |
458 | struct ip_vs_app *app; | 459 | struct ip_vs_app *app; |
459 | 460 | ||
@@ -466,7 +467,7 @@ int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb) | |||
466 | 467 | ||
467 | /* TCP is complicated */ | 468 | /* TCP is complicated */ |
468 | if (cp->protocol == IPPROTO_TCP) | 469 | if (cp->protocol == IPPROTO_TCP) |
469 | return app_tcp_pkt_in(cp, pskb, app); | 470 | return app_tcp_pkt_in(cp, skb, app); |
470 | 471 | ||
471 | /* | 472 | /* |
472 | * Call private input hook function | 473 | * Call private input hook function |
@@ -474,7 +475,7 @@ int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb) | |||
474 | if (app->pkt_in == NULL) | 475 | if (app->pkt_in == NULL) |
475 | return 1; | 476 | return 1; |
476 | 477 | ||
477 | return app->pkt_in(app, cp, pskb, NULL); | 478 | return app->pkt_in(app, cp, skb, NULL); |
478 | } | 479 | } |
479 | 480 | ||
480 | 481 | ||