#include <netinet/icmp6.h>
#include <arpa/inet.h>
-#ifndef BE_SO_LAME_TO_SUPPRESS_SCTP
-#include <linux/sctp.h>
-#endif
-
#include <linux/if.h>
#include <linux/if_tun.h>
#include <linux/if_ether.h>
/* Global variables */
+/* SCTP structures are far from standardised, so we define our own header */
+struct my_sctphdr {
+ uint16_t source, dest;
+ uint32_t vtag;
+ uint32_t checksum;
+};
+
char *program;
int v4sox = -1;
struct {
struct ip6_hdr v6hdr;
struct icmp6_hdr v6icmphdr;
-#ifndef BE_SO_LAME_TO_SUPPRESS_SCTP
- struct sctphdr v6sctphdr;
-#endif
+ struct my_sctphdr v6sctphdr;
struct tcphdr v6tcphdr ;
struct udphdr v6udphdr ;
} ndata;
uint16_t numpairs = 0;
uint16_t port;
switch (v4v6nexthdr) {
-#ifndef BE_SO_LAME_TO_SUPPRESS_SCTP
case IPPROTO_SCTP:
portpairs = masqportpairs [0]; // 's'
numpairs = num_masqportpairs [0];
- port = ntohs (v4v6srcport);
+ port = ntohs (v4v6sctpsrcport);
break;
-#endif
case IPPROTO_TCP:
portpairs = masqportpairs [1]; // 't'
numpairs = num_masqportpairs [1];