mbox series

[net-next,00/10] net: better const qualifier awareness

Message ID 20230317155539.2552954-1-edumazet@google.com (mailing list archive)
Headers show
Series net: better const qualifier awareness | expand

Message

Eric Dumazet March 17, 2023, 3:55 p.m. UTC
This is a follow-up of d27d367d3b78 ("inet: better const qualifier awareness")

Adopting container_of_const() to perform (struct sock *)->(protocol sock *)
operation is allowing us to propagate const qualifier and thus detect
misuses at compile time.

Most conversions are trivial, because most protocols did not adopt yet
const sk pointers where it could make sense.

Only mptcp and tcp patches (end of this series) are requiring small
adjustments.

Thanks !

Eric Dumazet (10):
  udp: preserve const qualifier in udp_sk()
  af_packet: preserve const qualifier in pkt_sk()
  raw: preserve const qualifier in raw_sk()
  ipv6: raw: preserve const qualifier in raw6_sk()
  dccp: preserve const qualifier in dccp_sk()
  af_unix: preserve const qualifier in unix_sk()
  smc: preserve const qualifier in smc_sk()
  x25: preserve const qualifier in [a]x25_sk()
  mptcp: preserve const qualifier in mptcp_sk()
  tcp: preserve const qualifier in tcp_sk()

 include/linux/dccp.h     |  6 ++----
 include/linux/ipv6.h     |  5 +----
 include/linux/tcp.h      | 10 ++++++----
 include/linux/udp.h      |  5 +----
 include/net/af_unix.h    |  5 +----
 include/net/ax25.h       |  5 +----
 include/net/raw.h        |  5 +----
 include/net/tcp.h        |  2 +-
 include/net/x25.h        |  5 +----
 net/ipv4/tcp.c           |  2 +-
 net/ipv4/tcp_input.c     |  4 ++--
 net/ipv4/tcp_minisocks.c |  5 +++--
 net/ipv4/tcp_output.c    |  9 +++++++--
 net/ipv4/tcp_recovery.c  |  2 +-
 net/mptcp/protocol.c     |  2 +-
 net/mptcp/protocol.h     |  9 +++------
 net/packet/internal.h    |  5 +----
 net/smc/smc.h            |  5 +----
 security/lsm_audit.c     |  2 +-
 19 files changed, 36 insertions(+), 57 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 18, 2023, 12:30 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 17 Mar 2023 15:55:29 +0000 you wrote:
> This is a follow-up of d27d367d3b78 ("inet: better const qualifier awareness")
> 
> Adopting container_of_const() to perform (struct sock *)->(protocol sock *)
> operation is allowing us to propagate const qualifier and thus detect
> misuses at compile time.
> 
> Most conversions are trivial, because most protocols did not adopt yet
> const sk pointers where it could make sense.
> 
> [...]

Here is the summary with links:
  - [net-next,01/10] udp: preserve const qualifier in udp_sk()
    https://git.kernel.org/netdev/net-next/c/94c540fbfc80
  - [net-next,02/10] af_packet: preserve const qualifier in pkt_sk()
    https://git.kernel.org/netdev/net-next/c/68ac9a8b6e65
  - [net-next,03/10] raw: preserve const qualifier in raw_sk()
    https://git.kernel.org/netdev/net-next/c/0a2db4630b72
  - [net-next,04/10] ipv6: raw: preserve const qualifier in raw6_sk()
    https://git.kernel.org/netdev/net-next/c/47fcae28b9ec
  - [net-next,05/10] dccp: preserve const qualifier in dccp_sk()
    https://git.kernel.org/netdev/net-next/c/ae6084b73992
  - [net-next,06/10] af_unix: preserve const qualifier in unix_sk()
    https://git.kernel.org/netdev/net-next/c/b064ba9c3cfa
  - [net-next,07/10] smc: preserve const qualifier in smc_sk()
    https://git.kernel.org/netdev/net-next/c/407db475d505
  - [net-next,08/10] x25: preserve const qualifier in [a]x25_sk()
    https://git.kernel.org/netdev/net-next/c/c7154ca8e075
  - [net-next,09/10] mptcp: preserve const qualifier in mptcp_sk()
    https://git.kernel.org/netdev/net-next/c/403a40f2304d
  - [net-next,10/10] tcp: preserve const qualifier in tcp_sk()
    https://git.kernel.org/netdev/net-next/c/e9d9da91548b

You are awesome, thank you!