* [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump
@ 2023-04-14 21:21 Xin Long
2023-04-14 21:21 ` [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param Xin Long
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xin Long @ 2023-04-14 21:21 UTC (permalink / raw)
To: network dev, linux-sctp
Cc: davem, kuba, Eric Dumazet, Paolo Abeni, Marcelo Ricardo Leitner
The 1st patch removes the unused and obsolete hostname_address from
sctp_association peer and also the bit from sctp_info peer_capables,
and then reuses its bit for reconf_capable and use the higher
available bit for intl_capable in the 2nd patch.
Xin Long (2):
sctp: delete the obsolete code for the host name address param
sctp: add intl_capable and reconf_capable in ss peer_capable
include/net/sctp/structs.h | 1 -
net/sctp/sm_make_chunk.c | 10 +---------
net/sctp/socket.c | 5 +++--
3 files changed, 4 insertions(+), 12 deletions(-)
--
2.39.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param
2023-04-14 21:21 [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump Xin Long
@ 2023-04-14 21:21 ` Xin Long
2023-04-14 21:21 ` [PATCH net-next 2/2] sctp: add intl_capable and reconf_capable in ss peer_capable Xin Long
2023-04-17 7:30 ` [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Xin Long @ 2023-04-14 21:21 UTC (permalink / raw)
To: network dev, linux-sctp
Cc: davem, kuba, Eric Dumazet, Paolo Abeni, Marcelo Ricardo Leitner
In the latest RFC9260, the Host Name Address param has been deprecated.
For INIT chunk:
Note 3: An INIT chunk MUST NOT contain the Host Name Address
parameter. The receiver of an INIT chunk containing a Host Name
Address parameter MUST send an ABORT chunk and MAY include an
"Unresolvable Address" error cause.
For Supported Address Types:
The value indicating the Host Name Address parameter MUST NOT be
used when sending this parameter and MUST be ignored when receiving
this parameter.
Currently Linux SCTP doesn't really support Host Name Address param,
but only saves some flag and print debug info, which actually won't
even be triggered due to the verification in sctp_verify_param().
This patch is to delete those dead code.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/net/sctp/structs.h | 1 -
net/sctp/sm_make_chunk.c | 10 +---------
net/sctp/socket.c | 2 +-
3 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index a0933efd93c3..070c9458fff4 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1711,7 +1711,6 @@ struct sctp_association {
__u16 ecn_capable:1, /* Can peer do ECN? */
ipv4_address:1, /* Peer understands IPv4 addresses? */
ipv6_address:1, /* Peer understands IPv6 addresses? */
- hostname_address:1, /* Peer understands DNS addresses? */
asconf_capable:1, /* Does peer support ADDIP? */
prsctp_capable:1, /* Can peer do PR-SCTP? */
reconf_capable:1, /* Can peer do RE-CONFIG? */
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index c7503fd64915..c8f4ec5d5f98 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2207,7 +2207,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
break;
case SCTP_PARAM_HOST_NAME_ADDRESS:
- /* Tell the peer, we won't support this param. */
+ /* This param has been Deprecated, send ABORT. */
sctp_process_hn_param(asoc, param, chunk, err_chunk);
retval = SCTP_IERROR_ABORT;
break;
@@ -2589,10 +2589,6 @@ static int sctp_process_param(struct sctp_association *asoc,
asoc->cookie_life = ktime_add_ms(asoc->cookie_life, stale);
break;
- case SCTP_PARAM_HOST_NAME_ADDRESS:
- pr_debug("%s: unimplemented SCTP_HOST_NAME_ADDRESS\n", __func__);
- break;
-
case SCTP_PARAM_SUPPORTED_ADDRESS_TYPES:
/* Turn off the default values first so we'll know which
* ones are really set by the peer.
@@ -2624,10 +2620,6 @@ static int sctp_process_param(struct sctp_association *asoc,
asoc->peer.ipv6_address = 1;
break;
- case SCTP_PARAM_HOST_NAME_ADDRESS:
- asoc->peer.hostname_address = 1;
- break;
-
default: /* Just ignore anything else. */
break;
}
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 218e0982c370..079e726909b4 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5195,7 +5195,7 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc,
mask = asoc->peer.ecn_capable << 1;
mask = (mask | asoc->peer.ipv4_address) << 1;
mask = (mask | asoc->peer.ipv6_address) << 1;
- mask = (mask | asoc->peer.hostname_address) << 1;
+ mask = mask << 1;
mask = (mask | asoc->peer.asconf_capable) << 1;
mask = (mask | asoc->peer.prsctp_capable) << 1;
mask = (mask | asoc->peer.auth_capable);
--
2.39.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] sctp: add intl_capable and reconf_capable in ss peer_capable
2023-04-14 21:21 [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump Xin Long
2023-04-14 21:21 ` [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param Xin Long
@ 2023-04-14 21:21 ` Xin Long
2023-04-17 7:30 ` [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Xin Long @ 2023-04-14 21:21 UTC (permalink / raw)
To: network dev, linux-sctp
Cc: davem, kuba, Eric Dumazet, Paolo Abeni, Marcelo Ricardo Leitner
There are two new peer capables have been added since sctp_diag was
introduced into SCTP. When dumping the peer capables, these two new
peer capables should also be included. To not break the old capables,
reconf_capable takes the old hostname_address bit, and intl_capable
uses the higher available bit in sctpi_peer_capable.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sctp/socket.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 079e726909b4..cda8c2874691 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5192,10 +5192,11 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc,
info->sctpi_peer_rwnd = asoc->peer.rwnd;
info->sctpi_peer_tag = asoc->c.peer_vtag;
- mask = asoc->peer.ecn_capable << 1;
+ mask = asoc->peer.intl_capable << 1;
+ mask = (mask | asoc->peer.ecn_capable) << 1;
mask = (mask | asoc->peer.ipv4_address) << 1;
mask = (mask | asoc->peer.ipv6_address) << 1;
- mask = mask << 1;
+ mask = (mask | asoc->peer.reconf_capable) << 1;
mask = (mask | asoc->peer.asconf_capable) << 1;
mask = (mask | asoc->peer.prsctp_capable) << 1;
mask = (mask | asoc->peer.auth_capable);
--
2.39.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump
2023-04-14 21:21 [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump Xin Long
2023-04-14 21:21 ` [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param Xin Long
2023-04-14 21:21 ` [PATCH net-next 2/2] sctp: add intl_capable and reconf_capable in ss peer_capable Xin Long
@ 2023-04-17 7:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-17 7:30 UTC (permalink / raw)
To: Xin Long; +Cc: netdev, linux-sctp, davem, kuba, edumazet, pabeni,
marcelo.leitner
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 14 Apr 2023 17:21:14 -0400 you wrote:
> The 1st patch removes the unused and obsolete hostname_address from
> sctp_association peer and also the bit from sctp_info peer_capables,
> and then reuses its bit for reconf_capable and use the higher
> available bit for intl_capable in the 2nd patch.
>
> Xin Long (2):
> sctp: delete the obsolete code for the host name address param
> sctp: add intl_capable and reconf_capable in ss peer_capable
>
> [...]
Here is the summary with links:
- [net-next,1/2] sctp: delete the obsolete code for the host name address param
https://git.kernel.org/netdev/net-next/c/bd4b28189469
- [net-next,2/2] sctp: add intl_capable and reconf_capable in ss peer_capable
https://git.kernel.org/netdev/net-next/c/ab4f1e28c941
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-17 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-14 21:21 [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump Xin Long
2023-04-14 21:21 ` [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param Xin Long
2023-04-14 21:21 ` [PATCH net-next 2/2] sctp: add intl_capable and reconf_capable in ss peer_capable Xin Long
2023-04-17 7:30 ` [PATCH net-next 0/2] sctp: add some missing peer_capables in sctp info dump patchwork-bot+netdevbpf
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).