aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2012-05-04 05:24:54 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-10 00:33:03 +0900
commit337c934a55a7956bcd349b6f56c6add58d2550f3 (patch)
treeee3ed2f6e1bcf5af28310eb3e4b14fd2a43794a7 /include/net
parent83bba7979059b83df4edc16f747784c6990fc3bb (diff)
downloadkernel_samsung_smdk4412-337c934a55a7956bcd349b6f56c6add58d2550f3.zip
kernel_samsung_smdk4412-337c934a55a7956bcd349b6f56c6add58d2550f3.tar.gz
kernel_samsung_smdk4412-337c934a55a7956bcd349b6f56c6add58d2550f3.tar.bz2
sctp: check cached dst before using it
[ Upstream commit e0268868ba064980488fc8c194db3d8e9fb2959c ] dst_check() will take care of SA (and obsolete field), hence IPsec rekeying scenario is taken into account. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vlad Yaseivch <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sctp/sctp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index b2c2366..f686066 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -700,4 +700,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
}
+/* The cookie is always 0 since this is how it's used in the
+ * pmtu code.
+ */
+static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
+{
+ if (t->dst && !dst_check(t->dst, 0)) {
+ dst_release(t->dst);
+ t->dst = NULL;
+ }
+
+ return t->dst;
+}
+
#endif /* __net_sctp_h__ */