Skip to content

Commit 3127e61

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 c88cdcd commit 3127e61

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
@@ -217,10 +217,8 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
217217

218218
addr = info->attrs[MPTCP_PM_ATTR_ADDR];
219219
err = mptcp_pm_parse_entry(addr, info, true, &addr_val);
220-
if (err < 0) {
221-
GENL_SET_ERR_MSG(info, "error parsing local address");
220+
if (err < 0)
222221
goto announce_err;
223-
}
224222

225223
if (addr_val.addr.id == 0) {
226224
NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id");
@@ -390,10 +388,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
390388

391389
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
392390
err = mptcp_pm_parse_entry(laddr, info, true, &entry);
393-
if (err < 0) {
394-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
391+
if (err < 0)
395392
goto create_err;
396-
}
397393

398394
if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) {
399395
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "invalid addr flags");
@@ -404,10 +400,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
404400

405401
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
406402
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
407-
if (err < 0) {
408-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
403+
if (err < 0)
409404
goto create_err;
410-
}
411405

412406
if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) {
413407
GENL_SET_ERR_MSG(info, "families mismatch");
@@ -514,17 +508,13 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
514508

515509
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
516510
err = mptcp_pm_parse_entry(laddr, info, true, &addr_l);
517-
if (err < 0) {
518-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
511+
if (err < 0)
519512
goto destroy_err;
520-
}
521513

522514
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
523515
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
524-
if (err < 0) {
525-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
516+
if (err < 0)
526517
goto destroy_err;
527-
}
528518

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

0 commit comments

Comments
 (0)