@@ -189,7 +189,8 @@ static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *in
189189 }
190190
191191 if (!mptcp_pm_is_userspace (msk )) {
192- GENL_SET_ERR_MSG (info , "userspace PM not selected" );
192+ NL_SET_ERR_MSG_ATTR (info -> extack , token ,
193+ "userspace PM not selected" );
193194 sock_put ((struct sock * )msk );
194195 return NULL ;
195196 }
@@ -220,20 +221,21 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
220221 goto announce_err ;
221222
222223 if (addr_val .addr .id == 0 ) {
223- GENL_SET_ERR_MSG (info , "invalid addr id" );
224+ NL_SET_ERR_MSG_ATTR (info -> extack , addr , "invalid addr id" );
224225 err = - EINVAL ;
225226 goto announce_err ;
226227 }
227228
228229 if (!(addr_val .flags & MPTCP_PM_ADDR_FLAG_SIGNAL )) {
229- GENL_SET_ERR_MSG (info , "invalid addr flags" );
230+ NL_SET_ERR_MSG_ATTR (info -> extack , addr , "invalid addr flags" );
230231 err = - EINVAL ;
231232 goto announce_err ;
232233 }
233234
234235 err = mptcp_userspace_pm_append_new_local_addr (msk , & addr_val , false);
235236 if (err < 0 ) {
236- GENL_SET_ERR_MSG (info , "did not match address and id" );
237+ NL_SET_ERR_MSG_ATTR (info -> extack , addr ,
238+ "did not match address and id" );
237239 goto announce_err ;
238240 }
239241
@@ -388,7 +390,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
388390 goto create_err ;
389391
390392 if (entry .flags & MPTCP_PM_ADDR_FLAG_SIGNAL ) {
391- GENL_SET_ERR_MSG (info , "invalid addr flags" );
393+ NL_SET_ERR_MSG_ATTR (info -> extack , laddr , "invalid addr flags" );
392394 err = - EINVAL ;
393395 goto create_err ;
394396 }
@@ -407,7 +409,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
407409
408410 err = mptcp_userspace_pm_append_new_local_addr (msk , & entry , false);
409411 if (err < 0 ) {
410- GENL_SET_ERR_MSG (info , "did not match address and id" );
412+ NL_SET_ERR_MSG_ATTR (info -> extack , laddr ,
413+ "did not match address and id" );
411414 goto create_err ;
412415 }
413416
@@ -528,13 +531,13 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
528531 }
529532
530533 if (!addr_l .addr .port ) {
531- GENL_SET_ERR_MSG (info , "missing local port" );
534+ NL_SET_ERR_MSG_ATTR (info -> extack , laddr , "missing local port" );
532535 err = - EINVAL ;
533536 goto destroy_err ;
534537 }
535538
536539 if (!addr_r .port ) {
537- GENL_SET_ERR_MSG (info , "missing remote port" );
540+ NL_SET_ERR_MSG_ATTR (info -> extack , raddr , "missing remote port" );
538541 err = - EINVAL ;
539542 goto destroy_err ;
540543 }
@@ -599,7 +602,8 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
599602 goto set_flags_err ;
600603
601604 if (rem .addr .family == AF_UNSPEC ) {
602- GENL_SET_ERR_MSG (info , "invalid remote address family" );
605+ NL_SET_ERR_MSG_ATTR (info -> extack , attr_rem ,
606+ "invalid remote address family" );
603607 ret = - EINVAL ;
604608 goto set_flags_err ;
605609 }
@@ -722,7 +726,7 @@ int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
722726 spin_lock_bh (& msk -> pm .lock );
723727 entry = mptcp_userspace_pm_lookup_addr_by_id (msk , addr .addr .id );
724728 if (!entry ) {
725- GENL_SET_ERR_MSG (info , "address not found" );
729+ NL_SET_ERR_MSG_ATTR (info -> extack , attr , "address not found" );
726730 ret = - EINVAL ;
727731 goto unlock_fail ;
728732 }
0 commit comments