From fee9dee730a40f671c1972a324ed54f0d68523e1 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Thu, 25 Oct 2007 18:54:46 -0700 Subject: [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 Acked-by: David L Stevens Signed-off-by: David S. Miller --- include/net/inet_sock.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/net/inet_sock.h') diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 62daf214931f..70013c5f4e59 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -24,6 +24,7 @@ #include #include #include +#include /** 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 */ -- cgit v1.2.3