History

mctp: unify sockaddr_mctp types

Use the more precise __kernel_sa_family_t for smctp_family, to match struct sockaddr. Also, use an unsigned int for the network member; negative networks don't make much sense. We're already using unsigned for mctp_dev and mctp_skb_cb, but need to change mctp_sock to suit.

Jeremy Kerr committed 5 years ago

Commit b416beb1 parent b2cddb43 files · +9 −8Browse files

Unified · Split

3 files
  1. Documentation/networking/mctp.rst +5 −5
  2. include/net/mctp.h +1 −1
  3. include/uapi/linux/mctp.h +3 −2
Documentation/networking/mctp.rst+5−5
@@ -59,11 +59,11 @@ specified with a ``sockaddr`` type, with a single-byte endpoint address: · 58 unmodified lines
5959 };
6060
6161 struct sockaddr_mctp {
62− unsigned short int smctp_family;
63− int smctp_network;
64− struct mctp_addr smctp_addr;
65− __u8 smctp_type;
66− __u8 smctp_tag;
62+ __kernel_sa_family_t smctp_family;
63+ unsigned int smctp_network;
64+ struct mctp_addr smctp_addr;
65+ __u8 smctp_type;
66+ __u8 smctp_tag;
6767 };
6868
6969 #define MCTP_NET_ANY 0x0
include/net/mctp.h+1−1
@@ -54,7 +54,7 @@ struct mctp_sock { · 53 unmodified lines
5454 struct sock sk;
5555
5656 /* bind() params */
57− int bind_net;
57+ unsigned int bind_net;
5858 mctp_eid_t bind_addr;
5959 __u8 bind_type;
6060
include/uapi/linux/mctp.h+3−2
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #define __UAPI_MCTP_H
1111
1212 #include <linux/types.h>
13+#include <linux/socket.h>
1314
1415 typedef __u8 mctp_eid_t;
1516
@@ -18,8 +19,8 @@ struct mctp_addr { · 2 unmodified lines
1819 };
1920
2021 struct sockaddr_mctp {
21− unsigned short int smctp_family;
22− int smctp_network;
22+ __kernel_sa_family_t smctp_family;
23+ unsigned int smctp_network;
2324 struct mctp_addr smctp_addr;
2425 __u8 smctp_type;
2526 __u8 smctp_tag;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t