net: ipv6: Fix oif in TCP SYN+ACK route lookup.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 11 Apr 2014 04:19:12 +0000 (13:19 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Apr 2014 20:43:47 +0000 (16:43 -0400)
commit2a4ccde6b82e3deb76c5318ea6750338e5dbe267
treeae44407ca69c25d72641a4ccb9f0e2fd31fd45d0
parent0072e6736483072de47e404781ddb521cf9c1954
net: ipv6: Fix oif in TCP SYN+ACK route lookup.

net-next commit 816db3f, ipv6: tcp_ipv6 policy route issue, had
a boolean logic error that caused incorrect behaviour for TCP
SYN+ACK when oif-based rules are in use. Specifically:

1. If a SYN comes in from a global address, and sk_bound_dev_if
   is not set, the routing lookup has oif set to the interface
   the SYN came in on. Instead, it should have oif unset,
   because for global addresses, the incoming interface doesn't
   necessarily have any bearing on the interface the SYN+ACK is
   sent out on.
2. If a SYN comes in from a link-local address, and
   sk_bound_dev_if is set, the routing lookup has oif set to the
   interface the SYN came in on. Instead, it should have oif set
   to sk_bound_dev_if, because that's what the application
   requested.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/tcp_ipv6.c