Skip to content

Commit 5ee2646

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 174032a commit 5ee2646

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");
@@ -388,10 +386,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
388386

389387
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
390388
err = mptcp_pm_parse_entry(laddr, info, true, &entry);
391-
if (err < 0) {
392-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
389+
if (err < 0)
393390
goto create_err;
394-
}
395391

396392
if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) {
397393
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "invalid addr flags");
@@ -402,10 +398,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
402398

403399
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
404400
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
405-
if (err < 0) {
406-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
401+
if (err < 0)
407402
goto create_err;
408-
}
409403

410404
if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) {
411405
GENL_SET_ERR_MSG(info, "families mismatch");
@@ -511,17 +505,13 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
511505

512506
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
513507
err = mptcp_pm_parse_entry(laddr, info, true, &addr_l);
514-
if (err < 0) {
515-
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
508+
if (err < 0)
516509
goto destroy_err;
517-
}
518510

519511
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
520512
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
521-
if (err < 0) {
522-
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
513+
if (err < 0)
523514
goto destroy_err;
524-
}
525515

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

0 commit comments

Comments
 (0)