projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'nfc-next-3.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
[firefly-linux-kernel-4.4.55.git]
/
net
/
netfilter
/
ipvs
/
ip_vs_proto_tcp.c
diff --git
a/net/netfilter/ipvs/ip_vs_proto_tcp.c
b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index cd609cc62721095baf50475d14e80384089f280a..9af653a75825d0568450445ee3f5828622ac997c 100644
(file)
--- a/
net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/
net/netfilter/ipvs/ip_vs_proto_tcp.c
@@
-33,16
+33,14
@@
static int
tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
static int
tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
- int *verdict, struct ip_vs_conn **cpp)
+ int *verdict, struct ip_vs_conn **cpp,
+ struct ip_vs_iphdr *iph)
{
struct net *net;
struct ip_vs_service *svc;
struct tcphdr _tcph, *th;
{
struct net *net;
struct ip_vs_service *svc;
struct tcphdr _tcph, *th;
- struct ip_vs_iphdr iph;
- ip_vs_fill_iphdr(af, skb_network_header(skb), &iph);
-
- th = skb_header_pointer(skb, iph.len, sizeof(_tcph), &_tcph);
+ th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph);
if (th == NULL) {
*verdict = NF_DROP;
return 0;
if (th == NULL) {
*verdict = NF_DROP;
return 0;
@@
-50,8
+48,8
@@
tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
net = skb_net(skb);
/* No !th->ack check to allow scheduling on SYN+ACK for Active FTP */
if (th->syn &&
net = skb_net(skb);
/* No !th->ack check to allow scheduling on SYN+ACK for Active FTP */
if (th->syn &&
- (svc = ip_vs_service_get(net, af, skb->mark, iph
.
protocol,
- &iph
.
daddr, th->dest))) {
+ (svc = ip_vs_service_get(net, af, skb->mark, iph
->
protocol,
+ &iph
->
daddr, th->dest))) {
int ignored;
if (ip_vs_todrop(net_ipvs(net))) {
int ignored;
if (ip_vs_todrop(net_ipvs(net))) {
@@
-68,10
+66,10
@@
tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
* Let the virtual server select a real server for the
* incoming connection, and create a connection entry.
*/
* Let the virtual server select a real server for the
* incoming connection, and create a connection entry.
*/
- *cpp = ip_vs_schedule(svc, skb, pd, &ignored);
+ *cpp = ip_vs_schedule(svc, skb, pd, &ignored
, iph
);
if (!*cpp && ignored <= 0) {
if (!ignored)
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd);
+ *verdict = ip_vs_leave(svc, skb, pd
, iph
);
else {
ip_vs_service_put(svc);
*verdict = NF_DROP;
else {
ip_vs_service_put(svc);
*verdict = NF_DROP;
@@
-128,20
+126,18
@@
tcp_partial_csum_update(int af, struct tcphdr *tcph,
static int
static int
-tcp_snat_handler(struct sk_buff *skb,
- struct ip_vs_
protocol *pp, struct ip_vs_conn *cp
)
+tcp_snat_handler(struct sk_buff *skb,
struct ip_vs_protocol *pp,
+ struct ip_vs_
conn *cp, struct ip_vs_iphdr *iph
)
{
struct tcphdr *tcph;
{
struct tcphdr *tcph;
- unsigned int tcphoff;
+ unsigned int tcphoff
= iph->len
;
int oldlen;
int payload_csum = 0;
#ifdef CONFIG_IP_VS_IPV6
int oldlen;
int payload_csum = 0;
#ifdef CONFIG_IP_VS_IPV6
- if (cp->af == AF_INET6)
- tcphoff = sizeof(struct ipv6hdr);
- else
+ if (cp->af == AF_INET6 && iph->fragoffs)
+ return 1;
#endif
#endif
- tcphoff = ip_hdrlen(skb);
oldlen = skb->len - tcphoff;
/* csum_check requires unshared skb */
oldlen = skb->len - tcphoff;
/* csum_check requires unshared skb */
@@
-208,20
+204,18
@@
tcp_snat_handler(struct sk_buff *skb,
static int
static int
-tcp_dnat_handler(struct sk_buff *skb,
- struct ip_vs_
protocol *pp, struct ip_vs_conn *cp
)
+tcp_dnat_handler(struct sk_buff *skb,
struct ip_vs_protocol *pp,
+ struct ip_vs_
conn *cp, struct ip_vs_iphdr *iph
)
{
struct tcphdr *tcph;
{
struct tcphdr *tcph;
- unsigned int tcphoff;
+ unsigned int tcphoff
= iph->len
;
int oldlen;
int payload_csum = 0;
#ifdef CONFIG_IP_VS_IPV6
int oldlen;
int payload_csum = 0;
#ifdef CONFIG_IP_VS_IPV6
- if (cp->af == AF_INET6)
- tcphoff = sizeof(struct ipv6hdr);
- else
+ if (cp->af == AF_INET6 && iph->fragoffs)
+ return 1;
#endif
#endif
- tcphoff = ip_hdrlen(skb);
oldlen = skb->len - tcphoff;
/* csum_check requires unshared skb */
oldlen = skb->len - tcphoff;
/* csum_check requires unshared skb */