mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: socket: use BIT() for MSG_* and fix MSG_CMSG_COMPAT
@ 2021-03-21 12:39 menglong8.dong
  2021-03-21 12:39 ` [PATCH net-next 1/2] net: socket: use BIT() for MSG_* menglong8.dong
  2021-03-21 12:39 ` [PATCH net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21) menglong8.dong
  0 siblings, 2 replies; 6+ messages in thread
From: menglong8.dong @ 2021-03-21 12:39 UTC (permalink / raw)
  To: andy.shevchenko, kuba, linux, David.Laight
  Cc: davem, dong.menglong, viro, herbert, axboe, linux-kernel, netdev

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-22  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21 12:39 [PATCH net-next 0/2] net: socket: use BIT() for MSG_* and fix MSG_CMSG_COMPAT menglong8.dong
2021-03-21 12:39 ` [PATCH net-next 1/2] net: socket: use BIT() for MSG_* menglong8.dong
2021-03-21 12:39 ` [PATCH net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21) menglong8.dong
2021-03-21 12:49   ` Herbert Xu
2021-03-21 13:29     ` Menglong Dong
2021-03-22  8:58     ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®