Skip to content

Commit 0cfdd08

Browse files
matttbeintel-lab-lkp
authored andcommitted
mptcp: pm: remove duplicated error messages
mptcp_pm_parse_entry() and mptcp_pm_parse_addr() will already set a error message in case of parsing issue. Then, no need to override this error message with another less precise one: "error parsing address". Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent e3ecfad commit 0cfdd08

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

net/mptcp/pm_userspace.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,8 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
216216

217217
addr = info->attrs[MPTCP_PM_ATTR_ADDR];
218218
err = mptcp_pm_parse_entry(addr, info, true, &addr_val);
219-
if (err < 0) {
220-
GENL_SET_ERR_MSG(info, "error parsing local address");
219+
if (err < 0)
221220
goto announce_err;
222-
}
223221

224222
if (addr_val.addr.id == 0) {
225223
NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id");
@@ -386,10 +384,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
386384

387385
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
388386
err = mptcp_pm_parse_entry(laddr, info, true, &entry);
389-
if (err < 0) {
390-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
387+
if (err < 0)
391388
goto create_err;
392-
}
393389

394390
if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) {
395391
GENL_SET_ERR_MSG(info, "invalid addr flags");
@@ -400,10 +396,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
400396

401397
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
402398
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
403-
if (err < 0) {
404-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
399+
if (err < 0)
405400
goto create_err;
406-
}
407401

408402
if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) {
409403
GENL_SET_ERR_MSG(info, "families mismatch");
@@ -509,17 +503,13 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
509503

510504
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
511505
err = mptcp_pm_parse_entry(laddr, info, true, &addr_l);
512-
if (err < 0) {
513-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
506+
if (err < 0)
514507
goto destroy_err;
515-
}
516508

517509
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
518510
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
519-
if (err < 0) {
520-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
511+
if (err < 0)
521512
goto destroy_err;
522-
}
523513

524514
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
525515
if (addr_l.addr.family == AF_INET && ipv6_addr_v4mapped(&addr_r.addr6)) {

0 commit comments

Comments
 (0)