summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/inet_sock.h14
-rw-r--r--include/net/netns/ipv4.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 625bdf95d673..012b1f91f3ec 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -28,6 +28,7 @@
28#include <net/request_sock.h> 28#include <net/request_sock.h>
29#include <net/netns/hash.h> 29#include <net/netns/hash.h>
30#include <net/tcp_states.h> 30#include <net/tcp_states.h>
31#include <net/l3mdev.h>
31 32
32/** struct ip_options - IP Options 33/** struct ip_options - IP Options
33 * 34 *
@@ -113,6 +114,19 @@ static inline u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb)
113 return sk->sk_mark; 114 return sk->sk_mark;
114} 115}
115 116
117static inline int inet_request_bound_dev_if(const struct sock *sk,
118 struct sk_buff *skb)
119{
120#ifdef CONFIG_NET_L3_MASTER_DEV
121 struct net *net = sock_net(sk);
122
123 if (!sk->sk_bound_dev_if && net->ipv4.sysctl_tcp_l3mdev_accept)
124 return l3mdev_master_ifindex_by_index(net, skb->skb_iif);
125#endif
126
127 return sk->sk_bound_dev_if;
128}
129
116struct inet_cork { 130struct inet_cork {
117 unsigned int flags; 131 unsigned int flags;
118 __be32 addr; 132 __be32 addr;
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index c68926b4899c..d75be32650ba 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -86,6 +86,9 @@ struct netns_ipv4 {
86 86
87 int sysctl_fwmark_reflect; 87 int sysctl_fwmark_reflect;
88 int sysctl_tcp_fwmark_accept; 88 int sysctl_tcp_fwmark_accept;
89#ifdef CONFIG_NET_L3_MASTER_DEV
90 int sysctl_tcp_l3mdev_accept;
91#endif
89 int sysctl_tcp_mtu_probing; 92 int sysctl_tcp_mtu_probing;
90 int sysctl_tcp_base_mss; 93 int sysctl_tcp_base_mss;
91 int sysctl_tcp_probe_threshold; 94 int sysctl_tcp_probe_threshold;