Skip to content

Commit b623c33

Browse files
committed
Merge: net: sched: fix erspan_opt settings in cls_flower
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/158 JIRA: https://issues.redhat.com/browse/RHEL-73195 Tested: compile only Signed-off-by: Xin Long <lxin@redhat.com> Approved-by: Antoine Tenart <atenart@redhat.com> Approved-by: Davide Caratti <dcaratti@redhat.com> Approved-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 7e097da + 43b6780 commit b623c33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/sched/cls_flower.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,6 @@ static int fl_set_erspan_opt(const struct nlattr *nla, struct fl_flow_key *key,
13691369
int err;
13701370

13711371
md = (struct erspan_metadata *)&key->enc_opts.data[key->enc_opts.len];
1372-
memset(md, 0xff, sizeof(*md));
13731372
md->version = 1;
13741373

13751374
if (!depth)
@@ -1398,9 +1397,9 @@ static int fl_set_erspan_opt(const struct nlattr *nla, struct fl_flow_key *key,
13981397
NL_SET_ERR_MSG(extack, "Missing tunnel key erspan option index");
13991398
return -EINVAL;
14001399
}
1400+
memset(&md->u.index, 0xff, sizeof(md->u.index));
14011401
if (tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX]) {
14021402
nla = tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX];
1403-
memset(&md->u, 0x00, sizeof(md->u));
14041403
md->u.index = nla_get_be32(nla);
14051404
}
14061405
} else if (md->version == 2) {
@@ -1409,10 +1408,12 @@ static int fl_set_erspan_opt(const struct nlattr *nla, struct fl_flow_key *key,
14091408
NL_SET_ERR_MSG(extack, "Missing tunnel key erspan option dir or hwid");
14101409
return -EINVAL;
14111410
}
1411+
md->u.md2.dir = 1;
14121412
if (tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR]) {
14131413
nla = tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR];
14141414
md->u.md2.dir = nla_get_u8(nla);
14151415
}
1416+
set_hwid(&md->u.md2, 0xff);
14161417
if (tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID]) {
14171418
nla = tb[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID];
14181419
set_hwid(&md->u.md2, nla_get_u8(nla));

0 commit comments

Comments
 (0)