diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-05-04 01:24:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:15:47 -0400 |
commit | e0268868ba064980488fc8c194db3d8e9fb2959c (patch) | |
tree | 7b8bfb4cceb0a5d184a2fe651aab5aec59a216d3 /include/net | |
parent | c57b54684060c8aced64a5b78ff69ff289af97b9 (diff) |
sctp: check cached dst before using it
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>
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 6ee44b24864a..a2ef81466b00 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -704,4 +704,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr) | |||
704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); | 704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); |
705 | } | 705 | } |
706 | 706 | ||
707 | /* The cookie is always 0 since this is how it's used in the | ||
708 | * pmtu code. | ||
709 | */ | ||
710 | static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) | ||
711 | { | ||
712 | if (t->dst && !dst_check(t->dst, 0)) { | ||
713 | dst_release(t->dst); | ||
714 | t->dst = NULL; | ||
715 | } | ||
716 | |||
717 | return t->dst; | ||
718 | } | ||
719 | |||
707 | #endif /* __net_sctp_h__ */ | 720 | #endif /* __net_sctp_h__ */ |