aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_fw2.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2006-11-13 19:07:32 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2006-11-13 19:07:32 +0000
commit89e7e7e32a411e6c03414a6d11d71b431d17b2be (patch)
tree75d32bbb97ef8c9f05ab44370b32029350c9d4a8 /sys/netinet/ip_fw2.c
parentfb1856eabd2df39ea1cfd0253fd733f547f14435 (diff)
downloadsrc-89e7e7e32a411e6c03414a6d11d71b431d17b2be.tar.gz
src-89e7e7e32a411e6c03414a6d11d71b431d17b2be.zip
Add SCTP as a known upper layer protocol over v6.
We are not yet aware of the protocol internals but this way SCTP traffic over v6 will not be discarded. Reported by: Peter Lei via rrs Tested by: Peter Lei <peterlei cisco.com>
Notes
Notes: svn path=/head/; revision=164258
Diffstat (limited to 'sys/netinet/ip_fw2.c')
-rw-r--r--sys/netinet/ip_fw2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index a475ee2b76f6..a435d037389d 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -82,6 +82,7 @@
#include <netinet/tcpip.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <netinet/sctp.h>
#include <netgraph/ng_ipfw.h>
@@ -311,6 +312,7 @@ static int fw_deny_unknown_exthdrs = 1;
*/
#define L3HDR(T, ip) ((T *)((u_int32_t *)(ip) + (ip)->ip_hl))
#define TCP(p) ((struct tcphdr *)(p))
+#define SCTP(p) ((struct sctphdr *)(p))
#define UDP(p) ((struct udphdr *)(p))
#define ICMP(p) ((struct icmphdr *)(p))
#define ICMP6(p) ((struct icmp6_hdr *)(p))
@@ -2222,6 +2224,12 @@ do { \
args->f_id.flags = TCP(ulp)->th_flags;
break;
+ case IPPROTO_SCTP:
+ PULLUP_TO(hlen, ulp, struct sctphdr);
+ src_port = SCTP(ulp)->src_port;
+ dst_port = SCTP(ulp)->dest_port;
+ break;
+
case IPPROTO_UDP:
PULLUP_TO(hlen, ulp, struct udphdr);
dst_port = UDP(ulp)->uh_dport;