summaryrefslogtreecommitdiffstats
path: root/kernel/net/netfilter/ipset/ip_set_getport.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-18 17:24:50 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-18 17:24:50 +0100
commitf284b0d07b5d99e745312cbcc0fd95a6a4a7f5b4 (patch)
tree8dc08a86b3c9cc78456aaff8995db2f6f4fca9c6 /kernel/net/netfilter/ipset/ip_set_getport.c
parent6b88433a9334f3f0fc44ee52867326ce20c4af15 (diff)
SCTP, UDPLITE support added
SCTP and UDPLITE port support added to the hash:*port* types.
Diffstat (limited to 'kernel/net/netfilter/ipset/ip_set_getport.c')
-rw-r--r--kernel/net/netfilter/ipset/ip_set_getport.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_getport.c b/kernel/net/netfilter/ipset/ip_set_getport.c
index 8d52272..757143b 100644
--- a/kernel/net/netfilter/ipset/ip_set_getport.c
+++ b/kernel/net/netfilter/ipset/ip_set_getport.c
@@ -11,6 +11,7 @@
#include <linux/skbuff.h>
#include <linux/icmp.h>
#include <linux/icmpv6.h>
+#include <linux/sctp.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <net/ip.h>
#include <net/ipv6.h>
@@ -35,7 +36,20 @@ get_port(const struct sk_buff *skb, int protocol, unsigned int protooff,
*port = src ? th->source : th->dest;
break;
}
- case IPPROTO_UDP: {
+ case IPPROTO_SCTP: {
+ sctp_sctphdr_t _sh;
+ const sctp_sctphdr_t *sh;
+
+ sh = skb_header_pointer(skb, protooff, sizeof(_sh), &_sh);
+ if (sh == NULL)
+ /* No choice either */
+ return false;
+
+ *port = src ? sh->source : sh->dest;
+ break;
+ }
+ case IPPROTO_UDP:
+ case IPPROTO_UDPLITE: {
struct udphdr _udph;
const struct udphdr *uh;