- xt_psd: avoid crash due to curr->next corruption
Changes:
- xt_psd: reject invalid match options
+Enhancements:
+- Support for Linux 3.5
v1.42 (2012-04-05)
#include <linux/version.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter/x_tables.h>
+#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter_arp.h>
#include <net/ip.h>
#include <net/route.h>
}
EXPORT_SYMBOL_GPL(HX_memmem);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+int xtnu_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
+ int target, unsigned short *fragoff, int *fragflg)
+{
+ return ipv6_find_hdr(skb, offset, target, fragoff);
+}
+#endif
+
MODULE_LICENSE("GPL");
# define NIPQUAD_FMT "%u.%u.%u.%u"
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+# define ipv6_find_hdr xtnu_ipv6_find_hdr
+#endif
+
#define ip_route_me_harder xtnu_ip_route_me_harder
#define skb_make_writable xtnu_skb_make_writable
#define xt_target xtnu_target
extern void xtnu_proto_csum_replace4(__u16 __bitwise *, struct sk_buff *,
__be32, __be32, bool);
extern int xtnu_skb_linearize(struct sk_buff *);
+extern int xtnu_ipv6_find_hdr(const struct sk_buff *, unsigned int *,
+ int, unsigned short *, int *);
extern void *HX_memmem(const void *, size_t, const void *, size_t);
*l4proto = NEXTHDR_MAX;
for (i = 0; i < ARRAY_SIZE(types); ++i) {
- err = ipv6_find_hdr(*pskb, l4offset, types[i], NULL);
+ err = ipv6_find_hdr(*pskb, l4offset, types[i], NULL, NULL);
if (err >= 0) {
*l4proto = types[i];
break;
return NF_DROP;
iph = ipv6_hdr(skb);
- if ((ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off) < 0 &&
- ipv6_find_hdr(skb, &th_off, IPPROTO_UDPLITE, &frag_off) < 0) ||
+ /* Should probably be using %IP6T_FH_F_AUTH */
+ if ((ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off, NULL) < 0 &&
+ ipv6_find_hdr(skb, &th_off, IPPROTO_UDPLITE, &frag_off, NULL) < 0) ||
frag_off > 0)
return NF_DROP;
int err;
for (i = 0; i < ARRAY_SIZE(types); ++i) {
- err = ipv6_find_hdr(skb, offset, types[i], NULL);
+ err = ipv6_find_hdr(skb, offset, types[i], NULL, NULL);
if (err >= 0)
return types[i];
if (err != -ENOENT) {