<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/ipv4, branch v2.6.37</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ipv4/route.c: respect prefsrc for local routes</title>
<updated>2011-01-04T19:35:12+00:00</updated>
<author>
<name>Joel Sing</name>
<email>jsing@google.com</email>
</author>
<published>2011-01-03T20:24:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9fc3bbb4a752f108cf096d96640f3b548bbbce6c'/>
<id>9fc3bbb4a752f108cf096d96640f3b548bbbce6c</id>
<content type='text'>
The preferred source address is currently ignored for local routes,
which results in all local connections having a src address that is the
same as the local dst address. Fix this by respecting the preferred source
address when it is provided for local routes.

This bug can be demonstrated as follows:

 # ifconfig dummy0 192.168.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 192.168.0.1
 # ip route change table local local 192.168.0.1 dev dummy0 \
     proto kernel scope host src 127.0.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 127.0.0.1

We now establish a local connection and verify the source IP
address selection:

 # nc -l 192.168.0.1 3128 &amp;
 # nc 192.168.0.1 3128 &amp;
 # netstat -ant | grep 192.168.0.1:3128.*EST
 tcp        0      0 192.168.0.1:3128        192.168.0.1:33228 ESTABLISHED
 tcp        0      0 192.168.0.1:33228       192.168.0.1:3128  ESTABLISHED

Signed-off-by: Joel Sing &lt;jsing@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The preferred source address is currently ignored for local routes,
which results in all local connections having a src address that is the
same as the local dst address. Fix this by respecting the preferred source
address when it is provided for local routes.

This bug can be demonstrated as follows:

 # ifconfig dummy0 192.168.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 192.168.0.1
 # ip route change table local local 192.168.0.1 dev dummy0 \
     proto kernel scope host src 127.0.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 127.0.0.1

We now establish a local connection and verify the source IP
address selection:

 # nc -l 192.168.0.1 3128 &amp;
 # nc 192.168.0.1 3128 &amp;
 # netstat -ant | grep 192.168.0.1:3128.*EST
 tcp        0      0 192.168.0.1:3128        192.168.0.1:33228 ESTABLISHED
 tcp        0      0 192.168.0.1:33228       192.168.0.1:3128  ESTABLISHED

Signed-off-by: Joel Sing &lt;jsing@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: dont create routes on down devices</title>
<updated>2010-12-26T04:05:31+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-12-22T04:39:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fc75fc8339e7727167443469027540b283daac71'/>
<id>fc75fc8339e7727167443469027540b283daac71</id>
<content type='text'>
In ip_route_output_slow(), instead of allowing a route to be created on
a not UPed device, report -ENETUNREACH immediately.

# ip tunnel add mode ipip remote 10.16.0.164 local
10.16.0.72 dev eth0
# (Note : tunl1 is down)
# ping -I tunl1 10.1.2.3
PING 10.1.2.3 (10.1.2.3) from 192.168.18.5 tunl1: 56(84) bytes of data.
(nothing)
# ./a.out tunl1
# ip tunnel del tunl1
Message from syslogd@shelby at Dec 22 10:12:08 ...
  kernel: unregister_netdevice: waiting for tunl1 to become free.
Usage count = 3

After patch:
# ping -I tunl1 10.1.2.3
connect: Network is unreachable

Reported-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Reviewed-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In ip_route_output_slow(), instead of allowing a route to be created on
a not UPed device, report -ENETUNREACH immediately.

# ip tunnel add mode ipip remote 10.16.0.164 local
10.16.0.72 dev eth0
# (Note : tunl1 is down)
# ping -I tunl1 10.1.2.3
PING 10.1.2.3 (10.1.2.3) from 192.168.18.5 tunl1: 56(84) bytes of data.
(nothing)
# ./a.out tunl1
# ip tunnel del tunl1
Message from syslogd@shelby at Dec 22 10:12:08 ...
  kernel: unregister_netdevice: waiting for tunl1 to become free.
Usage count = 3

After patch:
# ping -I tunl1 10.1.2.3
connect: Network is unreachable

Reported-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Reviewed-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ipv4: Allow configuring subnets as local addresses"</title>
<updated>2010-12-23T20:03:57+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2010-12-23T20:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e058464990c2ef1f3ecd6b83a154913c3c06f02a'/>
<id>e058464990c2ef1f3ecd6b83a154913c3c06f02a</id>
<content type='text'>
This reverts commit 4465b469008bc03b98a1b8df4e9ae501b6c69d4b.

Conflicts:

	net/ipv4/fib_frontend.c

As reported by Ben Greear, this causes regressions:

&gt; Change 4465b469008bc03b98a1b8df4e9ae501b6c69d4b caused rules
&gt; to stop matching the input device properly because the
&gt; FLOWI_FLAG_MATCH_ANY_IIF is always defined in ip_dev_find().
&gt;
&gt; This breaks rules such as:
&gt;
&gt; ip rule add pref 512 lookup local
&gt; ip rule del pref 0 lookup local
&gt; ip link set eth2 up
&gt; ip -4 addr add 172.16.0.102/24 broadcast 172.16.0.255 dev eth2
&gt; ip rule add to 172.16.0.102 iif eth2 lookup local pref 10
&gt; ip rule add iif eth2 lookup 10001 pref 20
&gt; ip route add 172.16.0.0/24 dev eth2 table 10001
&gt; ip route add unreachable 0/0 table 10001
&gt;
&gt; If you had a second interface 'eth0' that was on a different
&gt; subnet, pinging a system on that interface would fail:
&gt;
&gt;   [root@ct503-60 ~]# ping 192.168.100.1
&gt;   connect: Invalid argument

Reported-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 4465b469008bc03b98a1b8df4e9ae501b6c69d4b.

Conflicts:

	net/ipv4/fib_frontend.c

As reported by Ben Greear, this causes regressions:

&gt; Change 4465b469008bc03b98a1b8df4e9ae501b6c69d4b caused rules
&gt; to stop matching the input device properly because the
&gt; FLOWI_FLAG_MATCH_ANY_IIF is always defined in ip_dev_find().
&gt;
&gt; This breaks rules such as:
&gt;
&gt; ip rule add pref 512 lookup local
&gt; ip rule del pref 0 lookup local
&gt; ip link set eth2 up
&gt; ip -4 addr add 172.16.0.102/24 broadcast 172.16.0.255 dev eth2
&gt; ip rule add to 172.16.0.102 iif eth2 lookup local pref 10
&gt; ip rule add iif eth2 lookup 10001 pref 20
&gt; ip route add 172.16.0.0/24 dev eth2 table 10001
&gt; ip route add unreachable 0/0 table 10001
&gt;
&gt; If you had a second interface 'eth0' that was on a different
&gt; subnet, pinging a system on that interface would fail:
&gt;
&gt;   [root@ct503-60 ~]# ping 192.168.100.1
&gt;   connect: Invalid argument

Reported-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: fix listening_get_next()</title>
<updated>2010-12-23T17:32:46+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-12-23T17:32:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1bde5ac49398a064c753bb490535cfad89e99a5f'/>
<id>1bde5ac49398a064c753bb490535cfad89e99a5f</id>
<content type='text'>
Alexey Vlasov found /proc/net/tcp could sometime loop and display
millions of sockets in LISTEN state.

In 2.6.29, when we converted TCP hash tables to RCU, we left two
sk_next() calls in listening_get_next().

We must instead use sk_nulls_next() to properly detect an end of chain.

Reported-by: Alexey Vlasov &lt;renton@renton.name&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alexey Vlasov found /proc/net/tcp could sometime loop and display
millions of sockets in LISTEN state.

In 2.6.29, when we converted TCP hash tables to RCU, we left two
sk_next() calls in listening_get_next().

We must instead use sk_nulls_next() to properly detect an end of chain.

Reported-by: Alexey Vlasov &lt;renton@renton.name&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: fix nulls list corruptions in sk_prot_alloc</title>
<updated>2010-12-16T22:26:56+00:00</updated>
<author>
<name>Octavian Purdila</name>
<email>opurdila@ixiacom.com</email>
</author>
<published>2010-12-16T22:26:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fcbdf09d9652c8919dcf47072e3ae7dcb4eb98ac'/>
<id>fcbdf09d9652c8919dcf47072e3ae7dcb4eb98ac</id>
<content type='text'>
Special care is taken inside sk_port_alloc to avoid overwriting
skc_node/skc_nulls_node. We should also avoid overwriting
skc_bind_node/skc_portaddr_node.

The patch fixes the following crash:

 BUG: unable to handle kernel paging request at fffffffffffffff0
 IP: [&lt;ffffffff812ec6dd&gt;] udp4_lib_lookup2+0xad/0x370
 [&lt;ffffffff812ecc22&gt;] __udp4_lib_lookup+0x282/0x360
 [&lt;ffffffff812ed63e&gt;] __udp4_lib_rcv+0x31e/0x700
 [&lt;ffffffff812bba45&gt;] ? ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ? ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812eda35&gt;] udp_rcv+0x15/0x20
 [&lt;ffffffff812bba45&gt;] ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812bb2cd&gt;] ip_rcv_finish+0x32d/0x6f0
 [&lt;ffffffff8128c14c&gt;] ? netif_receive_skb+0x99c/0x11c0
 [&lt;ffffffff812bb94b&gt;] ip_rcv+0x2bb/0x350
 [&lt;ffffffff8128c14c&gt;] netif_receive_skb+0x99c/0x11c0

Signed-off-by: Leonard Crestez &lt;lcrestez@ixiacom.com&gt;
Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Special care is taken inside sk_port_alloc to avoid overwriting
skc_node/skc_nulls_node. We should also avoid overwriting
skc_bind_node/skc_portaddr_node.

The patch fixes the following crash:

 BUG: unable to handle kernel paging request at fffffffffffffff0
 IP: [&lt;ffffffff812ec6dd&gt;] udp4_lib_lookup2+0xad/0x370
 [&lt;ffffffff812ecc22&gt;] __udp4_lib_lookup+0x282/0x360
 [&lt;ffffffff812ed63e&gt;] __udp4_lib_rcv+0x31e/0x700
 [&lt;ffffffff812bba45&gt;] ? ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ? ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812eda35&gt;] udp_rcv+0x15/0x20
 [&lt;ffffffff812bba45&gt;] ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812bb2cd&gt;] ip_rcv_finish+0x32d/0x6f0
 [&lt;ffffffff8128c14c&gt;] ? netif_receive_skb+0x99c/0x11c0
 [&lt;ffffffff812bb94b&gt;] ip_rcv+0x2bb/0x350
 [&lt;ffffffff8128c14c&gt;] netif_receive_skb+0x99c/0x11c0

Signed-off-by: Leonard Crestez &lt;lcrestez@ixiacom.com&gt;
Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: protect sysctl_tcp_cookie_size reads</title>
<updated>2010-12-08T20:34:09+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-12-07T12:20:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f19872575ff7819a3723154657a497d9bca66b33'/>
<id>f19872575ff7819a3723154657a497d9bca66b33</id>
<content type='text'>
Make sure sysctl_tcp_cookie_size is read once in
tcp_cookie_size_check(), or we might return an illegal value to caller
if sysctl_tcp_cookie_size is changed by another cpu.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Cc: William Allen Simpson &lt;william.allen.simpson@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure sysctl_tcp_cookie_size is read once in
tcp_cookie_size_check(), or we might return an illegal value to caller
if sysctl_tcp_cookie_size is changed by another cpu.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Cc: William Allen Simpson &lt;william.allen.simpson@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: avoid a possible divide by zero</title>
<updated>2010-12-08T20:34:08+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-12-07T12:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ad9f4f50fe9288bbe65b7dfd76d8820afac6a24c'/>
<id>ad9f4f50fe9288bbe65b7dfd76d8820afac6a24c</id>
<content type='text'>
sysctl_tcp_tso_win_divisor might be set to zero while one cpu runs in
tcp_tso_should_defer(). Make sure we dont allow a divide by zero by
reading sysctl_tcp_tso_win_divisor exactly once.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sysctl_tcp_tso_win_divisor might be set to zero while one cpu runs in
tcp_tso_should_defer(). Make sure we dont allow a divide by zero by
reading sysctl_tcp_tso_win_divisor exactly once.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: Replace time wait bucket msg by counter</title>
<updated>2010-12-08T20:16:33+00:00</updated>
<author>
<name>Tom Herbert</name>
<email>therbert@google.com</email>
</author>
<published>2010-12-08T20:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=67631510a318d5a930055fe927607f483716e100'/>
<id>67631510a318d5a930055fe927607f483716e100</id>
<content type='text'>
Rather than printing the message to the log, use a mib counter to keep
track of the count of occurences of time wait bucket overflow.  Reduces
spam in logs.

Signed-off-by: Tom Herbert &lt;therbert@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than printing the message to the log, use a mib counter to keep
track of the count of occurences of time wait bucket overflow.  Reduces
spam in logs.

Signed-off-by: Tom Herbert &lt;therbert@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: Bug fix in initialization of receive window.</title>
<updated>2010-12-08T17:38:37+00:00</updated>
<author>
<name>Nandita Dukkipati</name>
<email>nanditad@google.com</email>
</author>
<published>2010-12-03T13:33:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b1afde60f2b9ee8444fba4e012dc99a3b28d224d'/>
<id>b1afde60f2b9ee8444fba4e012dc99a3b28d224d</id>
<content type='text'>
The bug has to do with boundary checks on the initial receive window.
If the initial receive window falls between init_cwnd and the
receive window specified by the user, the initial window is incorrectly
brought down to init_cwnd. The correct behavior is to allow it to
remain unchanged.

Signed-off-by: Nandita Dukkipati &lt;nanditad@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The bug has to do with boundary checks on the initial receive window.
If the initial receive window falls between init_cwnd and the
receive window specified by the user, the initial window is incorrectly
brought down to init_cwnd. The correct behavior is to allow it to
remain unchanged.

Signed-off-by: Nandita Dukkipati &lt;nanditad@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>inet: Fix __inet_inherit_port() to correctly increment bsockets and num_owners</title>
<updated>2010-11-29T02:18:44+00:00</updated>
<author>
<name>Nagendra Tomar</name>
<email>tomer_iisc@yahoo.com</email>
</author>
<published>2010-11-26T14:26:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b4ff3c90e6066bacc8a92111752fe9e4f4c45cca'/>
<id>b4ff3c90e6066bacc8a92111752fe9e4f4c45cca</id>
<content type='text'>
inet sockets corresponding to passive connections are added to the bind hash
using ___inet_inherit_port(). These sockets are later removed from the bind
hash using __inet_put_port(). These two functions are not exactly symmetrical.
__inet_put_port() decrements hashinfo-&gt;bsockets and tb-&gt;num_owners, whereas
___inet_inherit_port() does not increment them. This results in both of these
going to -ve values.

This patch fixes this by calling inet_bind_hash() from ___inet_inherit_port(),
which does the right thing.

'bsockets' and 'num_owners' were introduced by commit a9d8f9110d7e953c
(inet: Allowing more than 64k connections and heavily optimize bind(0))

Signed-off-by: Nagendra Singh Tomar &lt;tomer_iisc@yahoo.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
inet sockets corresponding to passive connections are added to the bind hash
using ___inet_inherit_port(). These sockets are later removed from the bind
hash using __inet_put_port(). These two functions are not exactly symmetrical.
__inet_put_port() decrements hashinfo-&gt;bsockets and tb-&gt;num_owners, whereas
___inet_inherit_port() does not increment them. This results in both of these
going to -ve values.

This patch fixes this by calling inet_bind_hash() from ___inet_inherit_port(),
which does the right thing.

'bsockets' and 'num_owners' were introduced by commit a9d8f9110d7e953c
(inet: Allowing more than 64k connections and heavily optimize bind(0))

Signed-off-by: Nagendra Singh Tomar &lt;tomer_iisc@yahoo.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
