summaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2018-02-24 11:18:51 -0500
committerPaul Moore <paul@paul-moore.com>2018-02-26 17:43:54 -0500
commitb7e10c25b839c0c7579b2b402afc9883c107e09f (patch)
treeff919f7f54cb047461fcb747649f77c8e1de539e /include/net/sctp
parent72e89f50084c6dbc58a00aeedf92c450dc1a8b1c (diff)
sctp: Add ip option support
Add ip option support to allow LSM security modules to utilise CIPSO/IPv4 and CALIPSO/IPv6 services. Signed-off-by: Richard Haines <richard_c_haines@btinternet.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/structs.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index f7ae6b0a21d0..25c5c8768818 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -441,9 +441,11 @@ static inline int sctp_list_single_entry(struct list_head *head)
441static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) 441static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
442{ 442{
443 struct sctp_sock *sp = sctp_sk(asoc->base.sk); 443 struct sctp_sock *sp = sctp_sk(asoc->base.sk);
444 struct sctp_af *af = sp->pf->af;
444 int frag = pmtu; 445 int frag = pmtu;
445 446
446 frag -= sp->pf->af->net_header_len; 447 frag -= af->ip_options_len(asoc->base.sk);
448 frag -= af->net_header_len;
447 frag -= sizeof(struct sctphdr) + sctp_datachk_len(&asoc->stream); 449 frag -= sizeof(struct sctphdr) + sctp_datachk_len(&asoc->stream);
448 450
449 if (asoc->user_frag) 451 if (asoc->user_frag)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 03e92dda1813..ead5fcedc283 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -491,6 +491,7 @@ struct sctp_af {
491 void (*ecn_capable)(struct sock *sk); 491 void (*ecn_capable)(struct sock *sk);
492 __u16 net_header_len; 492 __u16 net_header_len;
493 int sockaddr_len; 493 int sockaddr_len;
494 int (*ip_options_len)(struct sock *sk);
494 sa_family_t sa_family; 495 sa_family_t sa_family;
495 struct list_head list; 496 struct list_head list;
496}; 497};
@@ -515,6 +516,7 @@ struct sctp_pf {
515 int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr); 516 int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr);
516 void (*to_sk_saddr)(union sctp_addr *, struct sock *sk); 517 void (*to_sk_saddr)(union sctp_addr *, struct sock *sk);
517 void (*to_sk_daddr)(union sctp_addr *, struct sock *sk); 518 void (*to_sk_daddr)(union sctp_addr *, struct sock *sk);
519 void (*copy_ip_options)(struct sock *sk, struct sock *newsk);
518 struct sctp_af *af; 520 struct sctp_af *af;
519}; 521};
520 522