]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
extensions: fix ipv6_find_hdr upstream change fallout
authorFlorian Westphal <fw@strlen.de>
Fri, 20 Jul 2012 15:28:38 +0000 (17:28 +0200)
committerJan Engelhardt <jengelh@inai.de>
Sat, 21 Jul 2012 13:42:02 +0000 (15:42 +0200)
Upstream commit v3.5-rc1~109^2~138^2~4 ("netfilter: ip6_tables: add
flags parameter to ipv6_find_hdr()") changed the offset parameter of
ipv6_find_hdr() to be an input-output value. Moreover, if it is
non-zero, it MUST point to a valid IPv6 header embedded in the
packet.

doc/changelog.txt
extensions/xt_RAWNAT.c
extensions/xt_SYSRQ.c
extensions/xt_length2.c

index b4ec4b713d972a8b30c86950869c839f91b98769..14db878c65c06531efe28bb1d3d6a361ad78adaf 100644 (file)
@@ -1,6 +1,8 @@
 
 HEAD
 ====
+Fixes:
+- length2, SYSRQ, RAWNAT: preinitialize values for ipv6_find_hdr
 
 
 v1.45 (2012-07-16)
index a837276fa8f536fab46a1960c7a640123a123f93..c15b5e56adb2a5e937efe290c1423a3e262e3fb0 100644 (file)
@@ -244,7 +244,7 @@ static unsigned int
 rawsnat_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
 {
        const struct xt_rawnat_tginfo *info = par->targinfo;
-       unsigned int l4offset, l4proto;
+       unsigned int l4offset = 0, l4proto;
        struct ipv6hdr *iph;
        struct in6_addr new_addr;
 
@@ -265,7 +265,7 @@ static unsigned int
 rawdnat_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
 {
        const struct xt_rawnat_tginfo *info = par->targinfo;
-       unsigned int l4offset, l4proto;
+       unsigned int l4offset = 0, l4proto;
        struct ipv6hdr *iph;
        struct in6_addr new_addr;
 
index 35502efac3279f088a4a5492badbc6f5fbb92834..9b5931374b48ae0060599747105f2f06ea24fb71 100644 (file)
@@ -240,7 +240,7 @@ sysrq_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
        const struct ipv6hdr *iph;
        const struct udphdr *udph;
        unsigned short frag_off;
-       unsigned int th_off;
+       unsigned int th_off = 0;
        uint16_t len;
 
        if (skb_linearize(skb) < 0)
index 2755e2ff70d48d25e97773b977ca7fdaa979cb6f..726a92e071bf31b22dc371e935d8973fcf9bde38 100644 (file)
@@ -203,7 +203,8 @@ length2_mt6(const struct sk_buff *skb, struct xt_action_param *par)
        const struct xt_length_mtinfo2 *info = par->matchinfo;
        const struct ipv6hdr *iph = ipv6_hdr(skb);
        unsigned int len = 0, l4proto;
-       unsigned int thoff = par->thoff;
+       /* par->thoff would only set if ip6tables -p was used; so just use 0 */
+       unsigned int thoff = 0;
        bool hit = true;
 
        if (info->flags & XT_LENGTH_LAYER3) {