[v2,1/2] include/lapi: add sctp.h
diff mbox series

Message ID 1521819449-27489-2-git-send-email-alexey.kodanev@oracle.com
State Accepted
Delegated to: Alexey Kodanev
Headers show
Series
  • sctp: add new regression test for CVE-2018-5803
Related show

Commit Message

Alexey Kodanev March 23, 2018, 3:37 p.m. UTC
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
v2: include linux/sctp.h header and check it in the configure

 configure.ac        |    1 +
 include/lapi/sctp.h |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 include/lapi/sctp.h

Comments

Petr Vorel March 26, 2018, 10:55 a.m. UTC | #1
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
> v2: include linux/sctp.h header and check it in the configure

>  configure.ac        |    1 +
>  include/lapi/sctp.h |   29 +++++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+), 0 deletions(-)
>  create mode 100644 include/lapi/sctp.h

> diff --git a/configure.ac b/configure.ac
> index 85426ad..97d643b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -44,6 +44,7 @@ AC_CHECK_HEADERS([ \
>      linux/mempolicy.h \
>      linux/module.h \
>      linux/netlink.h \
> +    linux/sctp.h \
>      mm.h \
>      pthread.h \
>      sys/epoll.h \
> diff --git a/include/lapi/sctp.h b/include/lapi/sctp.h
> new file mode 100644
> index 0000000..69adc7a
> --- /dev/null
> +++ b/include/lapi/sctp.h
> @@ -0,0 +1,29 @@
> +/*
> + * Copyright (c) 2018 Oracle and/or its affiliates.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef LAPI_SCTP_H__
> +#define LAPI_SCTP_H__
> +
> +#ifdef HAVE_LINUX_SCTP_H
> +# include <linux/sctp.h>
> +#endif
> +
> +#ifndef SCTP_SOCKOPT_BINDX_ADD
> +# define SCTP_SOCKOPT_BINDX_ADD	100
> +#endif
> +
> +#endif	/* LAPI_SCTP_H__ */

Acked-by: Petr Vorel <petr.vorel@gmail.com>

BTW SCTP_SOCKOPT_BINDX_ADD is defined in both <linux/sctp.h> and <netinet/sctp.h>, so if we
ever in future want to have some definitions from netinet/sctp.h, I'd be to create special
file include/lapi/netinet_sctp.h (the same like include/lapi/netinet_in.h - taking that
default is for "kernel/").

And we have included netinet/sctp.h in sources (utils/sctp/include/netinet/sctp.h), IMHO
not good idea to have common headers in our sources.


Kind regards,
Petr
Alexey Kodanev March 28, 2018, 2:35 p.m. UTC | #2
On 26.03.2018 13:55, Petr Vorel wrote:
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>> ---
>> v2: include linux/sctp.h header and check it in the configure

Applied the patch-set.

> BTW SCTP_SOCKOPT_BINDX_ADD is defined in both <linux/sctp.h> and <netinet/sctp.h>, so if we
> ever in future want to have some definitions from netinet/sctp.h, I'd be to create special
> file include/lapi/netinet_sctp.h (the same like include/lapi/netinet_in.h - taking that
> default is for "kernel/").
>

I think if we have netinet/sctp.h it should take precedences
over linux/sctp.h. In OL7 it is provided by optional
lksctp-tools-devel package.

Thanks,
Alexey
 
> And we have included netinet/sctp.h in sources (utils/sctp/include/netinet/sctp.h), IMHO
> not good idea to have common headers in our sources.
> 


> 
> Kind regards,
> Petr
>
Petr Vorel March 29, 2018, 6:12 a.m. UTC | #3
Hi Alexey,

> > BTW SCTP_SOCKOPT_BINDX_ADD is defined in both <linux/sctp.h> and <netinet/sctp.h>, so if we
> > ever in future want to have some definitions from netinet/sctp.h, I'd be to create special
> > file include/lapi/netinet_sctp.h (the same like include/lapi/netinet_in.h - taking that
> > default is for "kernel/").


> I think if we have netinet/sctp.h it should take precedences
> over linux/sctp.h. In OL7 it is provided by optional
> lksctp-tools-devel package.
But linux/sctp.h has much more definitions than netinet/sctp.h and we use some kernel
specific definitions (e.g. SOL_UDPLITE is just in linux/sctp.h, SOL_SCTP is in both).

> Thanks,
> Alexey


Kind regards,
Petr

Patch
diff mbox series

diff --git a/configure.ac b/configure.ac
index 85426ad..97d643b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,7 @@  AC_CHECK_HEADERS([ \
     linux/mempolicy.h \
     linux/module.h \
     linux/netlink.h \
+    linux/sctp.h \
     mm.h \
     pthread.h \
     sys/epoll.h \
diff --git a/include/lapi/sctp.h b/include/lapi/sctp.h
new file mode 100644
index 0000000..69adc7a
--- /dev/null
+++ b/include/lapi/sctp.h
@@ -0,0 +1,29 @@ 
+/*
+ * Copyright (c) 2018 Oracle and/or its affiliates.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LAPI_SCTP_H__
+#define LAPI_SCTP_H__
+
+#ifdef HAVE_LINUX_SCTP_H
+# include <linux/sctp.h>
+#endif
+
+#ifndef SCTP_SOCKOPT_BINDX_ADD
+# define SCTP_SOCKOPT_BINDX_ADD	100
+#endif
+
+#endif	/* LAPI_SCTP_H__ */