diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-10-25 18:54:46 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-10-25 18:54:46 -0700 |
commit | fee9dee730a40f671c1972a324ed54f0d68523e1 (patch) | |
tree | 4a688264696a3cfdf7312e92b52ac4794197a7a5 /include/net/inet_sock.h | |
parent | 41fb285430e9cb57da624d838afef7b2fc67e276 (diff) | |
download | op-kernel-dev-fee9dee730a40f671c1972a324ed54f0d68523e1.zip op-kernel-dev-fee9dee730a40f671c1972a324ed54f0d68523e1.tar.gz |
[UDP]: Make use of inet_iif() when doing socket lookups.
UDP currently uses skb->dev->ifindex which may provide the wrong
information when the socket bound to a specific interface.
This patch makes inet_iif() accessible to UDP and makes UDP use it.
The scenario we are trying to fix is when a client is running on
the same system and the server and both client and server bind to
a non-loopback device.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r-- | include/net/inet_sock.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 62daf21..70013c5 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -24,6 +24,7 @@ #include <net/flow.h> #include <net/sock.h> #include <net/request_sock.h> +#include <net/route.h> /** struct ip_options - IP Options * @@ -190,4 +191,10 @@ static inline int inet_sk_ehashfn(const struct sock *sk) return inet_ehashfn(laddr, lport, faddr, fport); } + +static inline int inet_iif(const struct sk_buff *skb) +{ + return ((struct rtable *)skb->dst)->rt_iif; +} + #endif /* _INET_SOCK_H */ |