lkml.org 
[lkml]   [2021]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH net-next 0/2] net: socket: use BIT() for MSG_* and fix MSG_CMSG_COMPAT
Date
From: Menglong Dong <dong.menglong@zte.com.cn>

In the first patch, I use BIT() for MSG_* to make the code tidier.

Directly use BIT() for MSG_* will be a bit problematic, because
'msg_flags' is defined as 'int' somewhere, and MSG_CMSG_COMPAT
will make it become negative, just like what Guenter Roeck
reported here:

https://lore.kernel.org/netdev/20210317013758.GA134033@roeck-us.net

So in the second patch, I change MSG_CMSG_COMPAT to BIT(21), as
David Laight suggested. MSG_CMSG_COMPAT is an internal value,
which is't used in userspace, so this change works.


Menglong Dong (2):
net: socket: use BIT() for MSG_*
net: socket: change MSG_CMSG_COMPAT to BIT(21)

include/linux/socket.h | 72 ++++++++++++++++++++++--------------------
1 file changed, 38 insertions(+), 34 deletions(-)

--
2.31.0

\
 
 \ /
  Last update: 2021-03-21 13:44    [W:0.047 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site