diff options
author | Patrick McHardy <kaber@trash.net> | 2010-05-10 12:39:28 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-05-10 12:39:28 -0400 |
commit | 1e4b1057121bc756b91758a434b504d2010f6088 (patch) | |
tree | b016cf2c728289c7e36d9e4e488f30ab0bd0ae6e /include/net | |
parent | 3b254c54ec46eb022cb26ee6ab37fae23f5f7d6a (diff) | |
parent | 3ee943728fff536edaf8f59faa58aaa1aa7366e3 (diff) |
Merge branch 'master' of /repos/git/net-next-2.6
Conflicts:
net/bridge/br_device.c
net/bridge/br_forward.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/af_unix.h | 20 | ||||
-rw-r--r-- | include/net/caif/caif_dev.h | 17 | ||||
-rw-r--r-- | include/net/caif/cfcnfg.h | 17 | ||||
-rw-r--r-- | include/net/caif/cfctrl.h | 7 | ||||
-rw-r--r-- | include/net/caif/cfsrvl.h | 22 | ||||
-rw-r--r-- | include/net/cfg80211.h | 6 | ||||
-rw-r--r-- | include/net/fib_rules.h | 2 | ||||
-rw-r--r-- | include/net/inet_sock.h | 37 | ||||
-rw-r--r-- | include/net/inet_timewait_sock.h | 4 | ||||
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | include/net/ipv6.h | 5 | ||||
-rw-r--r-- | include/net/mac80211.h | 38 | ||||
-rw-r--r-- | include/net/mld.h | 75 | ||||
-rw-r--r-- | include/net/netns/generic.h | 9 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 1 | ||||
-rw-r--r-- | include/net/sctp/command.h | 1 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 3 | ||||
-rw-r--r-- | include/net/sctp/sm.h | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 67 | ||||
-rw-r--r-- | include/net/snmp.h | 2 | ||||
-rw-r--r-- | include/net/sock.h | 132 | ||||
-rw-r--r-- | include/net/tcp.h | 11 | ||||
-rw-r--r-- | include/net/transp_v6.h | 3 | ||||
-rw-r--r-- | include/net/x25device.h | 1 |
24 files changed, 340 insertions, 143 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 1614d78c60ed..20725e213aee 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -30,7 +30,7 @@ struct unix_skb_parms { | |||
30 | #endif | 30 | #endif |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) | 33 | #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) |
34 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) | 34 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) |
35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) | 35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) |
36 | 36 | ||
@@ -45,21 +45,23 @@ struct unix_skb_parms { | |||
45 | struct unix_sock { | 45 | struct unix_sock { |
46 | /* WARNING: sk has to be the first member */ | 46 | /* WARNING: sk has to be the first member */ |
47 | struct sock sk; | 47 | struct sock sk; |
48 | struct unix_address *addr; | 48 | struct unix_address *addr; |
49 | struct dentry *dentry; | 49 | struct dentry *dentry; |
50 | struct vfsmount *mnt; | 50 | struct vfsmount *mnt; |
51 | struct mutex readlock; | 51 | struct mutex readlock; |
52 | struct sock *peer; | 52 | struct sock *peer; |
53 | struct sock *other; | 53 | struct sock *other; |
54 | struct list_head link; | 54 | struct list_head link; |
55 | atomic_long_t inflight; | 55 | atomic_long_t inflight; |
56 | spinlock_t lock; | 56 | spinlock_t lock; |
57 | unsigned int gc_candidate : 1; | 57 | unsigned int gc_candidate : 1; |
58 | unsigned int gc_maybe_cycle : 1; | 58 | unsigned int gc_maybe_cycle : 1; |
59 | wait_queue_head_t peer_wait; | 59 | struct socket_wq peer_wq; |
60 | }; | 60 | }; |
61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
62 | 62 | ||
63 | #define peer_wait peer_wq.wait | ||
64 | |||
63 | #ifdef CONFIG_SYSCTL | 65 | #ifdef CONFIG_SYSCTL |
64 | extern int unix_sysctl_register(struct net *net); | 66 | extern int unix_sysctl_register(struct net *net); |
65 | extern void unix_sysctl_unregister(struct net *net); | 67 | extern void unix_sysctl_unregister(struct net *net); |
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index 42a7c7867849..318ab9478a44 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h | |||
@@ -23,17 +23,19 @@ struct caif_param { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * caif_connect_request - Request data for CAIF channel setup. | 26 | * struct caif_connect_request - Request data for CAIF channel setup. |
27 | * @protocol: Type of CAIF protocol to use (at, datagram etc) | ||
27 | * @sockaddr: Socket address to connect. | 28 | * @sockaddr: Socket address to connect. |
28 | * @priority: Priority of the connection. | 29 | * @priority: Priority of the connection. |
29 | * @link_selector: Link selector (high bandwidth or low latency) | 30 | * @link_selector: Link selector (high bandwidth or low latency) |
30 | * @link_name: Name of the CAIF Link Layer to use. | 31 | * @link_name: Name of the CAIF Link Layer to use. |
32 | * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). | ||
31 | * | 33 | * |
32 | * This struct is used when connecting a CAIF channel. | 34 | * This struct is used when connecting a CAIF channel. |
33 | * It contains all CAIF channel configuration options. | 35 | * It contains all CAIF channel configuration options. |
34 | */ | 36 | */ |
35 | struct caif_connect_request { | 37 | struct caif_connect_request { |
36 | int protocol; | 38 | enum caif_protocol_type protocol; |
37 | struct sockaddr_caif sockaddr; | 39 | struct sockaddr_caif sockaddr; |
38 | enum caif_channel_priority priority; | 40 | enum caif_channel_priority priority; |
39 | enum caif_link_selector link_selector; | 41 | enum caif_link_selector link_selector; |
@@ -68,6 +70,17 @@ int caif_connect_client(struct caif_connect_request *config, | |||
68 | int caif_disconnect_client(struct cflayer *client_layer); | 70 | int caif_disconnect_client(struct cflayer *client_layer); |
69 | 71 | ||
70 | /** | 72 | /** |
73 | * caif_release_client - Release adaptation layer reference to client. | ||
74 | * | ||
75 | * @client_layer: Client layer. | ||
76 | * | ||
77 | * Releases a client/adaptation layer use of the caif stack. | ||
78 | * This function must be used after caif_disconnect_client to | ||
79 | * decrease the reference count of the service layer. | ||
80 | */ | ||
81 | void caif_release_client(struct cflayer *client_layer); | ||
82 | |||
83 | /** | ||
71 | * connect_req_to_link_param - Translate configuration parameters | 84 | * connect_req_to_link_param - Translate configuration parameters |
72 | * from socket format to internal format. | 85 | * from socket format to internal format. |
73 | * @cnfg: Pointer to configuration handler | 86 | * @cnfg: Pointer to configuration handler |
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index 366082c5d435..9fc2fc20b884 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h | |||
@@ -87,13 +87,21 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | |||
87 | int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer); | 87 | int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer); |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * cfcnfg_del_adapt_layer - Deletes an adaptation layer from the CAIF stack. | 90 | * cfcnfg_disconn_adapt_layer - Disconnects an adaptation layer. |
91 | * | 91 | * |
92 | * @cnfg: Pointer to a CAIF configuration object, created by | 92 | * @cnfg: Pointer to a CAIF configuration object, created by |
93 | * cfcnfg_create(). | 93 | * cfcnfg_create(). |
94 | * @adap_layer: Adaptation layer to be removed. | 94 | * @adap_layer: Adaptation layer to be removed. |
95 | */ | 95 | */ |
96 | int cfcnfg_del_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer); | 96 | int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, |
97 | struct cflayer *adap_layer); | ||
98 | |||
99 | /** | ||
100 | * cfcnfg_release_adap_layer - Used by client to release the adaptation layer. | ||
101 | * | ||
102 | * @adap_layer: Adaptation layer. | ||
103 | */ | ||
104 | void cfcnfg_release_adap_layer(struct cflayer *adap_layer); | ||
97 | 105 | ||
98 | /** | 106 | /** |
99 | * cfcnfg_add_adaptation_layer - Add an adaptation layer to the CAIF stack. | 107 | * cfcnfg_add_adaptation_layer - Add an adaptation layer to the CAIF stack. |
@@ -102,14 +110,13 @@ int cfcnfg_del_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer); | |||
102 | * driver functionality is implemented. | 110 | * driver functionality is implemented. |
103 | * | 111 | * |
104 | * @cnfg: Pointer to a CAIF configuration object, created by | 112 | * @cnfg: Pointer to a CAIF configuration object, created by |
105 | * cfcnfg_create(). | 113 | * cfcnfg_create(). |
106 | * @param: Link setup parameters. | 114 | * @param: Link setup parameters. |
107 | * @adap_layer: Specify the adaptation layer; the receive and | 115 | * @adap_layer: Specify the adaptation layer; the receive and |
108 | * flow-control functions MUST be set in the structure. | 116 | * flow-control functions MUST be set in the structure. |
109 | * | 117 | * |
110 | */ | 118 | */ |
111 | int | 119 | int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, |
112 | cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, | ||
113 | struct cfctrl_link_param *param, | 120 | struct cfctrl_link_param *param, |
114 | struct cflayer *adap_layer); | 121 | struct cflayer *adap_layer); |
115 | 122 | ||
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index dee25b86caa0..997603f2bf4c 100644 --- a/include/net/caif/cfctrl.h +++ b/include/net/caif/cfctrl.h | |||
@@ -43,8 +43,7 @@ struct cfctrl_rsp { | |||
43 | void (*linksetup_rsp)(struct cflayer *layer, u8 linkid, | 43 | void (*linksetup_rsp)(struct cflayer *layer, u8 linkid, |
44 | enum cfctrl_srv serv, u8 phyid, | 44 | enum cfctrl_srv serv, u8 phyid, |
45 | struct cflayer *adapt_layer); | 45 | struct cflayer *adapt_layer); |
46 | void (*linkdestroy_rsp)(struct cflayer *layer, u8 linkid, | 46 | void (*linkdestroy_rsp)(struct cflayer *layer, u8 linkid); |
47 | struct cflayer *client_layer); | ||
48 | void (*linkerror_ind)(void); | 47 | void (*linkerror_ind)(void); |
49 | void (*enum_rsp)(void); | 48 | void (*enum_rsp)(void); |
50 | void (*sleep_rsp)(void); | 49 | void (*sleep_rsp)(void); |
@@ -117,7 +116,7 @@ struct cfctrl { | |||
117 | }; | 116 | }; |
118 | 117 | ||
119 | void cfctrl_enum_req(struct cflayer *cfctrl, u8 physlinkid); | 118 | void cfctrl_enum_req(struct cflayer *cfctrl, u8 physlinkid); |
120 | void cfctrl_linkup_request(struct cflayer *cfctrl, | 119 | int cfctrl_linkup_request(struct cflayer *cfctrl, |
121 | struct cfctrl_link_param *param, | 120 | struct cfctrl_link_param *param, |
122 | struct cflayer *user_layer); | 121 | struct cflayer *user_layer); |
123 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, | 122 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, |
@@ -135,4 +134,6 @@ void cfctrl_insert_req(struct cfctrl *ctrl, | |||
135 | struct cfctrl_request_info *req); | 134 | struct cfctrl_request_info *req); |
136 | struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, | 135 | struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, |
137 | struct cfctrl_request_info *req); | 136 | struct cfctrl_request_info *req); |
137 | void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer); | ||
138 | |||
138 | #endif /* CFCTRL_H_ */ | 139 | #endif /* CFCTRL_H_ */ |
diff --git a/include/net/caif/cfsrvl.h b/include/net/caif/cfsrvl.h index b2a12db20cd2..2dc9eb193ecf 100644 --- a/include/net/caif/cfsrvl.h +++ b/include/net/caif/cfsrvl.h | |||
@@ -9,14 +9,18 @@ | |||
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/stddef.h> | 10 | #include <linux/stddef.h> |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/kref.h> | ||
13 | |||
12 | struct cfsrvl { | 14 | struct cfsrvl { |
13 | struct cflayer layer; | 15 | struct cflayer layer; |
14 | bool open; | 16 | bool open; |
15 | bool phy_flow_on; | 17 | bool phy_flow_on; |
16 | bool modem_flow_on; | 18 | bool modem_flow_on; |
17 | struct dev_info dev_info; | 19 | struct dev_info dev_info; |
20 | struct kref ref; | ||
18 | }; | 21 | }; |
19 | 22 | ||
23 | void cfsrvl_release(struct kref *kref); | ||
20 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); | 24 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); |
21 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); | 25 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); |
22 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); | 26 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); |
@@ -31,4 +35,22 @@ void cfsrvl_init(struct cfsrvl *service, | |||
31 | bool cfsrvl_ready(struct cfsrvl *service, int *err); | 35 | bool cfsrvl_ready(struct cfsrvl *service, int *err); |
32 | u8 cfsrvl_getphyid(struct cflayer *layer); | 36 | u8 cfsrvl_getphyid(struct cflayer *layer); |
33 | 37 | ||
38 | static inline void cfsrvl_get(struct cflayer *layr) | ||
39 | { | ||
40 | struct cfsrvl *s; | ||
41 | if (layr == NULL) | ||
42 | return; | ||
43 | s = container_of(layr, struct cfsrvl, layer); | ||
44 | kref_get(&s->ref); | ||
45 | } | ||
46 | |||
47 | static inline void cfsrvl_put(struct cflayer *layr) | ||
48 | { | ||
49 | struct cfsrvl *s; | ||
50 | if (layr == NULL) | ||
51 | return; | ||
52 | s = container_of(layr, struct cfsrvl, layer); | ||
53 | kref_put(&s->ref, cfsrvl_release); | ||
54 | } | ||
55 | |||
34 | #endif /* CFSRVL_H_ */ | 56 | #endif /* CFSRVL_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 37cebd3aa0f7..7d10c0182f53 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -511,6 +511,7 @@ struct mpath_info { | |||
511 | * @basic_rates: basic rates in IEEE 802.11 format | 511 | * @basic_rates: basic rates in IEEE 802.11 format |
512 | * (or NULL for no change) | 512 | * (or NULL for no change) |
513 | * @basic_rates_len: number of basic rates | 513 | * @basic_rates_len: number of basic rates |
514 | * @ap_isolate: do not forward packets between connected stations | ||
514 | */ | 515 | */ |
515 | struct bss_parameters { | 516 | struct bss_parameters { |
516 | int use_cts_prot; | 517 | int use_cts_prot; |
@@ -518,6 +519,7 @@ struct bss_parameters { | |||
518 | int use_short_slot_time; | 519 | int use_short_slot_time; |
519 | u8 *basic_rates; | 520 | u8 *basic_rates; |
520 | u8 basic_rates_len; | 521 | u8 basic_rates_len; |
522 | int ap_isolate; | ||
521 | }; | 523 | }; |
522 | 524 | ||
523 | struct mesh_config { | 525 | struct mesh_config { |
@@ -1018,6 +1020,8 @@ struct cfg80211_pmksa { | |||
1018 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. | 1020 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. |
1019 | * @del_pmksa: Delete a cached PMKID. | 1021 | * @del_pmksa: Delete a cached PMKID. |
1020 | * @flush_pmksa: Flush all cached PMKIDs. | 1022 | * @flush_pmksa: Flush all cached PMKIDs. |
1023 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 | ||
1024 | * allows the driver to adjust the dynamic ps timeout value. | ||
1021 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | 1025 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. |
1022 | * | 1026 | * |
1023 | */ | 1027 | */ |
@@ -1643,7 +1647,7 @@ struct ieee80211_radiotap_iterator { | |||
1643 | const struct ieee80211_radiotap_namespace *current_namespace; | 1647 | const struct ieee80211_radiotap_namespace *current_namespace; |
1644 | 1648 | ||
1645 | unsigned char *_arg, *_next_ns_data; | 1649 | unsigned char *_arg, *_next_ns_data; |
1646 | uint32_t *_next_bitmap; | 1650 | __le32 *_next_bitmap; |
1647 | 1651 | ||
1648 | unsigned char *this_arg; | 1652 | unsigned char *this_arg; |
1649 | int this_arg_index; | 1653 | int this_arg_index; |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 52bd9e6c9141..e8923bc20f9f 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -104,7 +104,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
104 | return frh->table; | 104 | return frh->table; |
105 | } | 105 | } |
106 | 106 | ||
107 | extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *); | 107 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); |
108 | extern void fib_rules_unregister(struct fib_rules_ops *); | 108 | extern void fib_rules_unregister(struct fib_rules_ops *); |
109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
110 | 110 | ||
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index b487bc1b99ab..1653de515cee 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -102,7 +102,6 @@ struct rtable; | |||
102 | * @uc_ttl - Unicast TTL | 102 | * @uc_ttl - Unicast TTL |
103 | * @inet_sport - Source port | 103 | * @inet_sport - Source port |
104 | * @inet_id - ID counter for DF pkts | 104 | * @inet_id - ID counter for DF pkts |
105 | * @rxhash - flow hash received from netif layer | ||
106 | * @tos - TOS | 105 | * @tos - TOS |
107 | * @mc_ttl - Multicasting TTL | 106 | * @mc_ttl - Multicasting TTL |
108 | * @is_icsk - is this an inet_connection_sock? | 107 | * @is_icsk - is this an inet_connection_sock? |
@@ -126,9 +125,6 @@ struct inet_sock { | |||
126 | __u16 cmsg_flags; | 125 | __u16 cmsg_flags; |
127 | __be16 inet_sport; | 126 | __be16 inet_sport; |
128 | __u16 inet_id; | 127 | __u16 inet_id; |
129 | #ifdef CONFIG_RPS | ||
130 | __u32 rxhash; | ||
131 | #endif | ||
132 | 128 | ||
133 | struct ip_options *opt; | 129 | struct ip_options *opt; |
134 | __u8 tos; | 130 | __u8 tos; |
@@ -224,37 +220,4 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
224 | return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; | 220 | return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; |
225 | } | 221 | } |
226 | 222 | ||
227 | static inline void inet_rps_record_flow(const struct sock *sk) | ||
228 | { | ||
229 | #ifdef CONFIG_RPS | ||
230 | struct rps_sock_flow_table *sock_flow_table; | ||
231 | |||
232 | rcu_read_lock(); | ||
233 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
234 | rps_record_sock_flow(sock_flow_table, inet_sk(sk)->rxhash); | ||
235 | rcu_read_unlock(); | ||
236 | #endif | ||
237 | } | ||
238 | |||
239 | static inline void inet_rps_reset_flow(const struct sock *sk) | ||
240 | { | ||
241 | #ifdef CONFIG_RPS | ||
242 | struct rps_sock_flow_table *sock_flow_table; | ||
243 | |||
244 | rcu_read_lock(); | ||
245 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
246 | rps_reset_sock_flow(sock_flow_table, inet_sk(sk)->rxhash); | ||
247 | rcu_read_unlock(); | ||
248 | #endif | ||
249 | } | ||
250 | |||
251 | static inline void inet_rps_save_rxhash(const struct sock *sk, u32 rxhash) | ||
252 | { | ||
253 | #ifdef CONFIG_RPS | ||
254 | if (unlikely(inet_sk(sk)->rxhash != rxhash)) { | ||
255 | inet_rps_reset_flow(sk); | ||
256 | inet_sk(sk)->rxhash = rxhash; | ||
257 | } | ||
258 | #endif | ||
259 | } | ||
260 | #endif /* _INET_SOCK_H */ | 223 | #endif /* _INET_SOCK_H */ |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 79f67eae8a7e..a066fdd50da6 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -224,7 +224,9 @@ static inline | |||
224 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 224 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
225 | { | 225 | { |
226 | #ifdef CONFIG_NET_NS | 226 | #ifdef CONFIG_NET_NS |
227 | return rcu_dereference(twsk->tw_net); | 227 | return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */ |
228 | /* reference counting, */ | ||
229 | /* initialization, or RCU. */ | ||
228 | #else | 230 | #else |
229 | return &init_net; | 231 | return &init_net; |
230 | #endif | 232 | #endif |
diff --git a/include/net/ip.h b/include/net/ip.h index a84ceb692687..8149b77cea9b 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -393,6 +393,7 @@ extern int ip_options_rcv_srr(struct sk_buff *skb); | |||
393 | * Functions provided by ip_sockglue.c | 393 | * Functions provided by ip_sockglue.c |
394 | */ | 394 | */ |
395 | 395 | ||
396 | extern int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | ||
396 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 397 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); |
397 | extern int ip_cmsg_send(struct net *net, | 398 | extern int ip_cmsg_send(struct net *net, |
398 | struct msghdr *msg, struct ipcm_cookie *ipc); | 399 | struct msghdr *msg, struct ipcm_cookie *ipc); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index b1d8db90b214..eba5cc00325a 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -503,7 +503,8 @@ extern int ip6_append_data(struct sock *sk, | |||
503 | struct ipv6_txoptions *opt, | 503 | struct ipv6_txoptions *opt, |
504 | struct flowi *fl, | 504 | struct flowi *fl, |
505 | struct rt6_info *rt, | 505 | struct rt6_info *rt, |
506 | unsigned int flags); | 506 | unsigned int flags, |
507 | int dontfrag); | ||
507 | 508 | ||
508 | extern int ip6_push_pending_frames(struct sock *sk); | 509 | extern int ip6_push_pending_frames(struct sock *sk); |
509 | 510 | ||
@@ -577,9 +578,11 @@ extern int ip6_datagram_connect(struct sock *sk, | |||
577 | struct sockaddr *addr, int addr_len); | 578 | struct sockaddr *addr, int addr_len); |
578 | 579 | ||
579 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 580 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); |
581 | extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | ||
580 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 582 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
581 | u32 info, u8 *payload); | 583 | u32 info, u8 *payload); |
582 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); | 584 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); |
585 | extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu); | ||
583 | 586 | ||
584 | extern int inet6_release(struct socket *sock); | 587 | extern int inet6_release(struct socket *sock); |
585 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, | 588 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 344e5bf72062..54aa16b98b76 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -145,6 +145,7 @@ struct ieee80211_low_level_stats { | |||
145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be | 145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be |
146 | * enabled/disabled (beaconing modes) | 146 | * enabled/disabled (beaconing modes) |
147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed | 147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed |
148 | * @BSS_CHANGED_IBSS: IBSS join status changed | ||
148 | */ | 149 | */ |
149 | enum ieee80211_bss_change { | 150 | enum ieee80211_bss_change { |
150 | BSS_CHANGED_ASSOC = 1<<0, | 151 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -158,6 +159,7 @@ enum ieee80211_bss_change { | |||
158 | BSS_CHANGED_BEACON = 1<<8, | 159 | BSS_CHANGED_BEACON = 1<<8, |
159 | BSS_CHANGED_BEACON_ENABLED = 1<<9, | 160 | BSS_CHANGED_BEACON_ENABLED = 1<<9, |
160 | BSS_CHANGED_CQM = 1<<10, | 161 | BSS_CHANGED_CQM = 1<<10, |
162 | BSS_CHANGED_IBSS = 1<<11, | ||
161 | }; | 163 | }; |
162 | 164 | ||
163 | /** | 165 | /** |
@@ -167,6 +169,8 @@ enum ieee80211_bss_change { | |||
167 | * to that BSS) that can change during the lifetime of the BSS. | 169 | * to that BSS) that can change during the lifetime of the BSS. |
168 | * | 170 | * |
169 | * @assoc: association status | 171 | * @assoc: association status |
172 | * @ibss_joined: indicates whether this station is part of an IBSS | ||
173 | * or not | ||
170 | * @aid: association ID number, valid only when @assoc is true | 174 | * @aid: association ID number, valid only when @assoc is true |
171 | * @use_cts_prot: use CTS protection | 175 | * @use_cts_prot: use CTS protection |
172 | * @use_short_preamble: use 802.11b short preamble; | 176 | * @use_short_preamble: use 802.11b short preamble; |
@@ -194,7 +198,7 @@ enum ieee80211_bss_change { | |||
194 | struct ieee80211_bss_conf { | 198 | struct ieee80211_bss_conf { |
195 | const u8 *bssid; | 199 | const u8 *bssid; |
196 | /* association related data */ | 200 | /* association related data */ |
197 | bool assoc; | 201 | bool assoc, ibss_joined; |
198 | u16 aid; | 202 | u16 aid; |
199 | /* erp related data */ | 203 | /* erp related data */ |
200 | bool use_cts_prot; | 204 | bool use_cts_prot; |
@@ -274,6 +278,9 @@ struct ieee80211_bss_conf { | |||
274 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | 278 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 |
275 | * MLME command (internal to mac80211 to figure out whether to send TX | 279 | * MLME command (internal to mac80211 to figure out whether to send TX |
276 | * status to user space) | 280 | * status to user space) |
281 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | ||
282 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | ||
283 | * frame and selects the maximum number of streams that it can use. | ||
277 | */ | 284 | */ |
278 | enum mac80211_tx_control_flags { | 285 | enum mac80211_tx_control_flags { |
279 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 286 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
@@ -297,6 +304,9 @@ enum mac80211_tx_control_flags { | |||
297 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | 304 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), |
298 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), | 305 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), |
299 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 306 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
307 | IEEE80211_TX_CTL_LDPC = BIT(22), | ||
308 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | ||
309 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | ||
300 | }; | 310 | }; |
301 | 311 | ||
302 | /** | 312 | /** |
@@ -395,11 +405,11 @@ struct ieee80211_tx_rate { | |||
395 | * @status: union for status data | 405 | * @status: union for status data |
396 | * @driver_data: array of driver_data pointers | 406 | * @driver_data: array of driver_data pointers |
397 | * @ampdu_ack_len: number of acked aggregated frames. | 407 | * @ampdu_ack_len: number of acked aggregated frames. |
398 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 408 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
399 | * @ampdu_ack_map: block ack bit map for the aggregation. | 409 | * @ampdu_ack_map: block ack bit map for the aggregation. |
400 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 410 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
401 | * @ampdu_len: number of aggregated frames. | 411 | * @ampdu_len: number of aggregated frames. |
402 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 412 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
403 | * @ack_signal: signal strength of the ACK frame | 413 | * @ack_signal: signal strength of the ACK frame |
404 | */ | 414 | */ |
405 | struct ieee80211_tx_info { | 415 | struct ieee80211_tx_info { |
@@ -550,7 +560,6 @@ enum mac80211_rx_flags { | |||
550 | * @signal: signal strength when receiving this frame, either in dBm, in dB or | 560 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
551 | * unspecified depending on the hardware capabilities flags | 561 | * unspecified depending on the hardware capabilities flags |
552 | * @IEEE80211_HW_SIGNAL_* | 562 | * @IEEE80211_HW_SIGNAL_* |
553 | * @noise: noise when receiving this frame, in dBm (DEPRECATED). | ||
554 | * @antenna: antenna used | 563 | * @antenna: antenna used |
555 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 564 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
556 | * HT rates are use (RX_FLAG_HT) | 565 | * HT rates are use (RX_FLAG_HT) |
@@ -561,7 +570,6 @@ struct ieee80211_rx_status { | |||
561 | enum ieee80211_band band; | 570 | enum ieee80211_band band; |
562 | int freq; | 571 | int freq; |
563 | int signal; | 572 | int signal; |
564 | int noise __deprecated; | ||
565 | int antenna; | 573 | int antenna; |
566 | int rate_idx; | 574 | int rate_idx; |
567 | int flag; | 575 | int flag; |
@@ -610,6 +618,7 @@ enum ieee80211_conf_flags { | |||
610 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 618 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
611 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 619 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
612 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 620 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
621 | * @IEEE80211_CONF_CHANGE_QOS: Quality of service was enabled or disabled | ||
613 | */ | 622 | */ |
614 | enum ieee80211_conf_changed { | 623 | enum ieee80211_conf_changed { |
615 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 624 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
@@ -661,6 +670,9 @@ enum ieee80211_smps_mode { | |||
661 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the | 670 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the |
662 | * powersave documentation below. This variable is valid only when | 671 | * powersave documentation below. This variable is valid only when |
663 | * the CONF_PS flag is set. | 672 | * the CONF_PS flag is set. |
673 | * @dynamic_ps_forced_timeout: The dynamic powersave timeout (in ms) configured | ||
674 | * by cfg80211 (essentially, wext) If set, this value overrules the value | ||
675 | * chosen by mac80211 based on ps qos network latency. | ||
664 | * | 676 | * |
665 | * @power_level: requested transmit power (in dBm) | 677 | * @power_level: requested transmit power (in dBm) |
666 | * | 678 | * |
@@ -680,7 +692,7 @@ enum ieee80211_smps_mode { | |||
680 | */ | 692 | */ |
681 | struct ieee80211_conf { | 693 | struct ieee80211_conf { |
682 | u32 flags; | 694 | u32 flags; |
683 | int power_level, dynamic_ps_timeout; | 695 | int power_level, dynamic_ps_timeout, dynamic_ps_forced_timeout; |
684 | int max_sleep_period; | 696 | int max_sleep_period; |
685 | 697 | ||
686 | u16 listen_interval; | 698 | u16 listen_interval; |
@@ -791,6 +803,7 @@ struct ieee80211_key_conf { | |||
791 | u8 iv_len; | 803 | u8 iv_len; |
792 | u8 hw_key_idx; | 804 | u8 hw_key_idx; |
793 | u8 flags; | 805 | u8 flags; |
806 | u8 *ap_addr; | ||
794 | s8 keyidx; | 807 | s8 keyidx; |
795 | u8 keylen; | 808 | u8 keylen; |
796 | u8 key[0]; | 809 | u8 key[0]; |
@@ -919,10 +932,6 @@ enum ieee80211_tkip_key_type { | |||
919 | * one milliwatt. This is the preferred method since it is standardized | 932 | * one milliwatt. This is the preferred method since it is standardized |
920 | * between different devices. @max_signal does not need to be set. | 933 | * between different devices. @max_signal does not need to be set. |
921 | * | 934 | * |
922 | * @IEEE80211_HW_NOISE_DBM: | ||
923 | * Hardware can provide noise (radio interference) values in units dBm, | ||
924 | * decibel difference from one milliwatt. | ||
925 | * | ||
926 | * @IEEE80211_HW_SPECTRUM_MGMT: | 935 | * @IEEE80211_HW_SPECTRUM_MGMT: |
927 | * Hardware supports spectrum management defined in 802.11h | 936 | * Hardware supports spectrum management defined in 802.11h |
928 | * Measurement, Channel Switch, Quieting, TPC | 937 | * Measurement, Channel Switch, Quieting, TPC |
@@ -986,7 +995,7 @@ enum ieee80211_hw_flags { | |||
986 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 995 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
987 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 996 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
988 | IEEE80211_HW_SIGNAL_DBM = 1<<6, | 997 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
989 | IEEE80211_HW_NOISE_DBM = 1<<7, | 998 | /* use this hole */ |
990 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, | 999 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
991 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, | 1000 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
992 | IEEE80211_HW_SUPPORTS_PS = 1<<10, | 1001 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
@@ -1646,7 +1655,7 @@ struct ieee80211_ops { | |||
1646 | struct ieee80211_key_conf *conf, | 1655 | struct ieee80211_key_conf *conf, |
1647 | struct ieee80211_sta *sta, | 1656 | struct ieee80211_sta *sta, |
1648 | u32 iv32, u16 *phase1key); | 1657 | u32 iv32, u16 *phase1key); |
1649 | int (*hw_scan)(struct ieee80211_hw *hw, | 1658 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1650 | struct cfg80211_scan_request *req); | 1659 | struct cfg80211_scan_request *req); |
1651 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1660 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
1652 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | 1661 | void (*sw_scan_complete)(struct ieee80211_hw *hw); |
@@ -1671,7 +1680,8 @@ struct ieee80211_ops { | |||
1671 | struct ieee80211_vif *vif, | 1680 | struct ieee80211_vif *vif, |
1672 | enum ieee80211_ampdu_mlme_action action, | 1681 | enum ieee80211_ampdu_mlme_action action, |
1673 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1682 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1674 | 1683 | int (*get_survey)(struct ieee80211_hw *hw, int idx, | |
1684 | struct survey_info *survey); | ||
1675 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1685 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
1676 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); | 1686 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); |
1677 | #ifdef CONFIG_NL80211_TESTMODE | 1687 | #ifdef CONFIG_NL80211_TESTMODE |
diff --git a/include/net/mld.h b/include/net/mld.h new file mode 100644 index 000000000000..467143cd4e2f --- /dev/null +++ b/include/net/mld.h | |||
@@ -0,0 +1,75 @@ | |||
1 | #ifndef LINUX_MLD_H | ||
2 | #define LINUX_MLD_H | ||
3 | |||
4 | #include <linux/in6.h> | ||
5 | #include <linux/icmpv6.h> | ||
6 | |||
7 | /* MLDv1 Query/Report/Done */ | ||
8 | struct mld_msg { | ||
9 | struct icmp6hdr mld_hdr; | ||
10 | struct in6_addr mld_mca; | ||
11 | }; | ||
12 | |||
13 | #define mld_type mld_hdr.icmp6_type | ||
14 | #define mld_code mld_hdr.icmp6_code | ||
15 | #define mld_cksum mld_hdr.icmp6_cksum | ||
16 | #define mld_maxdelay mld_hdr.icmp6_maxdelay | ||
17 | #define mld_reserved mld_hdr.icmp6_dataun.un_data16[1] | ||
18 | |||
19 | /* Multicast Listener Discovery version 2 headers */ | ||
20 | /* MLDv2 Report */ | ||
21 | struct mld2_grec { | ||
22 | __u8 grec_type; | ||
23 | __u8 grec_auxwords; | ||
24 | __be16 grec_nsrcs; | ||
25 | struct in6_addr grec_mca; | ||
26 | struct in6_addr grec_src[0]; | ||
27 | }; | ||
28 | |||
29 | struct mld2_report { | ||
30 | struct icmp6hdr mld2r_hdr; | ||
31 | struct mld2_grec mld2r_grec[0]; | ||
32 | }; | ||
33 | |||
34 | #define mld2r_type mld2r_hdr.icmp6_type | ||
35 | #define mld2r_resv1 mld2r_hdr.icmp6_code | ||
36 | #define mld2r_cksum mld2r_hdr.icmp6_cksum | ||
37 | #define mld2r_resv2 mld2r_hdr.icmp6_dataun.un_data16[0] | ||
38 | #define mld2r_ngrec mld2r_hdr.icmp6_dataun.un_data16[1] | ||
39 | |||
40 | /* MLDv2 Query */ | ||
41 | struct mld2_query { | ||
42 | struct icmp6hdr mld2q_hdr; | ||
43 | struct in6_addr mld2q_mca; | ||
44 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
45 | __u8 mld2q_qrv:3, | ||
46 | mld2q_suppress:1, | ||
47 | mld2q_resv2:4; | ||
48 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
49 | __u8 mld2q_resv2:4, | ||
50 | mld2q_suppress:1, | ||
51 | mld2q_qrv:3; | ||
52 | #else | ||
53 | #error "Please fix <asm/byteorder.h>" | ||
54 | #endif | ||
55 | __u8 mld2q_qqic; | ||
56 | __be16 mld2q_nsrcs; | ||
57 | struct in6_addr mld2q_srcs[0]; | ||
58 | }; | ||
59 | |||
60 | #define mld2q_type mld2q_hdr.icmp6_type | ||
61 | #define mld2q_code mld2q_hdr.icmp6_code | ||
62 | #define mld2q_cksum mld2q_hdr.icmp6_cksum | ||
63 | #define mld2q_mrc mld2q_hdr.icmp6_maxdelay | ||
64 | #define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1] | ||
65 | |||
66 | /* Max Response Code */ | ||
67 | #define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) | ||
68 | #define MLDV2_EXP(thresh, nbmant, nbexp, value) \ | ||
69 | ((value) < (thresh) ? (value) : \ | ||
70 | ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \ | ||
71 | (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp)))) | ||
72 | |||
73 | #define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) | ||
74 | |||
75 | #endif | ||
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index ff4982ab84b6..81a31c0db3e7 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -14,11 +14,8 @@ | |||
14 | * The rules are simple: | 14 | * The rules are simple: |
15 | * 1. set pernet_operations->id. After register_pernet_device you | 15 | * 1. set pernet_operations->id. After register_pernet_device you |
16 | * will have the id of your private pointer. | 16 | * will have the id of your private pointer. |
17 | * 2. Either set pernet_operations->size (to have the code allocate and | 17 | * 2. set pernet_operations->size to have the code allocate and free |
18 | * free a private structure pointed to from struct net ) or | 18 | * a private structure pointed to from struct net. |
19 | * call net_assign_generic() to put the private data on the struct | ||
20 | * net (most preferably this should be done in the ->init callback | ||
21 | * of the ops registered); | ||
22 | * 3. do not change this pointer while the net is alive; | 19 | * 3. do not change this pointer while the net is alive; |
23 | * 4. do not try to have any private reference on the net_generic object. | 20 | * 4. do not try to have any private reference on the net_generic object. |
24 | * | 21 | * |
@@ -46,6 +43,4 @@ static inline void *net_generic(struct net *net, int id) | |||
46 | 43 | ||
47 | return ptr; | 44 | return ptr; |
48 | } | 45 | } |
49 | |||
50 | extern int net_assign_generic(struct net *net, int id, void *data); | ||
51 | #endif | 46 | #endif |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index ae07feec6446..d68c3f121774 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -55,7 +55,6 @@ struct netns_ipv4 { | |||
55 | int sysctl_rt_cache_rebuild_count; | 55 | int sysctl_rt_cache_rebuild_count; |
56 | int current_rt_cache_rebuild_count; | 56 | int current_rt_cache_rebuild_count; |
57 | 57 | ||
58 | struct timer_list rt_secret_timer; | ||
59 | atomic_t rt_genid; | 58 | atomic_t rt_genid; |
60 | 59 | ||
61 | #ifdef CONFIG_IP_MROUTE | 60 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 8be5135ff7aa..2c55a7ea20af 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -107,6 +107,7 @@ typedef enum { | |||
107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ | 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ |
108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ | 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ |
109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ | 109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ |
110 | SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ | ||
110 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
111 | } sctp_verb_t; | 112 | } sctp_verb_t; |
112 | 113 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 59151557406c..65946bc43d00 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | |||
128 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); | 128 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); |
129 | int sctp_inet_listen(struct socket *sock, int backlog); | 129 | int sctp_inet_listen(struct socket *sock, int backlog); |
130 | void sctp_write_space(struct sock *sk); | 130 | void sctp_write_space(struct sock *sk); |
131 | void sctp_data_ready(struct sock *sk, int len); | ||
131 | unsigned int sctp_poll(struct file *file, struct socket *sock, | 132 | unsigned int sctp_poll(struct file *file, struct socket *sock, |
132 | poll_table *wait); | 133 | poll_table *wait); |
133 | void sctp_sock_rfree(struct sk_buff *skb); | 134 | void sctp_sock_rfree(struct sk_buff *skb); |
@@ -546,7 +547,7 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\ | |||
546 | #define WORD_ROUND(s) (((s)+3)&~3) | 547 | #define WORD_ROUND(s) (((s)+3)&~3) |
547 | 548 | ||
548 | /* Make a new instance of type. */ | 549 | /* Make a new instance of type. */ |
549 | #define t_new(type, flags) (type *)kmalloc(sizeof(type), flags) | 550 | #define t_new(type, flags) (type *)kzalloc(sizeof(type), flags) |
550 | 551 | ||
551 | /* Compare two timevals. */ | 552 | /* Compare two timevals. */ |
552 | #define tv_lt(s, t) \ | 553 | #define tv_lt(s, t) \ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 851c813adb3a..273a8bb683e3 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -437,7 +437,7 @@ sctp_vtag_verify_either(const struct sctp_chunk *chunk, | |||
437 | */ | 437 | */ |
438 | if ((!sctp_test_T_bit(chunk) && | 438 | if ((!sctp_test_T_bit(chunk) && |
439 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) || | 439 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) || |
440 | (sctp_test_T_bit(chunk) && | 440 | (sctp_test_T_bit(chunk) && asoc->c.peer_vtag && |
441 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) { | 441 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) { |
442 | return 1; | 442 | return 1; |
443 | } | 443 | } |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ff3017744711..43257b903c82 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -643,17 +643,15 @@ struct sctp_pf { | |||
643 | struct sctp_datamsg { | 643 | struct sctp_datamsg { |
644 | /* Chunks waiting to be submitted to lower layer. */ | 644 | /* Chunks waiting to be submitted to lower layer. */ |
645 | struct list_head chunks; | 645 | struct list_head chunks; |
646 | /* Chunks that have been transmitted. */ | ||
647 | size_t msg_size; | ||
648 | /* Reference counting. */ | 646 | /* Reference counting. */ |
649 | atomic_t refcnt; | 647 | atomic_t refcnt; |
650 | /* When is this message no longer interesting to the peer? */ | 648 | /* When is this message no longer interesting to the peer? */ |
651 | unsigned long expires_at; | 649 | unsigned long expires_at; |
652 | /* Did the messenge fail to send? */ | 650 | /* Did the messenge fail to send? */ |
653 | int send_error; | 651 | int send_error; |
654 | char send_failed; | 652 | u8 send_failed:1, |
655 | /* Control whether chunks from this message can be abandoned. */ | 653 | can_abandon:1, /* can chunks from this message can be abandoned. */ |
656 | char can_abandon; | 654 | can_delay; /* should this message be Nagle delayed */ |
657 | }; | 655 | }; |
658 | 656 | ||
659 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, | 657 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, |
@@ -757,7 +755,6 @@ struct sctp_chunk { | |||
757 | #define SCTP_NEED_FRTX 0x1 | 755 | #define SCTP_NEED_FRTX 0x1 |
758 | #define SCTP_DONT_FRTX 0x2 | 756 | #define SCTP_DONT_FRTX 0x2 |
759 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 757 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
760 | resent:1, /* Has this chunk ever been resent. */ | ||
761 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 758 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
762 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 759 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
763 | singleton:1, /* Only chunk in the packet? */ | 760 | singleton:1, /* Only chunk in the packet? */ |
@@ -778,6 +775,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, | |||
778 | struct iovec *data); | 775 | struct iovec *data); |
779 | void sctp_chunk_free(struct sctp_chunk *); | 776 | void sctp_chunk_free(struct sctp_chunk *); |
780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); | 777 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); |
778 | void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); | ||
781 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, | 779 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, |
782 | const struct sctp_association *, | 780 | const struct sctp_association *, |
783 | struct sock *); | 781 | struct sock *); |
@@ -878,7 +876,30 @@ struct sctp_transport { | |||
878 | 876 | ||
879 | /* Reference counting. */ | 877 | /* Reference counting. */ |
880 | atomic_t refcnt; | 878 | atomic_t refcnt; |
881 | int dead; | 879 | int dead:1, |
880 | /* RTO-Pending : A flag used to track if one of the DATA | ||
881 | * chunks sent to this address is currently being | ||
882 | * used to compute a RTT. If this flag is 0, | ||
883 | * the next DATA chunk sent to this destination | ||
884 | * should be used to compute a RTT and this flag | ||
885 | * should be set. Every time the RTT | ||
886 | * calculation completes (i.e. the DATA chunk | ||
887 | * is SACK'd) clear this flag. | ||
888 | */ | ||
889 | rto_pending:1, | ||
890 | |||
891 | /* | ||
892 | * hb_sent : a flag that signals that we have a pending | ||
893 | * heartbeat. | ||
894 | */ | ||
895 | hb_sent:1, | ||
896 | |||
897 | /* Is the Path MTU update pending on this tranport */ | ||
898 | pmtu_pending:1, | ||
899 | |||
900 | /* Is this structure kfree()able? */ | ||
901 | malloced:1; | ||
902 | |||
882 | 903 | ||
883 | /* This is the peer's IP address and port. */ | 904 | /* This is the peer's IP address and port. */ |
884 | union sctp_addr ipaddr; | 905 | union sctp_addr ipaddr; |
@@ -908,22 +929,6 @@ struct sctp_transport { | |||
908 | /* SRTT : The current smoothed round trip time. */ | 929 | /* SRTT : The current smoothed round trip time. */ |
909 | __u32 srtt; | 930 | __u32 srtt; |
910 | 931 | ||
911 | /* RTO-Pending : A flag used to track if one of the DATA | ||
912 | * chunks sent to this address is currently being | ||
913 | * used to compute a RTT. If this flag is 0, | ||
914 | * the next DATA chunk sent to this destination | ||
915 | * should be used to compute a RTT and this flag | ||
916 | * should be set. Every time the RTT | ||
917 | * calculation completes (i.e. the DATA chunk | ||
918 | * is SACK'd) clear this flag. | ||
919 | * hb_sent : a flag that signals that we have a pending heartbeat. | ||
920 | */ | ||
921 | __u8 rto_pending; | ||
922 | __u8 hb_sent; | ||
923 | |||
924 | /* Flag to track the current fast recovery state */ | ||
925 | __u8 fast_recovery; | ||
926 | |||
927 | /* | 932 | /* |
928 | * These are the congestion stats. | 933 | * These are the congestion stats. |
929 | */ | 934 | */ |
@@ -943,9 +948,6 @@ struct sctp_transport { | |||
943 | 948 | ||
944 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ | 949 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ |
945 | 950 | ||
946 | /* TSN marking the fast recovery exit point */ | ||
947 | __u32 fast_recovery_exit; | ||
948 | |||
949 | /* Destination */ | 951 | /* Destination */ |
950 | struct dst_entry *dst; | 952 | struct dst_entry *dst; |
951 | /* Source address. */ | 953 | /* Source address. */ |
@@ -976,9 +978,6 @@ struct sctp_transport { | |||
976 | */ | 978 | */ |
977 | __u16 pathmaxrxt; | 979 | __u16 pathmaxrxt; |
978 | 980 | ||
979 | /* is the Path MTU update pending on this tranport */ | ||
980 | __u8 pmtu_pending; | ||
981 | |||
982 | /* PMTU : The current known path MTU. */ | 981 | /* PMTU : The current known path MTU. */ |
983 | __u32 pathmtu; | 982 | __u32 pathmtu; |
984 | 983 | ||
@@ -1022,8 +1021,6 @@ struct sctp_transport { | |||
1022 | /* This is the list of transports that have chunks to send. */ | 1021 | /* This is the list of transports that have chunks to send. */ |
1023 | struct list_head send_ready; | 1022 | struct list_head send_ready; |
1024 | 1023 | ||
1025 | int malloced; /* Is this structure kfree()able? */ | ||
1026 | |||
1027 | /* State information saved for SFR_CACC algorithm. The key | 1024 | /* State information saved for SFR_CACC algorithm. The key |
1028 | * idea in SFR_CACC is to maintain state at the sender on a | 1025 | * idea in SFR_CACC is to maintain state at the sender on a |
1029 | * per-destination basis when a changeover happens. | 1026 | * per-destination basis when a changeover happens. |
@@ -1065,7 +1062,7 @@ void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | |||
1065 | struct sctp_sock *); | 1062 | struct sctp_sock *); |
1066 | void sctp_transport_pmtu(struct sctp_transport *); | 1063 | void sctp_transport_pmtu(struct sctp_transport *); |
1067 | void sctp_transport_free(struct sctp_transport *); | 1064 | void sctp_transport_free(struct sctp_transport *); |
1068 | void sctp_transport_reset_timers(struct sctp_transport *, int); | 1065 | void sctp_transport_reset_timers(struct sctp_transport *); |
1069 | void sctp_transport_hold(struct sctp_transport *); | 1066 | void sctp_transport_hold(struct sctp_transport *); |
1070 | void sctp_transport_put(struct sctp_transport *); | 1067 | void sctp_transport_put(struct sctp_transport *); |
1071 | void sctp_transport_update_rto(struct sctp_transport *, __u32); | 1068 | void sctp_transport_update_rto(struct sctp_transport *, __u32); |
@@ -1719,6 +1716,12 @@ struct sctp_association { | |||
1719 | /* Highest TSN that is acknowledged by incoming SACKs. */ | 1716 | /* Highest TSN that is acknowledged by incoming SACKs. */ |
1720 | __u32 highest_sacked; | 1717 | __u32 highest_sacked; |
1721 | 1718 | ||
1719 | /* TSN marking the fast recovery exit point */ | ||
1720 | __u32 fast_recovery_exit; | ||
1721 | |||
1722 | /* Flag to track the current fast recovery state */ | ||
1723 | __u8 fast_recovery; | ||
1724 | |||
1722 | /* The number of unacknowledged data chunks. Reported through | 1725 | /* The number of unacknowledged data chunks. Reported through |
1723 | * the SCTP_STATUS sockopt. | 1726 | * the SCTP_STATUS sockopt. |
1724 | */ | 1727 | */ |
diff --git a/include/net/snmp.h b/include/net/snmp.h index 884fdbb74b23..92456f1035f5 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -133,6 +133,8 @@ struct linux_xfrm_mib { | |||
133 | __this_cpu_add(mib[0]->mibs[field], addend) | 133 | __this_cpu_add(mib[0]->mibs[field], addend) |
134 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ | 134 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ |
135 | this_cpu_add(mib[1]->mibs[field], addend) | 135 | this_cpu_add(mib[1]->mibs[field], addend) |
136 | #define SNMP_ADD_STATS(mib, field, addend) \ | ||
137 | this_cpu_add(mib[0]->mibs[field], addend) | ||
136 | /* | 138 | /* |
137 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" | 139 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" |
138 | * to make @ptr a non-percpu pointer. | 140 | * to make @ptr a non-percpu pointer. |
diff --git a/include/net/sock.h b/include/net/sock.h index 56df440a950b..328e03f47dd1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -74,7 +74,7 @@ | |||
74 | printk(KERN_DEBUG msg); } while (0) | 74 | printk(KERN_DEBUG msg); } while (0) |
75 | #else | 75 | #else |
76 | /* Validate arguments and do nothing */ | 76 | /* Validate arguments and do nothing */ |
77 | static void inline int __attribute__ ((format (printf, 2, 3))) | 77 | static inline void __attribute__ ((format (printf, 2, 3))) |
78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) |
79 | { | 79 | { |
80 | } | 80 | } |
@@ -159,7 +159,7 @@ struct sock_common { | |||
159 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings | 159 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings |
160 | * @sk_lock: synchronizer | 160 | * @sk_lock: synchronizer |
161 | * @sk_rcvbuf: size of receive buffer in bytes | 161 | * @sk_rcvbuf: size of receive buffer in bytes |
162 | * @sk_sleep: sock wait queue | 162 | * @sk_wq: sock wait queue and async head |
163 | * @sk_dst_cache: destination cache | 163 | * @sk_dst_cache: destination cache |
164 | * @sk_dst_lock: destination cache lock | 164 | * @sk_dst_lock: destination cache lock |
165 | * @sk_policy: flow policy | 165 | * @sk_policy: flow policy |
@@ -198,6 +198,7 @@ struct sock_common { | |||
198 | * @sk_rcvlowat: %SO_RCVLOWAT setting | 198 | * @sk_rcvlowat: %SO_RCVLOWAT setting |
199 | * @sk_rcvtimeo: %SO_RCVTIMEO setting | 199 | * @sk_rcvtimeo: %SO_RCVTIMEO setting |
200 | * @sk_sndtimeo: %SO_SNDTIMEO setting | 200 | * @sk_sndtimeo: %SO_SNDTIMEO setting |
201 | * @sk_rxhash: flow hash received from netif layer | ||
201 | * @sk_filter: socket filtering instructions | 202 | * @sk_filter: socket filtering instructions |
202 | * @sk_protinfo: private area, net family specific, when not using slab | 203 | * @sk_protinfo: private area, net family specific, when not using slab |
203 | * @sk_timer: sock cleanup timer | 204 | * @sk_timer: sock cleanup timer |
@@ -255,9 +256,8 @@ struct sock { | |||
255 | struct sk_buff *head; | 256 | struct sk_buff *head; |
256 | struct sk_buff *tail; | 257 | struct sk_buff *tail; |
257 | int len; | 258 | int len; |
258 | int limit; | ||
259 | } sk_backlog; | 259 | } sk_backlog; |
260 | wait_queue_head_t *sk_sleep; | 260 | struct socket_wq *sk_wq; |
261 | struct dst_entry *sk_dst_cache; | 261 | struct dst_entry *sk_dst_cache; |
262 | #ifdef CONFIG_XFRM | 262 | #ifdef CONFIG_XFRM |
263 | struct xfrm_policy *sk_policy[2]; | 263 | struct xfrm_policy *sk_policy[2]; |
@@ -279,6 +279,9 @@ struct sock { | |||
279 | int sk_gso_type; | 279 | int sk_gso_type; |
280 | unsigned int sk_gso_max_size; | 280 | unsigned int sk_gso_max_size; |
281 | int sk_rcvlowat; | 281 | int sk_rcvlowat; |
282 | #ifdef CONFIG_RPS | ||
283 | __u32 sk_rxhash; | ||
284 | #endif | ||
282 | unsigned long sk_flags; | 285 | unsigned long sk_flags; |
283 | unsigned long sk_lingertime; | 286 | unsigned long sk_lingertime; |
284 | struct sk_buff_head sk_error_queue; | 287 | struct sk_buff_head sk_error_queue; |
@@ -604,10 +607,20 @@ static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) | |||
604 | skb->next = NULL; | 607 | skb->next = NULL; |
605 | } | 608 | } |
606 | 609 | ||
610 | /* | ||
611 | * Take into account size of receive queue and backlog queue | ||
612 | */ | ||
613 | static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb) | ||
614 | { | ||
615 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); | ||
616 | |||
617 | return qsize + skb->truesize > sk->sk_rcvbuf; | ||
618 | } | ||
619 | |||
607 | /* The per-socket spinlock must be held here. */ | 620 | /* The per-socket spinlock must be held here. */ |
608 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb) | 621 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb) |
609 | { | 622 | { |
610 | if (sk->sk_backlog.len >= max(sk->sk_backlog.limit, sk->sk_rcvbuf << 1)) | 623 | if (sk_rcvqueues_full(sk, skb)) |
611 | return -ENOBUFS; | 624 | return -ENOBUFS; |
612 | 625 | ||
613 | __sk_add_backlog(sk, skb); | 626 | __sk_add_backlog(sk, skb); |
@@ -620,6 +633,40 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
620 | return sk->sk_backlog_rcv(sk, skb); | 633 | return sk->sk_backlog_rcv(sk, skb); |
621 | } | 634 | } |
622 | 635 | ||
636 | static inline void sock_rps_record_flow(const struct sock *sk) | ||
637 | { | ||
638 | #ifdef CONFIG_RPS | ||
639 | struct rps_sock_flow_table *sock_flow_table; | ||
640 | |||
641 | rcu_read_lock(); | ||
642 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
643 | rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); | ||
644 | rcu_read_unlock(); | ||
645 | #endif | ||
646 | } | ||
647 | |||
648 | static inline void sock_rps_reset_flow(const struct sock *sk) | ||
649 | { | ||
650 | #ifdef CONFIG_RPS | ||
651 | struct rps_sock_flow_table *sock_flow_table; | ||
652 | |||
653 | rcu_read_lock(); | ||
654 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
655 | rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); | ||
656 | rcu_read_unlock(); | ||
657 | #endif | ||
658 | } | ||
659 | |||
660 | static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) | ||
661 | { | ||
662 | #ifdef CONFIG_RPS | ||
663 | if (unlikely(sk->sk_rxhash != rxhash)) { | ||
664 | sock_rps_reset_flow(sk); | ||
665 | sk->sk_rxhash = rxhash; | ||
666 | } | ||
667 | #endif | ||
668 | } | ||
669 | |||
623 | #define sk_wait_event(__sk, __timeo, __condition) \ | 670 | #define sk_wait_event(__sk, __timeo, __condition) \ |
624 | ({ int __rc; \ | 671 | ({ int __rc; \ |
625 | release_sock(__sk); \ | 672 | release_sock(__sk); \ |
@@ -974,6 +1021,16 @@ extern void release_sock(struct sock *sk); | |||
974 | SINGLE_DEPTH_NESTING) | 1021 | SINGLE_DEPTH_NESTING) |
975 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 1022 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
976 | 1023 | ||
1024 | static inline void lock_sock_bh(struct sock *sk) | ||
1025 | { | ||
1026 | spin_lock_bh(&sk->sk_lock.slock); | ||
1027 | } | ||
1028 | |||
1029 | static inline void unlock_sock_bh(struct sock *sk) | ||
1030 | { | ||
1031 | spin_unlock_bh(&sk->sk_lock.slock); | ||
1032 | } | ||
1033 | |||
977 | extern struct sock *sk_alloc(struct net *net, int family, | 1034 | extern struct sock *sk_alloc(struct net *net, int family, |
978 | gfp_t priority, | 1035 | gfp_t priority, |
979 | struct proto *prot); | 1036 | struct proto *prot); |
@@ -1160,6 +1217,10 @@ static inline void sk_set_socket(struct sock *sk, struct socket *sock) | |||
1160 | sk->sk_socket = sock; | 1217 | sk->sk_socket = sock; |
1161 | } | 1218 | } |
1162 | 1219 | ||
1220 | static inline wait_queue_head_t *sk_sleep(struct sock *sk) | ||
1221 | { | ||
1222 | return &sk->sk_wq->wait; | ||
1223 | } | ||
1163 | /* Detach socket from process context. | 1224 | /* Detach socket from process context. |
1164 | * Announce socket dead, detach it from wait queue and inode. | 1225 | * Announce socket dead, detach it from wait queue and inode. |
1165 | * Note that parent inode held reference count on this struct sock, | 1226 | * Note that parent inode held reference count on this struct sock, |
@@ -1172,14 +1233,14 @@ static inline void sock_orphan(struct sock *sk) | |||
1172 | write_lock_bh(&sk->sk_callback_lock); | 1233 | write_lock_bh(&sk->sk_callback_lock); |
1173 | sock_set_flag(sk, SOCK_DEAD); | 1234 | sock_set_flag(sk, SOCK_DEAD); |
1174 | sk_set_socket(sk, NULL); | 1235 | sk_set_socket(sk, NULL); |
1175 | sk->sk_sleep = NULL; | 1236 | sk->sk_wq = NULL; |
1176 | write_unlock_bh(&sk->sk_callback_lock); | 1237 | write_unlock_bh(&sk->sk_callback_lock); |
1177 | } | 1238 | } |
1178 | 1239 | ||
1179 | static inline void sock_graft(struct sock *sk, struct socket *parent) | 1240 | static inline void sock_graft(struct sock *sk, struct socket *parent) |
1180 | { | 1241 | { |
1181 | write_lock_bh(&sk->sk_callback_lock); | 1242 | write_lock_bh(&sk->sk_callback_lock); |
1182 | sk->sk_sleep = &parent->wait; | 1243 | rcu_assign_pointer(sk->sk_wq, parent->wq); |
1183 | parent->sk = sk; | 1244 | parent->sk = sk; |
1184 | sk_set_socket(sk, parent); | 1245 | sk_set_socket(sk, parent); |
1185 | security_sock_graft(sk, parent); | 1246 | security_sock_graft(sk, parent); |
@@ -1193,7 +1254,8 @@ static inline struct dst_entry * | |||
1193 | __sk_dst_get(struct sock *sk) | 1254 | __sk_dst_get(struct sock *sk) |
1194 | { | 1255 | { |
1195 | return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || | 1256 | return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || |
1196 | sock_owned_by_user(sk)); | 1257 | sock_owned_by_user(sk) || |
1258 | lockdep_is_held(&sk->sk_lock.slock)); | ||
1197 | } | 1259 | } |
1198 | 1260 | ||
1199 | static inline struct dst_entry * | 1261 | static inline struct dst_entry * |
@@ -1231,8 +1293,11 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst) | |||
1231 | struct dst_entry *old_dst; | 1293 | struct dst_entry *old_dst; |
1232 | 1294 | ||
1233 | sk_tx_queue_clear(sk); | 1295 | sk_tx_queue_clear(sk); |
1234 | old_dst = rcu_dereference_check(sk->sk_dst_cache, | 1296 | /* |
1235 | lockdep_is_held(&sk->sk_dst_lock)); | 1297 | * This can be called while sk is owned by the caller only, |
1298 | * with no state that can be checked in a rcu_dereference_check() cond | ||
1299 | */ | ||
1300 | old_dst = rcu_dereference_raw(sk->sk_dst_cache); | ||
1236 | rcu_assign_pointer(sk->sk_dst_cache, dst); | 1301 | rcu_assign_pointer(sk->sk_dst_cache, dst); |
1237 | dst_release(old_dst); | 1302 | dst_release(old_dst); |
1238 | } | 1303 | } |
@@ -1327,12 +1392,12 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
1327 | } | 1392 | } |
1328 | 1393 | ||
1329 | /** | 1394 | /** |
1330 | * sk_has_sleeper - check if there are any waiting processes | 1395 | * wq_has_sleeper - check if there are any waiting processes |
1331 | * @sk: socket | 1396 | * @sk: struct socket_wq |
1332 | * | 1397 | * |
1333 | * Returns true if socket has waiting processes | 1398 | * Returns true if socket_wq has waiting processes |
1334 | * | 1399 | * |
1335 | * The purpose of the sk_has_sleeper and sock_poll_wait is to wrap the memory | 1400 | * The purpose of the wq_has_sleeper and sock_poll_wait is to wrap the memory |
1336 | * barrier call. They were added due to the race found within the tcp code. | 1401 | * barrier call. They were added due to the race found within the tcp code. |
1337 | * | 1402 | * |
1338 | * Consider following tcp code paths: | 1403 | * Consider following tcp code paths: |
@@ -1345,9 +1410,10 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
1345 | * ... ... | 1410 | * ... ... |
1346 | * tp->rcv_nxt check sock_def_readable | 1411 | * tp->rcv_nxt check sock_def_readable |
1347 | * ... { | 1412 | * ... { |
1348 | * schedule ... | 1413 | * schedule rcu_read_lock(); |
1349 | * if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | 1414 | * wq = rcu_dereference(sk->sk_wq); |
1350 | * wake_up_interruptible(sk->sk_sleep) | 1415 | * if (wq && waitqueue_active(&wq->wait)) |
1416 | * wake_up_interruptible(&wq->wait) | ||
1351 | * ... | 1417 | * ... |
1352 | * } | 1418 | * } |
1353 | * | 1419 | * |
@@ -1356,19 +1422,18 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
1356 | * could then endup calling schedule and sleep forever if there are no more | 1422 | * could then endup calling schedule and sleep forever if there are no more |
1357 | * data on the socket. | 1423 | * data on the socket. |
1358 | * | 1424 | * |
1359 | * The sk_has_sleeper is always called right after a call to read_lock, so we | ||
1360 | * can use smp_mb__after_lock barrier. | ||
1361 | */ | 1425 | */ |
1362 | static inline int sk_has_sleeper(struct sock *sk) | 1426 | static inline bool wq_has_sleeper(struct socket_wq *wq) |
1363 | { | 1427 | { |
1428 | |||
1364 | /* | 1429 | /* |
1365 | * We need to be sure we are in sync with the | 1430 | * We need to be sure we are in sync with the |
1366 | * add_wait_queue modifications to the wait queue. | 1431 | * add_wait_queue modifications to the wait queue. |
1367 | * | 1432 | * |
1368 | * This memory barrier is paired in the sock_poll_wait. | 1433 | * This memory barrier is paired in the sock_poll_wait. |
1369 | */ | 1434 | */ |
1370 | smp_mb__after_lock(); | 1435 | smp_mb(); |
1371 | return sk->sk_sleep && waitqueue_active(sk->sk_sleep); | 1436 | return wq && waitqueue_active(&wq->wait); |
1372 | } | 1437 | } |
1373 | 1438 | ||
1374 | /** | 1439 | /** |
@@ -1377,7 +1442,7 @@ static inline int sk_has_sleeper(struct sock *sk) | |||
1377 | * @wait_address: socket wait queue | 1442 | * @wait_address: socket wait queue |
1378 | * @p: poll_table | 1443 | * @p: poll_table |
1379 | * | 1444 | * |
1380 | * See the comments in the sk_has_sleeper function. | 1445 | * See the comments in the wq_has_sleeper function. |
1381 | */ | 1446 | */ |
1382 | static inline void sock_poll_wait(struct file *filp, | 1447 | static inline void sock_poll_wait(struct file *filp, |
1383 | wait_queue_head_t *wait_address, poll_table *p) | 1448 | wait_queue_head_t *wait_address, poll_table *p) |
@@ -1388,7 +1453,7 @@ static inline void sock_poll_wait(struct file *filp, | |||
1388 | * We need to be sure we are in sync with the | 1453 | * We need to be sure we are in sync with the |
1389 | * socket flags modification. | 1454 | * socket flags modification. |
1390 | * | 1455 | * |
1391 | * This memory barrier is paired in the sk_has_sleeper. | 1456 | * This memory barrier is paired in the wq_has_sleeper. |
1392 | */ | 1457 | */ |
1393 | smp_mb(); | 1458 | smp_mb(); |
1394 | } | 1459 | } |
@@ -1570,7 +1635,24 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1570 | sk->sk_stamp = kt; | 1635 | sk->sk_stamp = kt; |
1571 | } | 1636 | } |
1572 | 1637 | ||
1573 | extern void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb); | 1638 | extern void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, |
1639 | struct sk_buff *skb); | ||
1640 | |||
1641 | static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | ||
1642 | struct sk_buff *skb) | ||
1643 | { | ||
1644 | #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \ | ||
1645 | (1UL << SOCK_RCVTSTAMP) | \ | ||
1646 | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \ | ||
1647 | (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ | ||
1648 | (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ | ||
1649 | (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE)) | ||
1650 | |||
1651 | if (sk->sk_flags & FLAGS_TS_OR_DROPS) | ||
1652 | __sock_recv_ts_and_drops(msg, sk, skb); | ||
1653 | else | ||
1654 | sk->sk_stamp = skb->tstamp; | ||
1655 | } | ||
1574 | 1656 | ||
1575 | /** | 1657 | /** |
1576 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 1658 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 70c5159f4b36..fb5c66b2ab81 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -294,6 +294,7 @@ extern struct proto tcp_prot; | |||
294 | #define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) | 294 | #define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) |
295 | #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) | 295 | #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) |
296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) | 296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
297 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) | ||
297 | 298 | ||
298 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 299 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
299 | 300 | ||
@@ -939,7 +940,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
939 | 940 | ||
940 | tp->ucopy.memory = 0; | 941 | tp->ucopy.memory = 0; |
941 | } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) { | 942 | } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) { |
942 | wake_up_interruptible_sync_poll(sk->sk_sleep, | 943 | wake_up_interruptible_sync_poll(sk_sleep(sk), |
943 | POLLIN | POLLRDNORM | POLLRDBAND); | 944 | POLLIN | POLLRDNORM | POLLRDBAND); |
944 | if (!inet_csk_ack_scheduled(sk)) | 945 | if (!inet_csk_ack_scheduled(sk)) |
945 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, | 946 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, |
@@ -1032,6 +1033,14 @@ static inline int keepalive_probes(const struct tcp_sock *tp) | |||
1032 | return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; | 1033 | return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; |
1033 | } | 1034 | } |
1034 | 1035 | ||
1036 | static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) | ||
1037 | { | ||
1038 | const struct inet_connection_sock *icsk = &tp->inet_conn; | ||
1039 | |||
1040 | return min_t(u32, tcp_time_stamp - icsk->icsk_ack.lrcvtime, | ||
1041 | tcp_time_stamp - tp->rcv_tstamp); | ||
1042 | } | ||
1043 | |||
1035 | static inline int tcp_fin_time(const struct sock *sk) | 1044 | static inline int tcp_fin_time(const struct sock *sk) |
1036 | { | 1045 | { |
1037 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; | 1046 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index d65381cad0fc..42a0eb68b7b6 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -44,7 +44,8 @@ extern int datagram_send_ctl(struct net *net, | |||
44 | struct msghdr *msg, | 44 | struct msghdr *msg, |
45 | struct flowi *fl, | 45 | struct flowi *fl, |
46 | struct ipv6_txoptions *opt, | 46 | struct ipv6_txoptions *opt, |
47 | int *hlimit, int *tclass); | 47 | int *hlimit, int *tclass, |
48 | int *dontfrag); | ||
48 | 49 | ||
49 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) | 50 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) |
50 | 51 | ||
diff --git a/include/net/x25device.h b/include/net/x25device.h index 1415bcf93980..1fa08b49f1c2 100644 --- a/include/net/x25device.h +++ b/include/net/x25device.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/if_ether.h> | 4 | #include <linux/if_ether.h> |
5 | #include <linux/if_packet.h> | 5 | #include <linux/if_packet.h> |
6 | #include <linux/if_x25.h> | ||
6 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
7 | 8 | ||
8 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) | 9 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) |