@@ -1171,8 +1171,9 @@ static void fl_set_key_flag(u32 flower_key, u32 flower_mask,
1171
1171
}
1172
1172
}
1173
1173
1174
- static int fl_set_key_flags (struct nlattr * * tb , bool encap , u32 * flags_key ,
1175
- u32 * flags_mask , struct netlink_ext_ack * extack )
1174
+ static int fl_set_key_flags (struct nlattr * tca_opts , struct nlattr * * tb ,
1175
+ bool encap , u32 * flags_key , u32 * flags_mask ,
1176
+ struct netlink_ext_ack * extack )
1176
1177
{
1177
1178
int fl_key , fl_mask ;
1178
1179
u32 key , mask ;
@@ -1186,7 +1187,7 @@ static int fl_set_key_flags(struct nlattr **tb, bool encap, u32 *flags_key,
1186
1187
}
1187
1188
1188
1189
/* mask is mandatory for flags */
1189
- if (NL_REQ_ATTR_CHECK (extack , NULL , tb , fl_mask )) {
1190
+ if (NL_REQ_ATTR_CHECK (extack , tca_opts , tb , fl_mask )) {
1190
1191
NL_SET_ERR_MSG (extack , "Missing flags mask" );
1191
1192
return - EINVAL ;
1192
1193
}
@@ -1865,9 +1866,9 @@ static int fl_set_key_cfm(struct nlattr **tb,
1865
1866
return 0 ;
1866
1867
}
1867
1868
1868
- static int fl_set_key (struct net * net , struct nlattr * * tb ,
1869
- struct fl_flow_key * key , struct fl_flow_key * mask ,
1870
- struct netlink_ext_ack * extack )
1869
+ static int fl_set_key (struct net * net , struct nlattr * tca_opts ,
1870
+ struct nlattr * * tb , struct fl_flow_key * key ,
1871
+ struct fl_flow_key * mask , struct netlink_ext_ack * extack )
1871
1872
{
1872
1873
__be16 ethertype ;
1873
1874
int ret = 0 ;
@@ -2100,14 +2101,16 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
2100
2101
return ret ;
2101
2102
2102
2103
if (tb [TCA_FLOWER_KEY_FLAGS ]) {
2103
- ret = fl_set_key_flags (tb , false, & key -> control .flags ,
2104
+ ret = fl_set_key_flags (tca_opts , tb , false,
2105
+ & key -> control .flags ,
2104
2106
& mask -> control .flags , extack );
2105
2107
if (ret )
2106
2108
return ret ;
2107
2109
}
2108
2110
2109
2111
if (tb [TCA_FLOWER_KEY_ENC_FLAGS ])
2110
- ret = fl_set_key_flags (tb , true, & key -> enc_control .flags ,
2112
+ ret = fl_set_key_flags (tca_opts , tb , true,
2113
+ & key -> enc_control .flags ,
2111
2114
& mask -> enc_control .flags , extack );
2112
2115
2113
2116
return ret ;
@@ -2358,6 +2361,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
2358
2361
{
2359
2362
struct cls_fl_head * head = fl_head_dereference (tp );
2360
2363
bool rtnl_held = !(flags & TCA_ACT_FLAGS_NO_RTNL );
2364
+ struct nlattr * tca_opts = tca [TCA_OPTIONS ];
2361
2365
struct cls_fl_filter * fold = * arg ;
2362
2366
bool bound_to_filter = false;
2363
2367
struct cls_fl_filter * fnew ;
@@ -2366,7 +2370,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
2366
2370
bool in_ht ;
2367
2371
int err ;
2368
2372
2369
- if (!tca [ TCA_OPTIONS ] ) {
2373
+ if (!tca_opts ) {
2370
2374
err = - EINVAL ;
2371
2375
goto errout_fold ;
2372
2376
}
@@ -2384,7 +2388,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
2384
2388
}
2385
2389
2386
2390
err = nla_parse_nested_deprecated (tb , TCA_FLOWER_MAX ,
2387
- tca [ TCA_OPTIONS ] , fl_policy , NULL );
2391
+ tca_opts , fl_policy , NULL );
2388
2392
if (err < 0 )
2389
2393
goto errout_tb ;
2390
2394
@@ -2460,7 +2464,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
2460
2464
bound_to_filter = true;
2461
2465
}
2462
2466
2463
- err = fl_set_key (net , tb , & fnew -> key , & mask -> key , extack );
2467
+ err = fl_set_key (net , tca_opts , tb , & fnew -> key , & mask -> key , extack );
2464
2468
if (err )
2465
2469
goto unbind_filter ;
2466
2470
@@ -2800,18 +2804,19 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain,
2800
2804
struct nlattr * * tca ,
2801
2805
struct netlink_ext_ack * extack )
2802
2806
{
2807
+ struct nlattr * tca_opts = tca [TCA_OPTIONS ];
2803
2808
struct fl_flow_tmplt * tmplt ;
2804
2809
struct nlattr * * tb ;
2805
2810
int err ;
2806
2811
2807
- if (!tca [ TCA_OPTIONS ] )
2812
+ if (!tca_opts )
2808
2813
return ERR_PTR (- EINVAL );
2809
2814
2810
2815
tb = kcalloc (TCA_FLOWER_MAX + 1 , sizeof (struct nlattr * ), GFP_KERNEL );
2811
2816
if (!tb )
2812
2817
return ERR_PTR (- ENOBUFS );
2813
2818
err = nla_parse_nested_deprecated (tb , TCA_FLOWER_MAX ,
2814
- tca [ TCA_OPTIONS ] , fl_policy , NULL );
2819
+ tca_opts , fl_policy , NULL );
2815
2820
if (err )
2816
2821
goto errout_tb ;
2817
2822
@@ -2821,7 +2826,8 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain,
2821
2826
goto errout_tb ;
2822
2827
}
2823
2828
tmplt -> chain = chain ;
2824
- err = fl_set_key (net , tb , & tmplt -> dummy_key , & tmplt -> mask , extack );
2829
+ err = fl_set_key (net , tca_opts , tb , & tmplt -> dummy_key ,
2830
+ & tmplt -> mask , extack );
2825
2831
if (err )
2826
2832
goto errout_tmplt ;
2827
2833
0 commit comments