diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-05-04 01:24:54 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-07-03 11:29:03 -0400 |
commit | 1d13c93c36fceeefcfa72da4afa294aeaeffc948 (patch) | |
tree | 9420519a1af3bb340cb3b04d504d037e7031de3c /include/net | |
parent | b88e03548cfb25586337284c0087b305c563979c (diff) |
sctp: check cached dst before using it
BugLink: http://bugs.launchpad.net/bugs/1013748
[ 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>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sctp/sctp.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index b2c2366676a..f686066087d 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) | |||
700 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); | 700 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); |
701 | } | 701 | } |
702 | 702 | ||
703 | /* The cookie is always 0 since this is how it's used in the | ||
704 | * pmtu code. | ||
705 | */ | ||
706 | static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) | ||
707 | { | ||
708 | if (t->dst && !dst_check(t->dst, 0)) { | ||
709 | dst_release(t->dst); | ||
710 | t->dst = NULL; | ||
711 | } | ||
712 | |||
713 | return t->dst; | ||
714 | } | ||
715 | |||
703 | #endif /* __net_sctp_h__ */ | 716 | #endif /* __net_sctp_h__ */ |