summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Smith <msmith@cbnco.com>2011-04-07 04:51:51 +0000
committerDavid S. Miller <davem@davemloft.net>2011-04-10 18:50:59 -0700
commit990078afbf90e0175e71da2df04595b99153514c (patch)
treeff61e3ab53f46ceca2ef280788982883b50cc669 /include
parent5c04c819a20af40adb7d282199f4e34e14fa05c5 (diff)
Disable rp_filter for IPsec packets
The reverse path filter interferes with IPsec subnet-to-subnet tunnels, especially when the link to the IPsec peer is on an interface other than the one hosting the default route. With dynamic routing, where the peer might be reachable through eth0 today and eth1 tomorrow, it's difficult to keep rp_filter enabled unless fake routes to the remote subnets are configured on the interface currently used to reach the peer. IPsec provides a much stronger anti-spoofing policy than rp_filter, so this patch disables the rp_filter for packets with a security path. Signed-off-by: Michael Smith <msmith@cbnco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6ae4bc5ce8a7..65ea31348631 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -957,6 +957,15 @@ struct sec_path {
struct xfrm_state *xvec[XFRM_MAX_DEPTH];
};
+static inline int secpath_exists(struct sk_buff *skb)
+{
+#ifdef CONFIG_XFRM
+ return skb->sp != NULL;
+#else
+ return 0;
+#endif
+}
+
static inline struct sec_path *
secpath_get(struct sec_path *sp)
{