aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipset/ip_set_getport.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-04-13 13:51:38 +0200
committerPatrick McHardy <kaber@trash.net>2011-04-13 13:51:38 +0200
commit91eb7c08c6cb3b8eeba1c61f5753c56dcb77f018 (patch)
tree4e3c461633b58a6cea44bb0230ee750e4bd98416 /net/netfilter/ipset/ip_set_getport.c
parentIPVS: combine consecutive #ifdef CONFIG_PROC_FS blocks (diff)
downloadlinux-dev-91eb7c08c6cb3b8eeba1c61f5753c56dcb77f018.tar.xz
linux-dev-91eb7c08c6cb3b8eeba1c61f5753c56dcb77f018.zip
netfilter: ipset: SCTP, UDPLITE support added
SCTP and UDPLITE port support added to the hash:*port* set types. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/ipset/ip_set_getport.c')
-rw-r--r--net/netfilter/ipset/ip_set_getport.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_getport.c b/net/netfilter/ipset/ip_set_getport.c
index 8d5227212686..757143b2240a 100644
--- a/net/netfilter/ipset/ip_set_getport.c
+++ b/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;