Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb95ec6

Browse files
Wei Yongjundavem330
authored andcommitted
pkt_sched: fix error return code in fw_change_attrs()
Fix to return -EINVAL when tb[TCA_FW_MASK] is set and head->mask != 0xFFFFFFFF instead of 0 (ifdef CONFIG_NET_CLS_IND and tb[TCA_FW_INDEV]), as done elsewhere in this function. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e15465e commit cb95ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/cls_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
204204
if (err < 0)
205205
return err;
206206

207-
err = -EINVAL;
208207
if (tb[TCA_FW_CLASSID]) {
209208
f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]);
210209
tcf_bind_filter(tp, &f->res, base);
@@ -218,6 +217,7 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
218217
}
219218
#endif /* CONFIG_NET_CLS_IND */
220219

220+
err = -EINVAL;
221221
if (tb[TCA_FW_MASK]) {
222222
mask = nla_get_u32(tb[TCA_FW_MASK]);
223223
if (mask != head->mask)

0 commit comments

Comments
 (0)