kernel: xt_FLOWOFFLOAD: fix use of uninitialized dir variable
The dir variable has been used uninitialized since the port to 5.10, and
somehow this remains undetected by GCC.
Fixes: b10d604459
("kernel: add linux 5.10 support")
Signed-off-by: Qingfang Deng <qingfang.deng@siflower.com.cn>
This commit is contained in:
parent
fc9bde82f3
commit
503d26fb24
3 changed files with 6 additions and 6 deletions
|
@ -609,6 +609,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (!nf_ct_is_confirmed(ct))
|
+ if (!nf_ct_is_confirmed(ct))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
|
+ dir = CTINFO2DIR(ctinfo);
|
||||||
|
+
|
||||||
+ devs[dir] = xt_out(par);
|
+ devs[dir] = xt_out(par);
|
||||||
+ devs[!dir] = xt_in(par);
|
+ devs[!dir] = xt_in(par);
|
||||||
+
|
+
|
||||||
|
@ -618,8 +620,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
+ dir = CTINFO2DIR(ctinfo);
|
|
||||||
+
|
|
||||||
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
||||||
+ goto err_flow_route;
|
+ goto err_flow_route;
|
||||||
+
|
+
|
||||||
|
|
|
@ -547,6 +547,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (!nf_ct_is_confirmed(ct))
|
+ if (!nf_ct_is_confirmed(ct))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
|
+ dir = CTINFO2DIR(ctinfo);
|
||||||
|
+
|
||||||
+ devs[dir] = xt_out(par);
|
+ devs[dir] = xt_out(par);
|
||||||
+ devs[!dir] = xt_in(par);
|
+ devs[!dir] = xt_in(par);
|
||||||
+
|
+
|
||||||
|
@ -556,8 +558,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
+ dir = CTINFO2DIR(ctinfo);
|
|
||||||
+
|
|
||||||
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
||||||
+ goto err_flow_route;
|
+ goto err_flow_route;
|
||||||
+
|
+
|
||||||
|
|
|
@ -547,6 +547,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (!nf_ct_is_confirmed(ct))
|
+ if (!nf_ct_is_confirmed(ct))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
|
+ dir = CTINFO2DIR(ctinfo);
|
||||||
|
+
|
||||||
+ devs[dir] = xt_out(par);
|
+ devs[dir] = xt_out(par);
|
||||||
+ devs[!dir] = xt_in(par);
|
+ devs[!dir] = xt_in(par);
|
||||||
+
|
+
|
||||||
|
@ -556,8 +558,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
+ if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
|
||||||
+ return XT_CONTINUE;
|
+ return XT_CONTINUE;
|
||||||
+
|
+
|
||||||
+ dir = CTINFO2DIR(ctinfo);
|
|
||||||
+
|
|
||||||
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
+ if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
|
||||||
+ goto err_flow_route;
|
+ goto err_flow_route;
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in a new issue