diff options
author | David S. Miller <davem@davemloft.net> | 2013-01-15 15:05:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-15 15:05:59 -0500 |
commit | 4b87f922598acf91eee18f71688a33f54f57bcde (patch) | |
tree | 9cdfe30c6b96c47093da5392ed82d147290cd64c /net/ipv4 | |
parent | 55eb555d9674e2ebe9d4de0146602f96ff18e7d6 (diff) | |
parent | daf3ec688e057f6060fb9bb0819feac7a8bbf45c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
Documentation/networking/ip-sysctl.txt
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Both conflicts were simply overlapping context.
A build fix for qlcnic is in here too, simply removing the added
devinit annotations which no longer exist.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 8 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_REJECT.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/iptable_nat.c | 15 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 15 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 4 |
7 files changed, 32 insertions, 15 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cc06a47f1216..a8e4f2665d5e 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
823 | if (!ifa) { | 823 | if (!ifa) { |
824 | ret = -ENOBUFS; | 824 | ret = -ENOBUFS; |
825 | ifa = inet_alloc_ifa(); | 825 | ifa = inet_alloc_ifa(); |
826 | INIT_HLIST_NODE(&ifa->hash); | ||
827 | if (!ifa) | 826 | if (!ifa) |
828 | break; | 827 | break; |
828 | INIT_HLIST_NODE(&ifa->hash); | ||
829 | if (colon) | 829 | if (colon) |
830 | memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ); | 830 | memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ); |
831 | else | 831 | else |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 3c9d20880283..d9c4f113d709 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -590,7 +590,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
590 | case IP_TTL: | 590 | case IP_TTL: |
591 | if (optlen < 1) | 591 | if (optlen < 1) |
592 | goto e_inval; | 592 | goto e_inval; |
593 | if (val != -1 && (val < 0 || val > 255)) | 593 | if (val != -1 && (val < 1 || val > 255)) |
594 | goto e_inval; | 594 | goto e_inval; |
595 | inet->uc_ttl = val; | 595 | inet->uc_ttl = val; |
596 | break; | 596 | break; |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index d763701cff1b..a2e50ae80b53 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE; /* My IP address */ | |||
136 | static __be32 ic_netmask = NONE; /* Netmask for local subnet */ | 136 | static __be32 ic_netmask = NONE; /* Netmask for local subnet */ |
137 | __be32 ic_gateway = NONE; /* Gateway IP address */ | 137 | __be32 ic_gateway = NONE; /* Gateway IP address */ |
138 | 138 | ||
139 | __be32 ic_addrservaddr = NONE; /* IP Address of the IP addresses'server */ | ||
140 | |||
139 | __be32 ic_servaddr = NONE; /* Boot server IP address */ | 141 | __be32 ic_servaddr = NONE; /* Boot server IP address */ |
140 | 142 | ||
141 | __be32 root_server_addr = NONE; /* Address of NFS server */ | 143 | __be32 root_server_addr = NONE; /* Address of NFS server */ |
@@ -558,6 +560,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
558 | if (ic_myaddr == NONE) | 560 | if (ic_myaddr == NONE) |
559 | ic_myaddr = tip; | 561 | ic_myaddr = tip; |
560 | ic_servaddr = sip; | 562 | ic_servaddr = sip; |
563 | ic_addrservaddr = sip; | ||
561 | ic_got_reply = IC_RARP; | 564 | ic_got_reply = IC_RARP; |
562 | 565 | ||
563 | drop_unlock: | 566 | drop_unlock: |
@@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
1068 | ic_servaddr = server_id; | 1071 | ic_servaddr = server_id; |
1069 | #ifdef IPCONFIG_DEBUG | 1072 | #ifdef IPCONFIG_DEBUG |
1070 | printk("DHCP: Offered address %pI4 by server %pI4\n", | 1073 | printk("DHCP: Offered address %pI4 by server %pI4\n", |
1071 | &ic_myaddr, &ic_servaddr); | 1074 | &ic_myaddr, &b->iph.saddr); |
1072 | #endif | 1075 | #endif |
1073 | /* The DHCP indicated server address takes | 1076 | /* The DHCP indicated server address takes |
1074 | * precedence over the bootp header one if | 1077 | * precedence over the bootp header one if |
@@ -1113,6 +1116,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
1113 | ic_dev = dev; | 1116 | ic_dev = dev; |
1114 | ic_myaddr = b->your_ip; | 1117 | ic_myaddr = b->your_ip; |
1115 | ic_servaddr = b->server_ip; | 1118 | ic_servaddr = b->server_ip; |
1119 | ic_addrservaddr = b->iph.saddr; | ||
1116 | if (ic_gateway == NONE && b->relay_ip) | 1120 | if (ic_gateway == NONE && b->relay_ip) |
1117 | ic_gateway = b->relay_ip; | 1121 | ic_gateway = b->relay_ip; |
1118 | if (ic_nameservers[0] == NONE) | 1122 | if (ic_nameservers[0] == NONE) |
@@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void) | |||
1268 | printk("IP-Config: Got %s answer from %pI4, ", | 1272 | printk("IP-Config: Got %s answer from %pI4, ", |
1269 | ((ic_got_reply & IC_RARP) ? "RARP" | 1273 | ((ic_got_reply & IC_RARP) ? "RARP" |
1270 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), | 1274 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), |
1271 | &ic_servaddr); | 1275 | &ic_addrservaddr); |
1272 | pr_cont("my address is %pI4\n", &ic_myaddr); | 1276 | pr_cont("my address is %pI4\n", &ic_myaddr); |
1273 | 1277 | ||
1274 | return 0; | 1278 | return 0; |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 51f13f8ec724..04b18c1ac345 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
@@ -81,6 +81,7 @@ static void send_reset(struct sk_buff *oldskb, int hook) | |||
81 | niph->saddr = oiph->daddr; | 81 | niph->saddr = oiph->daddr; |
82 | niph->daddr = oiph->saddr; | 82 | niph->daddr = oiph->saddr; |
83 | 83 | ||
84 | skb_reset_transport_header(nskb); | ||
84 | tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); | 85 | tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); |
85 | memset(tcph, 0, sizeof(*tcph)); | 86 | memset(tcph, 0, sizeof(*tcph)); |
86 | tcph->source = oth->dest; | 87 | tcph->source = oth->dest; |
diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c index da2c8a368f68..eeaff7e4acb5 100644 --- a/net/ipv4/netfilter/iptable_nat.c +++ b/net/ipv4/netfilter/iptable_nat.c | |||
@@ -124,23 +124,28 @@ nf_nat_ipv4_fn(unsigned int hooknum, | |||
124 | ret = nf_nat_rule_find(skb, hooknum, in, out, ct); | 124 | ret = nf_nat_rule_find(skb, hooknum, in, out, ct); |
125 | if (ret != NF_ACCEPT) | 125 | if (ret != NF_ACCEPT) |
126 | return ret; | 126 | return ret; |
127 | } else | 127 | } else { |
128 | pr_debug("Already setup manip %s for ct %p\n", | 128 | pr_debug("Already setup manip %s for ct %p\n", |
129 | maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST", | 129 | maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST", |
130 | ct); | 130 | ct); |
131 | if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) | ||
132 | goto oif_changed; | ||
133 | } | ||
131 | break; | 134 | break; |
132 | 135 | ||
133 | default: | 136 | default: |
134 | /* ESTABLISHED */ | 137 | /* ESTABLISHED */ |
135 | NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED || | 138 | NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED || |
136 | ctinfo == IP_CT_ESTABLISHED_REPLY); | 139 | ctinfo == IP_CT_ESTABLISHED_REPLY); |
137 | if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) { | 140 | if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) |
138 | nf_ct_kill_acct(ct, ctinfo, skb); | 141 | goto oif_changed; |
139 | return NF_DROP; | ||
140 | } | ||
141 | } | 142 | } |
142 | 143 | ||
143 | return nf_nat_packet(ct, ctinfo, hooknum, skb); | 144 | return nf_nat_packet(ct, ctinfo, hooknum, skb); |
145 | |||
146 | oif_changed: | ||
147 | nf_ct_kill_acct(ct, ctinfo, skb); | ||
148 | return NF_DROP; | ||
144 | } | 149 | } |
145 | 150 | ||
146 | static unsigned int | 151 | static unsigned int |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1ca253635f7a..2aa69c8ae60c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1428,12 +1428,12 @@ static void tcp_service_net_dma(struct sock *sk, bool wait) | |||
1428 | } | 1428 | } |
1429 | #endif | 1429 | #endif |
1430 | 1430 | ||
1431 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | 1431 | static struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) |
1432 | { | 1432 | { |
1433 | struct sk_buff *skb; | 1433 | struct sk_buff *skb; |
1434 | u32 offset; | 1434 | u32 offset; |
1435 | 1435 | ||
1436 | skb_queue_walk(&sk->sk_receive_queue, skb) { | 1436 | while ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) { |
1437 | offset = seq - TCP_SKB_CB(skb)->seq; | 1437 | offset = seq - TCP_SKB_CB(skb)->seq; |
1438 | if (tcp_hdr(skb)->syn) | 1438 | if (tcp_hdr(skb)->syn) |
1439 | offset--; | 1439 | offset--; |
@@ -1441,6 +1441,11 @@ static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | |||
1441 | *off = offset; | 1441 | *off = offset; |
1442 | return skb; | 1442 | return skb; |
1443 | } | 1443 | } |
1444 | /* This looks weird, but this can happen if TCP collapsing | ||
1445 | * splitted a fat GRO packet, while we released socket lock | ||
1446 | * in skb_splice_bits() | ||
1447 | */ | ||
1448 | sk_eat_skb(sk, skb, false); | ||
1444 | } | 1449 | } |
1445 | return NULL; | 1450 | return NULL; |
1446 | } | 1451 | } |
@@ -1482,7 +1487,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1482 | break; | 1487 | break; |
1483 | } | 1488 | } |
1484 | used = recv_actor(desc, skb, offset, len); | 1489 | used = recv_actor(desc, skb, offset, len); |
1485 | if (used < 0) { | 1490 | if (used <= 0) { |
1486 | if (!copied) | 1491 | if (!copied) |
1487 | copied = used; | 1492 | copied = used; |
1488 | break; | 1493 | break; |
@@ -1520,8 +1525,10 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1520 | tcp_rcv_space_adjust(sk); | 1525 | tcp_rcv_space_adjust(sk); |
1521 | 1526 | ||
1522 | /* Clean up data we have read: This will do ACK frames. */ | 1527 | /* Clean up data we have read: This will do ACK frames. */ |
1523 | if (copied > 0) | 1528 | if (copied > 0) { |
1529 | tcp_recv_skb(sk, seq, &offset); | ||
1524 | tcp_cleanup_rbuf(sk, copied); | 1530 | tcp_cleanup_rbuf(sk, copied); |
1531 | } | ||
1525 | return copied; | 1532 | return copied; |
1526 | } | 1533 | } |
1527 | EXPORT_SYMBOL(tcp_read_sock); | 1534 | EXPORT_SYMBOL(tcp_read_sock); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 38e11841be09..0905997e5873 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5541,7 +5541,7 @@ slow_path: | |||
5541 | if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) | 5541 | if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) |
5542 | goto csum_error; | 5542 | goto csum_error; |
5543 | 5543 | ||
5544 | if (!th->ack) | 5544 | if (!th->ack && !th->rst) |
5545 | goto discard; | 5545 | goto discard; |
5546 | 5546 | ||
5547 | /* | 5547 | /* |
@@ -5986,7 +5986,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
5986 | goto discard; | 5986 | goto discard; |
5987 | } | 5987 | } |
5988 | 5988 | ||
5989 | if (!th->ack) | 5989 | if (!th->ack && !th->rst) |
5990 | goto discard; | 5990 | goto discard; |
5991 | 5991 | ||
5992 | if (!tcp_validate_incoming(sk, skb, th, 0)) | 5992 | if (!tcp_validate_incoming(sk, skb, th, 0)) |