]> granicus.if.org Git - ipset/commitdiff
Backport patch: sctp: remove the typedef sctp_sctphdr_t
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 11 Sep 2017 19:12:13 +0000 (21:12 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 11 Sep 2017 19:12:13 +0000 (21:12 +0200)
configure.ac
kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
kernel/net/netfilter/ipset/ip_set_getport.c

index 26883d75d3a9f37ab90bbc9dadbe0c3b66eb3456..d88d5b99733fcb3679199a1025b46e5a9ac7f155 100644 (file)
@@ -579,6 +579,16 @@ else
        AC_SUBST(HAVE_PASSING_EXTENDED_ACK_TO_CALLBACKS, undef)
 fi
 
+AC_MSG_CHECKING([kernel source for no typedef sctp_sctphdr_t])
+if test -f $ksourcedir/include/linux/sctp.h && \
+   $GREP -q '^typedef struct sctphdr' $ksourcedir/include/linux/sctp.h; then
+       AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_TYPEDEF_SCTP_SCTPHDR_T, define)
+else
+       AC_MSG_RESULT(no)
+       AC_SUBST(HAVE_TYPEDEF_SCTP_SCTPHDR_T, undef)
+fi
+
 AC_MSG_CHECKING([kernel source for struct net_generic])
 if test -f $ksourcedir/include/net/netns/generic.h && \
    $GREP -q 'struct net_generic' $ksourcedir/include/net/netns/generic.h; then
index 667a6b09f44d436a4575925959ded94bc6090fd3..2630600e3d7a773a7e41c4c9e0a309d7c482e5db 100644 (file)
@@ -42,6 +42,7 @@
 #@HAVE_NETLINK_EXTENDED_ACK@ HAVE_NETLINK_EXTENDED_ACK
 #@HAVE_PASSING_EXTENDED_ACK_TO_PARSERS@ HAVE_PASSING_EXTENDED_ACK_TO_PARSERS
 #@HAVE_PASSING_EXTENDED_ACK_TO_CALLBACKS@ HAVE_PASSING_EXTENDED_ACK_TO_CALLBACKS
+#@HAVE_TYPEDEF_SCTP_SCTPHDR_T@ HAVE_TYPEDEF_SCTP_SCTPHDR_T
 
 #ifdef HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H
 #include <linux/module.h>
index 528e94cf2b26e489debd60e67282311680f5af94..8614bcd0593d030d6a0bfd859d5cc6b3f286f7c2 100644 (file)
@@ -39,8 +39,13 @@ get_port(const struct sk_buff *skb, int protocol, unsigned int protooff,
                break;
        }
        case IPPROTO_SCTP: {
+#ifdef HAVE_TYPEDEF_SCTP_SCTPHDR_T
                sctp_sctphdr_t _sh;
                const sctp_sctphdr_t *sh;
+#else
+               struct sctphdr _sh;
+               const struct sctphdr *sh;
+#endif
 
                sh = skb_header_pointer(skb, protooff, sizeof(_sh), &_sh);
                if (!sh)