Skip to contentSkip to conversation

net/smc: retain old name for diag_mode field

PATCH In review Eugene Syromiatnikov 2 participants 2 messages Oct 6, 2018 – Oct 7, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 net/smc: retain old name for diag_mode field

Commit v4.19-rc1~140^2~285^2~4 changed the name of diag_fallback field of struct smc_diag_msg structure to diag_mode. However, this structure is a part of UAPI, and this change breaks user space applications that use it ([1], for example). Since the new name is more suitable, convert the field to a union that provides access to the data via both the new and the old name.

[1] https://gitlab.com/strace/strace/blob/v4.24/netlink_smc_diag.c#L165

Fixes c601171d7a60 ("net/smc: provide smc mode in smc_diag.c")
---
 include/uapi/linux/smc_diag.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/uapi/linux/smc_diag.h +4 -1
index 6180c6d..8cb3a6f 100644
@@ -20,7 +20,10 @@ struct smc_diag_req {
 struct smc_diag_msg {
 	__u8		diag_family;
 	__u8		diag_state;
-	__u8		diag_mode;
+	union {
+		__u8	diag_mode;
+		__u8	diag_fallback; /* the old name of the field */
+	};
 	__u8		diag_shutdown;
 	struct inet_diag_sockid id;
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 1 line · Eugene Syromiatnikov

Commit v4.19-rc1~140^2~285^2~4 changed the name of diag_fallback field

The commit citing style should be the same as in the "Fixes:" tag.

Quoted 10 lines

of struct smc_diag_msg structure to diag_mode. However, this structure is a part of UAPI, and this change breaks user space applications that use it ([1], for example). Since the new name is more suitable, convert the field to a union that provides access to the data via both the new and the old name.

[1] https://gitlab.com/strace/strace/blob/v4.24/netlink_smc_diag.c#L165

Fixes c601171d7a60 ("net/smc: provide smc mode in smc_diag.c")

[...]

MBR, Sergei