* [MPTCP] [MPTCP][PATCH mptcp-next 7/7] mptcp: drop unnecessary CONFIG_MPTCP_IPV6
@ 2021-03-14 14:22 Geliang Tang
0 siblings, 0 replies; only message in thread
From: Geliang Tang @ 2021-03-14 14:22 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]
This patch dropped all the unnecessary '#if IS_ENABLED(CONFIG_MPTCP_IPV6)'
and '#endif'.
Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
---
net/mptcp/options.c | 6 ------
net/mptcp/pm_netlink.c | 8 +-------
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index e3fcd2b0ffd7..913cfc83bae4 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -221,22 +221,18 @@ static void mptcp_parse_option(const struct sk_buff *skb,
if (opsize == TCPOLEN_MPTCP_ADD_ADDR ||
opsize == TCPOLEN_MPTCP_ADD_ADDR_PORT)
mp_opt->addr.family = AF_INET;
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
else if (opsize == TCPOLEN_MPTCP_ADD_ADDR6 ||
opsize == TCPOLEN_MPTCP_ADD_ADDR6_PORT)
mp_opt->addr.family = AF_INET6;
-#endif
else
break;
} else {
if (opsize == TCPOLEN_MPTCP_ADD_ADDR_BASE ||
opsize == TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT)
mp_opt->addr.family = AF_INET;
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
else if (opsize == TCPOLEN_MPTCP_ADD_ADDR6_BASE ||
opsize == TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT)
mp_opt->addr.family = AF_INET6;
-#endif
else
break;
}
@@ -1155,10 +1151,8 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
u8 len = TCPOLEN_MPTCP_ADD_ADDR_BASE;
u8 echo = MPTCP_ADDR_ECHO;
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
if (opts->addr.family == AF_INET6)
len = TCPOLEN_MPTCP_ADD_ADDR6_BASE;
-#endif
if (opts->addr.port)
len += TCPOLEN_MPTCP_PORT_LEN;
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 812e0874e276..a24f35dc0217 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -897,10 +897,8 @@ static const struct nla_policy mptcp_pm_policy[MPTCP_PM_ATTR_MAX + 1] = {
static int mptcp_pm_family_to_addr(int family)
{
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
if (family == AF_INET6)
return MPTCP_PM_ADDR_ATTR_ADDR6;
-#endif
return MPTCP_PM_ADDR_ATTR_ADDR4;
}
@@ -933,11 +931,7 @@ static int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,
}
entry->addr.family = nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_FAMILY]);
- if (entry->addr.family != AF_INET
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
- && entry->addr.family != AF_INET6
-#endif
- ) {
+ if (entry->addr.family != AF_INET && entry->addr.family != AF_INET6) {
NL_SET_ERR_MSG_ATTR(info->extack, attr,
"unknown address family");
return -EINVAL;
--
2.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-14 14:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 14:22 [MPTCP] [MPTCP][PATCH mptcp-next 7/7] mptcp: drop unnecessary CONFIG_MPTCP_IPV6 Geliang Tang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).