Skip to content

Commit

Permalink
selftests: mptcp: pm_nl_ctl: remove re-definition
Browse files Browse the repository at this point in the history
'MPTCP_PM_NAME' is defined in 'linux/mptcp.h', no need to re-define it.

'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but
'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the
latter, and drop the other one.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe authored and intel-lab-lkp committed Aug 19, 2024
1 parent a3cc6d5 commit a55d6c9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tools/testing/selftests/net/mptcp/pm_nl_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@

#include "linux/mptcp.h"

#ifndef MPTCP_PM_NAME
#define MPTCP_PM_NAME "mptcp_pm"
#endif
#ifndef MPTCP_PM_EVENTS
#define MPTCP_PM_EVENTS "mptcp_pm_events"
#endif
#ifndef IPPROTO_MPTCP
#define IPPROTO_MPTCP 262
#endif
Expand Down Expand Up @@ -116,7 +110,7 @@ static int capture_events(int fd, int event_group)

if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
&event_group, sizeof(event_group)) < 0)
error(1, errno, "could not join the " MPTCP_PM_EVENTS " mcast group");
error(1, errno, "could not join the " MPTCP_PM_EV_GRP_NAME " mcast group");

do {
FD_ZERO(&rfds);
Expand Down Expand Up @@ -288,7 +282,7 @@ static int genl_parse_getfamily(struct nlmsghdr *nlh, int *pm_family,
if (grp->rta_type == CTRL_ATTR_MCAST_GRP_ID)
*events_mcast_grp = *(__u32 *)RTA_DATA(grp);
else if (grp->rta_type == CTRL_ATTR_MCAST_GRP_NAME &&
!strcmp(RTA_DATA(grp), MPTCP_PM_EVENTS))
!strcmp(RTA_DATA(grp), MPTCP_PM_EV_GRP_NAME))
got_events_grp = 1;

grp = RTA_NEXT(grp, grp_len);
Expand Down

0 comments on commit a55d6c9

Please sign in to comment.