diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ackvec.h | 21 | ||||
-rw-r--r-- | net/dccp/ccid.h | 18 | ||||
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.h | 8 | ||||
-rw-r--r-- | net/dccp/ccids/lib/packet_history.h | 25 | ||||
-rw-r--r-- | net/dccp/ccids/lib/tfrc.h | 22 | ||||
-rw-r--r-- | net/dccp/dccp.h | 186 | ||||
-rw-r--r-- | net/dccp/feat.h | 26 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 19 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 83 | ||||
-rw-r--r-- | net/dccp/ipv6.h | 2 | ||||
-rw-r--r-- | net/dccp/minisocks.c | 15 | ||||
-rw-r--r-- | net/dccp/output.c | 4 | ||||
-rw-r--r-- | net/dccp/proto.c | 4 |
13 files changed, 208 insertions, 225 deletions
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index a269aa7f7923..3284bfa988c0 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -101,16 +101,16 @@ struct dccp_ackvec_record { | |||
101 | u8 avr_ack_nonce:1; | 101 | u8 avr_ack_nonce:1; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | extern int dccp_ackvec_init(void); | 104 | int dccp_ackvec_init(void); |
105 | extern void dccp_ackvec_exit(void); | 105 | void dccp_ackvec_exit(void); |
106 | 106 | ||
107 | extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); | 107 | struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); |
108 | extern void dccp_ackvec_free(struct dccp_ackvec *av); | 108 | void dccp_ackvec_free(struct dccp_ackvec *av); |
109 | 109 | ||
110 | extern void dccp_ackvec_input(struct dccp_ackvec *av, struct sk_buff *skb); | 110 | void dccp_ackvec_input(struct dccp_ackvec *av, struct sk_buff *skb); |
111 | extern int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); | 111 | int dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum); |
112 | extern void dccp_ackvec_clear_state(struct dccp_ackvec *av, const u64 ackno); | 112 | void dccp_ackvec_clear_state(struct dccp_ackvec *av, const u64 ackno); |
113 | extern u16 dccp_ackvec_buflen(const struct dccp_ackvec *av); | 113 | u16 dccp_ackvec_buflen(const struct dccp_ackvec *av); |
114 | 114 | ||
115 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) | 115 | static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av) |
116 | { | 116 | { |
@@ -133,7 +133,6 @@ struct dccp_ackvec_parsed { | |||
133 | struct list_head node; | 133 | struct list_head node; |
134 | }; | 134 | }; |
135 | 135 | ||
136 | extern int dccp_ackvec_parsed_add(struct list_head *head, | 136 | int dccp_ackvec_parsed_add(struct list_head *head, u8 *vec, u8 len, u8 nonce); |
137 | u8 *vec, u8 len, u8 nonce); | 137 | void dccp_ackvec_parsed_cleanup(struct list_head *parsed_chunks); |
138 | extern void dccp_ackvec_parsed_cleanup(struct list_head *parsed_chunks); | ||
139 | #endif /* _ACKVEC_H */ | 138 | #endif /* _ACKVEC_H */ |
diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h index fb85d371a8de..6eb837a47b5c 100644 --- a/net/dccp/ccid.h +++ b/net/dccp/ccid.h | |||
@@ -93,8 +93,8 @@ extern struct ccid_operations ccid2_ops; | |||
93 | extern struct ccid_operations ccid3_ops; | 93 | extern struct ccid_operations ccid3_ops; |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | extern int ccid_initialize_builtins(void); | 96 | int ccid_initialize_builtins(void); |
97 | extern void ccid_cleanup_builtins(void); | 97 | void ccid_cleanup_builtins(void); |
98 | 98 | ||
99 | struct ccid { | 99 | struct ccid { |
100 | struct ccid_operations *ccid_ops; | 100 | struct ccid_operations *ccid_ops; |
@@ -106,12 +106,12 @@ static inline void *ccid_priv(const struct ccid *ccid) | |||
106 | return (void *)ccid->ccid_priv; | 106 | return (void *)ccid->ccid_priv; |
107 | } | 107 | } |
108 | 108 | ||
109 | extern bool ccid_support_check(u8 const *ccid_array, u8 array_len); | 109 | bool ccid_support_check(u8 const *ccid_array, u8 array_len); |
110 | extern int ccid_get_builtin_ccids(u8 **ccid_array, u8 *array_len); | 110 | int ccid_get_builtin_ccids(u8 **ccid_array, u8 *array_len); |
111 | extern int ccid_getsockopt_builtin_ccids(struct sock *sk, int len, | 111 | int ccid_getsockopt_builtin_ccids(struct sock *sk, int len, |
112 | char __user *, int __user *); | 112 | char __user *, int __user *); |
113 | 113 | ||
114 | extern struct ccid *ccid_new(const u8 id, struct sock *sk, bool rx); | 114 | struct ccid *ccid_new(const u8 id, struct sock *sk, bool rx); |
115 | 115 | ||
116 | static inline int ccid_get_current_rx_ccid(struct dccp_sock *dp) | 116 | static inline int ccid_get_current_rx_ccid(struct dccp_sock *dp) |
117 | { | 117 | { |
@@ -131,8 +131,8 @@ static inline int ccid_get_current_tx_ccid(struct dccp_sock *dp) | |||
131 | return ccid->ccid_ops->ccid_id; | 131 | return ccid->ccid_ops->ccid_id; |
132 | } | 132 | } |
133 | 133 | ||
134 | extern void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk); | 134 | void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk); |
135 | extern void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk); | 135 | void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk); |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Congestion control of queued data packets via CCID decision. | 138 | * Congestion control of queued data packets via CCID decision. |
diff --git a/net/dccp/ccids/lib/loss_interval.h b/net/dccp/ccids/lib/loss_interval.h index d1d2f5383b7d..57f631a86ccd 100644 --- a/net/dccp/ccids/lib/loss_interval.h +++ b/net/dccp/ccids/lib/loss_interval.h | |||
@@ -65,9 +65,9 @@ static inline u8 tfrc_lh_length(struct tfrc_loss_hist *lh) | |||
65 | 65 | ||
66 | struct tfrc_rx_hist; | 66 | struct tfrc_rx_hist; |
67 | 67 | ||
68 | extern int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *, | 68 | int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *, |
69 | u32 (*first_li)(struct sock *), struct sock *); | 69 | u32 (*first_li)(struct sock *), struct sock *); |
70 | extern u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *); | 70 | u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *); |
71 | extern void tfrc_lh_cleanup(struct tfrc_loss_hist *lh); | 71 | void tfrc_lh_cleanup(struct tfrc_loss_hist *lh); |
72 | 72 | ||
73 | #endif /* _DCCP_LI_HIST_ */ | 73 | #endif /* _DCCP_LI_HIST_ */ |
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h index 7ee4a9d9d335..ee362b0b630d 100644 --- a/net/dccp/ccids/lib/packet_history.h +++ b/net/dccp/ccids/lib/packet_history.h | |||
@@ -60,8 +60,8 @@ static inline struct tfrc_tx_hist_entry * | |||
60 | return head; | 60 | return head; |
61 | } | 61 | } |
62 | 62 | ||
63 | extern int tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno); | 63 | int tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno); |
64 | extern void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp); | 64 | void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp); |
65 | 65 | ||
66 | /* Subtraction a-b modulo-16, respects circular wrap-around */ | 66 | /* Subtraction a-b modulo-16, respects circular wrap-around */ |
67 | #define SUB16(a, b) (((a) + 16 - (b)) & 0xF) | 67 | #define SUB16(a, b) (((a) + 16 - (b)) & 0xF) |
@@ -139,20 +139,17 @@ static inline bool tfrc_rx_hist_loss_pending(const struct tfrc_rx_hist *h) | |||
139 | return h->loss_count > 0; | 139 | return h->loss_count > 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | extern void tfrc_rx_hist_add_packet(struct tfrc_rx_hist *h, | 142 | void tfrc_rx_hist_add_packet(struct tfrc_rx_hist *h, const struct sk_buff *skb, |
143 | const struct sk_buff *skb, const u64 ndp); | 143 | const u64 ndp); |
144 | 144 | ||
145 | extern int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb); | 145 | int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb); |
146 | 146 | ||
147 | struct tfrc_loss_hist; | 147 | struct tfrc_loss_hist; |
148 | extern int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, | 148 | int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, struct tfrc_loss_hist *lh, |
149 | struct tfrc_loss_hist *lh, | 149 | struct sk_buff *skb, const u64 ndp, |
150 | struct sk_buff *skb, const u64 ndp, | 150 | u32 (*first_li)(struct sock *sk), struct sock *sk); |
151 | u32 (*first_li)(struct sock *sk), | 151 | u32 tfrc_rx_hist_sample_rtt(struct tfrc_rx_hist *h, const struct sk_buff *skb); |
152 | struct sock *sk); | 152 | int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h); |
153 | extern u32 tfrc_rx_hist_sample_rtt(struct tfrc_rx_hist *h, | 153 | void tfrc_rx_hist_purge(struct tfrc_rx_hist *h); |
154 | const struct sk_buff *skb); | ||
155 | extern int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h); | ||
156 | extern void tfrc_rx_hist_purge(struct tfrc_rx_hist *h); | ||
157 | 154 | ||
158 | #endif /* _DCCP_PKT_HIST_ */ | 155 | #endif /* _DCCP_PKT_HIST_ */ |
diff --git a/net/dccp/ccids/lib/tfrc.h b/net/dccp/ccids/lib/tfrc.h index ed698c42a5fb..40ee7d62b652 100644 --- a/net/dccp/ccids/lib/tfrc.h +++ b/net/dccp/ccids/lib/tfrc.h | |||
@@ -55,21 +55,21 @@ static inline u32 tfrc_ewma(const u32 avg, const u32 newval, const u8 weight) | |||
55 | return avg ? (weight * avg + (10 - weight) * newval) / 10 : newval; | 55 | return avg ? (weight * avg + (10 - weight) * newval) / 10 : newval; |
56 | } | 56 | } |
57 | 57 | ||
58 | extern u32 tfrc_calc_x(u16 s, u32 R, u32 p); | 58 | u32 tfrc_calc_x(u16 s, u32 R, u32 p); |
59 | extern u32 tfrc_calc_x_reverse_lookup(u32 fvalue); | 59 | u32 tfrc_calc_x_reverse_lookup(u32 fvalue); |
60 | extern u32 tfrc_invert_loss_event_rate(u32 loss_event_rate); | 60 | u32 tfrc_invert_loss_event_rate(u32 loss_event_rate); |
61 | 61 | ||
62 | extern int tfrc_tx_packet_history_init(void); | 62 | int tfrc_tx_packet_history_init(void); |
63 | extern void tfrc_tx_packet_history_exit(void); | 63 | void tfrc_tx_packet_history_exit(void); |
64 | extern int tfrc_rx_packet_history_init(void); | 64 | int tfrc_rx_packet_history_init(void); |
65 | extern void tfrc_rx_packet_history_exit(void); | 65 | void tfrc_rx_packet_history_exit(void); |
66 | 66 | ||
67 | extern int tfrc_li_init(void); | 67 | int tfrc_li_init(void); |
68 | extern void tfrc_li_exit(void); | 68 | void tfrc_li_exit(void); |
69 | 69 | ||
70 | #ifdef CONFIG_IP_DCCP_TFRC_LIB | 70 | #ifdef CONFIG_IP_DCCP_TFRC_LIB |
71 | extern int tfrc_lib_init(void); | 71 | int tfrc_lib_init(void); |
72 | extern void tfrc_lib_exit(void); | 72 | void tfrc_lib_exit(void); |
73 | #else | 73 | #else |
74 | #define tfrc_lib_init() (0) | 74 | #define tfrc_lib_init() (0) |
75 | #define tfrc_lib_exit() | 75 | #define tfrc_lib_exit() |
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 708e75bf623d..30948784dd58 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -53,7 +53,7 @@ extern struct inet_hashinfo dccp_hashinfo; | |||
53 | 53 | ||
54 | extern struct percpu_counter dccp_orphan_count; | 54 | extern struct percpu_counter dccp_orphan_count; |
55 | 55 | ||
56 | extern void dccp_time_wait(struct sock *sk, int state, int timeo); | 56 | void dccp_time_wait(struct sock *sk, int state, int timeo); |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Set safe upper bounds for header and option length. Since Data Offset is 8 | 59 | * Set safe upper bounds for header and option length. Since Data Offset is 8 |
@@ -224,114 +224,108 @@ static inline void dccp_csum_outgoing(struct sk_buff *skb) | |||
224 | skb->csum = skb_checksum(skb, 0, (cov > skb->len)? skb->len : cov, 0); | 224 | skb->csum = skb_checksum(skb, 0, (cov > skb->len)? skb->len : cov, 0); |
225 | } | 225 | } |
226 | 226 | ||
227 | extern void dccp_v4_send_check(struct sock *sk, struct sk_buff *skb); | 227 | void dccp_v4_send_check(struct sock *sk, struct sk_buff *skb); |
228 | 228 | ||
229 | extern int dccp_retransmit_skb(struct sock *sk); | 229 | int dccp_retransmit_skb(struct sock *sk); |
230 | 230 | ||
231 | extern void dccp_send_ack(struct sock *sk); | 231 | void dccp_send_ack(struct sock *sk); |
232 | extern void dccp_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, | 232 | void dccp_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, |
233 | struct request_sock *rsk); | 233 | struct request_sock *rsk); |
234 | 234 | ||
235 | extern void dccp_send_sync(struct sock *sk, const u64 seq, | 235 | void dccp_send_sync(struct sock *sk, const u64 seq, |
236 | const enum dccp_pkt_type pkt_type); | 236 | const enum dccp_pkt_type pkt_type); |
237 | 237 | ||
238 | /* | 238 | /* |
239 | * TX Packet Dequeueing Interface | 239 | * TX Packet Dequeueing Interface |
240 | */ | 240 | */ |
241 | extern void dccp_qpolicy_push(struct sock *sk, struct sk_buff *skb); | 241 | void dccp_qpolicy_push(struct sock *sk, struct sk_buff *skb); |
242 | extern bool dccp_qpolicy_full(struct sock *sk); | 242 | bool dccp_qpolicy_full(struct sock *sk); |
243 | extern void dccp_qpolicy_drop(struct sock *sk, struct sk_buff *skb); | 243 | void dccp_qpolicy_drop(struct sock *sk, struct sk_buff *skb); |
244 | extern struct sk_buff *dccp_qpolicy_top(struct sock *sk); | 244 | struct sk_buff *dccp_qpolicy_top(struct sock *sk); |
245 | extern struct sk_buff *dccp_qpolicy_pop(struct sock *sk); | 245 | struct sk_buff *dccp_qpolicy_pop(struct sock *sk); |
246 | extern bool dccp_qpolicy_param_ok(struct sock *sk, __be32 param); | 246 | bool dccp_qpolicy_param_ok(struct sock *sk, __be32 param); |
247 | 247 | ||
248 | /* | 248 | /* |
249 | * TX Packet Output and TX Timers | 249 | * TX Packet Output and TX Timers |
250 | */ | 250 | */ |
251 | extern void dccp_write_xmit(struct sock *sk); | 251 | void dccp_write_xmit(struct sock *sk); |
252 | extern void dccp_write_space(struct sock *sk); | 252 | void dccp_write_space(struct sock *sk); |
253 | extern void dccp_flush_write_queue(struct sock *sk, long *time_budget); | 253 | void dccp_flush_write_queue(struct sock *sk, long *time_budget); |
254 | 254 | ||
255 | extern void dccp_init_xmit_timers(struct sock *sk); | 255 | void dccp_init_xmit_timers(struct sock *sk); |
256 | static inline void dccp_clear_xmit_timers(struct sock *sk) | 256 | static inline void dccp_clear_xmit_timers(struct sock *sk) |
257 | { | 257 | { |
258 | inet_csk_clear_xmit_timers(sk); | 258 | inet_csk_clear_xmit_timers(sk); |
259 | } | 259 | } |
260 | 260 | ||
261 | extern unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu); | 261 | unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu); |
262 | 262 | ||
263 | extern const char *dccp_packet_name(const int type); | 263 | const char *dccp_packet_name(const int type); |
264 | 264 | ||
265 | extern void dccp_set_state(struct sock *sk, const int state); | 265 | void dccp_set_state(struct sock *sk, const int state); |
266 | extern void dccp_done(struct sock *sk); | 266 | void dccp_done(struct sock *sk); |
267 | 267 | ||
268 | extern int dccp_reqsk_init(struct request_sock *rq, struct dccp_sock const *dp, | 268 | int dccp_reqsk_init(struct request_sock *rq, struct dccp_sock const *dp, |
269 | struct sk_buff const *skb); | 269 | struct sk_buff const *skb); |
270 | 270 | ||
271 | extern int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb); | 271 | int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb); |
272 | 272 | ||
273 | extern struct sock *dccp_create_openreq_child(struct sock *sk, | 273 | struct sock *dccp_create_openreq_child(struct sock *sk, |
274 | const struct request_sock *req, | 274 | const struct request_sock *req, |
275 | const struct sk_buff *skb); | 275 | const struct sk_buff *skb); |
276 | 276 | ||
277 | extern int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); | 277 | int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); |
278 | 278 | ||
279 | extern struct sock *dccp_v4_request_recv_sock(struct sock *sk, | 279 | struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, |
280 | struct sk_buff *skb, | 280 | struct request_sock *req, |
281 | struct request_sock *req, | 281 | struct dst_entry *dst); |
282 | struct dst_entry *dst); | 282 | struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, |
283 | extern struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, | 283 | struct request_sock *req, |
284 | struct request_sock *req, | 284 | struct request_sock **prev); |
285 | struct request_sock **prev); | ||
286 | 285 | ||
287 | extern int dccp_child_process(struct sock *parent, struct sock *child, | 286 | int dccp_child_process(struct sock *parent, struct sock *child, |
288 | struct sk_buff *skb); | 287 | struct sk_buff *skb); |
289 | extern int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 288 | int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
290 | struct dccp_hdr *dh, unsigned int len); | 289 | struct dccp_hdr *dh, unsigned int len); |
291 | extern int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | 290 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
292 | const struct dccp_hdr *dh, const unsigned int len); | 291 | const struct dccp_hdr *dh, const unsigned int len); |
293 | 292 | ||
294 | extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized); | 293 | int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized); |
295 | extern void dccp_destroy_sock(struct sock *sk); | 294 | void dccp_destroy_sock(struct sock *sk); |
296 | 295 | ||
297 | extern void dccp_close(struct sock *sk, long timeout); | 296 | void dccp_close(struct sock *sk, long timeout); |
298 | extern struct sk_buff *dccp_make_response(struct sock *sk, | 297 | struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, |
299 | struct dst_entry *dst, | 298 | struct request_sock *req); |
300 | struct request_sock *req); | ||
301 | 299 | ||
302 | extern int dccp_connect(struct sock *sk); | 300 | int dccp_connect(struct sock *sk); |
303 | extern int dccp_disconnect(struct sock *sk, int flags); | 301 | int dccp_disconnect(struct sock *sk, int flags); |
304 | extern int dccp_getsockopt(struct sock *sk, int level, int optname, | 302 | int dccp_getsockopt(struct sock *sk, int level, int optname, |
305 | char __user *optval, int __user *optlen); | 303 | char __user *optval, int __user *optlen); |
306 | extern int dccp_setsockopt(struct sock *sk, int level, int optname, | 304 | int dccp_setsockopt(struct sock *sk, int level, int optname, |
307 | char __user *optval, unsigned int optlen); | 305 | char __user *optval, unsigned int optlen); |
308 | #ifdef CONFIG_COMPAT | 306 | #ifdef CONFIG_COMPAT |
309 | extern int compat_dccp_getsockopt(struct sock *sk, | 307 | int compat_dccp_getsockopt(struct sock *sk, int level, int optname, |
310 | int level, int optname, | 308 | char __user *optval, int __user *optlen); |
311 | char __user *optval, int __user *optlen); | 309 | int compat_dccp_setsockopt(struct sock *sk, int level, int optname, |
312 | extern int compat_dccp_setsockopt(struct sock *sk, | 310 | char __user *optval, unsigned int optlen); |
313 | int level, int optname, | ||
314 | char __user *optval, unsigned int optlen); | ||
315 | #endif | 311 | #endif |
316 | extern int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 312 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
317 | extern int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, | 313 | int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
318 | struct msghdr *msg, size_t size); | 314 | size_t size); |
319 | extern int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, | 315 | int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, |
320 | struct msghdr *msg, size_t len, int nonblock, | 316 | struct msghdr *msg, size_t len, int nonblock, int flags, |
321 | int flags, int *addr_len); | 317 | int *addr_len); |
322 | extern void dccp_shutdown(struct sock *sk, int how); | 318 | void dccp_shutdown(struct sock *sk, int how); |
323 | extern int inet_dccp_listen(struct socket *sock, int backlog); | 319 | int inet_dccp_listen(struct socket *sock, int backlog); |
324 | extern unsigned int dccp_poll(struct file *file, struct socket *sock, | 320 | unsigned int dccp_poll(struct file *file, struct socket *sock, |
325 | poll_table *wait); | 321 | poll_table *wait); |
326 | extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, | 322 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
327 | int addr_len); | 323 | |
328 | 324 | struct sk_buff *dccp_ctl_make_reset(struct sock *sk, struct sk_buff *skb); | |
329 | extern struct sk_buff *dccp_ctl_make_reset(struct sock *sk, | 325 | int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); |
330 | struct sk_buff *skb); | 326 | void dccp_send_close(struct sock *sk, const int active); |
331 | extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); | 327 | int dccp_invalid_packet(struct sk_buff *skb); |
332 | extern void dccp_send_close(struct sock *sk, const int active); | 328 | u32 dccp_sample_rtt(struct sock *sk, long delta); |
333 | extern int dccp_invalid_packet(struct sk_buff *skb); | ||
334 | extern u32 dccp_sample_rtt(struct sock *sk, long delta); | ||
335 | 329 | ||
336 | static inline int dccp_bad_service_code(const struct sock *sk, | 330 | static inline int dccp_bad_service_code(const struct sock *sk, |
337 | const __be32 service) | 331 | const __be32 service) |
@@ -475,25 +469,25 @@ static inline int dccp_ack_pending(const struct sock *sk) | |||
475 | return dccp_ackvec_pending(sk) || inet_csk_ack_scheduled(sk); | 469 | return dccp_ackvec_pending(sk) || inet_csk_ack_scheduled(sk); |
476 | } | 470 | } |
477 | 471 | ||
478 | extern int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val); | 472 | int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val); |
479 | extern int dccp_feat_finalise_settings(struct dccp_sock *dp); | 473 | int dccp_feat_finalise_settings(struct dccp_sock *dp); |
480 | extern int dccp_feat_server_ccid_dependencies(struct dccp_request_sock *dreq); | 474 | int dccp_feat_server_ccid_dependencies(struct dccp_request_sock *dreq); |
481 | extern int dccp_feat_insert_opts(struct dccp_sock*, struct dccp_request_sock*, | 475 | int dccp_feat_insert_opts(struct dccp_sock*, struct dccp_request_sock*, |
482 | struct sk_buff *skb); | 476 | struct sk_buff *skb); |
483 | extern int dccp_feat_activate_values(struct sock *sk, struct list_head *fn); | 477 | int dccp_feat_activate_values(struct sock *sk, struct list_head *fn); |
484 | extern void dccp_feat_list_purge(struct list_head *fn_list); | 478 | void dccp_feat_list_purge(struct list_head *fn_list); |
485 | 479 | ||
486 | extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb); | 480 | int dccp_insert_options(struct sock *sk, struct sk_buff *skb); |
487 | extern int dccp_insert_options_rsk(struct dccp_request_sock*, struct sk_buff*); | 481 | int dccp_insert_options_rsk(struct dccp_request_sock *, struct sk_buff *); |
488 | extern int dccp_insert_option_elapsed_time(struct sk_buff *skb, u32 elapsed); | 482 | int dccp_insert_option_elapsed_time(struct sk_buff *skb, u32 elapsed); |
489 | extern u32 dccp_timestamp(void); | 483 | u32 dccp_timestamp(void); |
490 | extern void dccp_timestamping_init(void); | 484 | void dccp_timestamping_init(void); |
491 | extern int dccp_insert_option(struct sk_buff *skb, unsigned char option, | 485 | int dccp_insert_option(struct sk_buff *skb, unsigned char option, |
492 | const void *value, unsigned char len); | 486 | const void *value, unsigned char len); |
493 | 487 | ||
494 | #ifdef CONFIG_SYSCTL | 488 | #ifdef CONFIG_SYSCTL |
495 | extern int dccp_sysctl_init(void); | 489 | int dccp_sysctl_init(void); |
496 | extern void dccp_sysctl_exit(void); | 490 | void dccp_sysctl_exit(void); |
497 | #else | 491 | #else |
498 | static inline int dccp_sysctl_init(void) | 492 | static inline int dccp_sysctl_init(void) |
499 | { | 493 | { |
diff --git a/net/dccp/feat.h b/net/dccp/feat.h index 90b957d34d26..0e75cebb2187 100644 --- a/net/dccp/feat.h +++ b/net/dccp/feat.h | |||
@@ -107,13 +107,13 @@ extern unsigned long sysctl_dccp_sequence_window; | |||
107 | extern int sysctl_dccp_rx_ccid; | 107 | extern int sysctl_dccp_rx_ccid; |
108 | extern int sysctl_dccp_tx_ccid; | 108 | extern int sysctl_dccp_tx_ccid; |
109 | 109 | ||
110 | extern int dccp_feat_init(struct sock *sk); | 110 | int dccp_feat_init(struct sock *sk); |
111 | extern void dccp_feat_initialise_sysctls(void); | 111 | void dccp_feat_initialise_sysctls(void); |
112 | extern int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local, | 112 | int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local, |
113 | u8 const *list, u8 len); | 113 | u8 const *list, u8 len); |
114 | extern int dccp_feat_parse_options(struct sock *, struct dccp_request_sock *, | 114 | int dccp_feat_parse_options(struct sock *, struct dccp_request_sock *, |
115 | u8 mand, u8 opt, u8 feat, u8 *val, u8 len); | 115 | u8 mand, u8 opt, u8 feat, u8 *val, u8 len); |
116 | extern int dccp_feat_clone_list(struct list_head const *, struct list_head *); | 116 | int dccp_feat_clone_list(struct list_head const *, struct list_head *); |
117 | 117 | ||
118 | /* | 118 | /* |
119 | * Encoding variable-length options and their maximum length. | 119 | * Encoding variable-length options and their maximum length. |
@@ -127,11 +127,11 @@ extern int dccp_feat_clone_list(struct list_head const *, struct list_head *); | |||
127 | */ | 127 | */ |
128 | #define DCCP_OPTVAL_MAXLEN 6 | 128 | #define DCCP_OPTVAL_MAXLEN 6 |
129 | 129 | ||
130 | extern void dccp_encode_value_var(const u64 value, u8 *to, const u8 len); | 130 | void dccp_encode_value_var(const u64 value, u8 *to, const u8 len); |
131 | extern u64 dccp_decode_value_var(const u8 *bf, const u8 len); | 131 | u64 dccp_decode_value_var(const u8 *bf, const u8 len); |
132 | extern u64 dccp_feat_nn_get(struct sock *sk, u8 feat); | 132 | u64 dccp_feat_nn_get(struct sock *sk, u8 feat); |
133 | 133 | ||
134 | extern int dccp_insert_option_mandatory(struct sk_buff *skb); | 134 | int dccp_insert_option_mandatory(struct sk_buff *skb); |
135 | extern int dccp_insert_fn_opt(struct sk_buff *skb, u8 type, u8 feat, | 135 | int dccp_insert_fn_opt(struct sk_buff *skb, u8 type, u8 feat, u8 *val, u8 len, |
136 | u8 *val, u8 len, bool repeat_first); | 136 | bool repeat_first); |
137 | #endif /* _DCCP_FEAT_H */ | 137 | #endif /* _DCCP_FEAT_H */ |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index ebc54fef85a5..d9f65fc66db5 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -174,6 +174,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, | |||
174 | mtu = dst_mtu(dst); | 174 | mtu = dst_mtu(dst); |
175 | 175 | ||
176 | if (inet->pmtudisc != IP_PMTUDISC_DONT && | 176 | if (inet->pmtudisc != IP_PMTUDISC_DONT && |
177 | ip_sk_accept_pmtu(sk) && | ||
177 | inet_csk(sk)->icsk_pmtu_cookie > mtu) { | 178 | inet_csk(sk)->icsk_pmtu_cookie > mtu) { |
178 | dccp_sync_mss(sk, mtu); | 179 | dccp_sync_mss(sk, mtu); |
179 | 180 | ||
@@ -409,9 +410,9 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
409 | 410 | ||
410 | newinet = inet_sk(newsk); | 411 | newinet = inet_sk(newsk); |
411 | ireq = inet_rsk(req); | 412 | ireq = inet_rsk(req); |
412 | newinet->inet_daddr = ireq->rmt_addr; | 413 | newinet->inet_daddr = ireq->ir_rmt_addr; |
413 | newinet->inet_rcv_saddr = ireq->loc_addr; | 414 | newinet->inet_rcv_saddr = ireq->ir_loc_addr; |
414 | newinet->inet_saddr = ireq->loc_addr; | 415 | newinet->inet_saddr = ireq->ir_loc_addr; |
415 | newinet->inet_opt = ireq->opt; | 416 | newinet->inet_opt = ireq->opt; |
416 | ireq->opt = NULL; | 417 | ireq->opt = NULL; |
417 | newinet->mc_index = inet_iif(skb); | 418 | newinet->mc_index = inet_iif(skb); |
@@ -516,10 +517,10 @@ static int dccp_v4_send_response(struct sock *sk, struct request_sock *req) | |||
516 | const struct inet_request_sock *ireq = inet_rsk(req); | 517 | const struct inet_request_sock *ireq = inet_rsk(req); |
517 | struct dccp_hdr *dh = dccp_hdr(skb); | 518 | struct dccp_hdr *dh = dccp_hdr(skb); |
518 | 519 | ||
519 | dh->dccph_checksum = dccp_v4_csum_finish(skb, ireq->loc_addr, | 520 | dh->dccph_checksum = dccp_v4_csum_finish(skb, ireq->ir_loc_addr, |
520 | ireq->rmt_addr); | 521 | ireq->ir_rmt_addr); |
521 | err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, | 522 | err = ip_build_and_send_pkt(skb, sk, ireq->ir_loc_addr, |
522 | ireq->rmt_addr, | 523 | ireq->ir_rmt_addr, |
523 | ireq->opt); | 524 | ireq->opt); |
524 | err = net_xmit_eval(err); | 525 | err = net_xmit_eval(err); |
525 | } | 526 | } |
@@ -641,8 +642,8 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
641 | goto drop_and_free; | 642 | goto drop_and_free; |
642 | 643 | ||
643 | ireq = inet_rsk(req); | 644 | ireq = inet_rsk(req); |
644 | ireq->loc_addr = ip_hdr(skb)->daddr; | 645 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; |
645 | ireq->rmt_addr = ip_hdr(skb)->saddr; | 646 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; |
646 | 647 | ||
647 | /* | 648 | /* |
648 | * Step 3: Process LISTEN state | 649 | * Step 3: Process LISTEN state |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 6cf9f7782ad4..4ac71ff7c2e4 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -67,7 +67,7 @@ static inline void dccp_v6_send_check(struct sock *sk, struct sk_buff *skb) | |||
67 | struct dccp_hdr *dh = dccp_hdr(skb); | 67 | struct dccp_hdr *dh = dccp_hdr(skb); |
68 | 68 | ||
69 | dccp_csum_outgoing(skb); | 69 | dccp_csum_outgoing(skb); |
70 | dh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &np->daddr); | 70 | dh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &sk->sk_v6_daddr); |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline __u64 dccp_v6_init_sequence(struct sk_buff *skb) | 73 | static inline __u64 dccp_v6_init_sequence(struct sk_buff *skb) |
@@ -216,7 +216,7 @@ out: | |||
216 | 216 | ||
217 | static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) | 217 | static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) |
218 | { | 218 | { |
219 | struct inet6_request_sock *ireq6 = inet6_rsk(req); | 219 | struct inet_request_sock *ireq = inet_rsk(req); |
220 | struct ipv6_pinfo *np = inet6_sk(sk); | 220 | struct ipv6_pinfo *np = inet6_sk(sk); |
221 | struct sk_buff *skb; | 221 | struct sk_buff *skb; |
222 | struct in6_addr *final_p, final; | 222 | struct in6_addr *final_p, final; |
@@ -226,12 +226,12 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) | |||
226 | 226 | ||
227 | memset(&fl6, 0, sizeof(fl6)); | 227 | memset(&fl6, 0, sizeof(fl6)); |
228 | fl6.flowi6_proto = IPPROTO_DCCP; | 228 | fl6.flowi6_proto = IPPROTO_DCCP; |
229 | fl6.daddr = ireq6->rmt_addr; | 229 | fl6.daddr = ireq->ir_v6_rmt_addr; |
230 | fl6.saddr = ireq6->loc_addr; | 230 | fl6.saddr = ireq->ir_v6_loc_addr; |
231 | fl6.flowlabel = 0; | 231 | fl6.flowlabel = 0; |
232 | fl6.flowi6_oif = ireq6->iif; | 232 | fl6.flowi6_oif = ireq->ir_iif; |
233 | fl6.fl6_dport = inet_rsk(req)->rmt_port; | 233 | fl6.fl6_dport = ireq->ir_rmt_port; |
234 | fl6.fl6_sport = inet_rsk(req)->loc_port; | 234 | fl6.fl6_sport = htons(ireq->ir_num); |
235 | security_req_classify_flow(req, flowi6_to_flowi(&fl6)); | 235 | security_req_classify_flow(req, flowi6_to_flowi(&fl6)); |
236 | 236 | ||
237 | 237 | ||
@@ -249,9 +249,9 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) | |||
249 | struct dccp_hdr *dh = dccp_hdr(skb); | 249 | struct dccp_hdr *dh = dccp_hdr(skb); |
250 | 250 | ||
251 | dh->dccph_checksum = dccp_v6_csum_finish(skb, | 251 | dh->dccph_checksum = dccp_v6_csum_finish(skb, |
252 | &ireq6->loc_addr, | 252 | &ireq->ir_v6_loc_addr, |
253 | &ireq6->rmt_addr); | 253 | &ireq->ir_v6_rmt_addr); |
254 | fl6.daddr = ireq6->rmt_addr; | 254 | fl6.daddr = ireq->ir_v6_rmt_addr; |
255 | err = ip6_xmit(sk, skb, &fl6, np->opt, np->tclass); | 255 | err = ip6_xmit(sk, skb, &fl6, np->opt, np->tclass); |
256 | err = net_xmit_eval(err); | 256 | err = net_xmit_eval(err); |
257 | } | 257 | } |
@@ -264,8 +264,7 @@ done: | |||
264 | static void dccp_v6_reqsk_destructor(struct request_sock *req) | 264 | static void dccp_v6_reqsk_destructor(struct request_sock *req) |
265 | { | 265 | { |
266 | dccp_feat_list_purge(&dccp_rsk(req)->dreq_featneg); | 266 | dccp_feat_list_purge(&dccp_rsk(req)->dreq_featneg); |
267 | if (inet6_rsk(req)->pktopts != NULL) | 267 | kfree_skb(inet_rsk(req)->pktopts); |
268 | kfree_skb(inet6_rsk(req)->pktopts); | ||
269 | } | 268 | } |
270 | 269 | ||
271 | static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | 270 | static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) |
@@ -359,7 +358,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
359 | { | 358 | { |
360 | struct request_sock *req; | 359 | struct request_sock *req; |
361 | struct dccp_request_sock *dreq; | 360 | struct dccp_request_sock *dreq; |
362 | struct inet6_request_sock *ireq6; | 361 | struct inet_request_sock *ireq; |
363 | struct ipv6_pinfo *np = inet6_sk(sk); | 362 | struct ipv6_pinfo *np = inet6_sk(sk); |
364 | const __be32 service = dccp_hdr_request(skb)->dccph_req_service; | 363 | const __be32 service = dccp_hdr_request(skb)->dccph_req_service; |
365 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); | 364 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); |
@@ -398,22 +397,22 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
398 | if (security_inet_conn_request(sk, skb, req)) | 397 | if (security_inet_conn_request(sk, skb, req)) |
399 | goto drop_and_free; | 398 | goto drop_and_free; |
400 | 399 | ||
401 | ireq6 = inet6_rsk(req); | 400 | ireq = inet_rsk(req); |
402 | ireq6->rmt_addr = ipv6_hdr(skb)->saddr; | 401 | ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; |
403 | ireq6->loc_addr = ipv6_hdr(skb)->daddr; | 402 | ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; |
404 | 403 | ||
405 | if (ipv6_opt_accepted(sk, skb) || | 404 | if (ipv6_opt_accepted(sk, skb) || |
406 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || | 405 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || |
407 | np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { | 406 | np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { |
408 | atomic_inc(&skb->users); | 407 | atomic_inc(&skb->users); |
409 | ireq6->pktopts = skb; | 408 | ireq->pktopts = skb; |
410 | } | 409 | } |
411 | ireq6->iif = sk->sk_bound_dev_if; | 410 | ireq->ir_iif = sk->sk_bound_dev_if; |
412 | 411 | ||
413 | /* So that link locals have meaning */ | 412 | /* So that link locals have meaning */ |
414 | if (!sk->sk_bound_dev_if && | 413 | if (!sk->sk_bound_dev_if && |
415 | ipv6_addr_type(&ireq6->rmt_addr) & IPV6_ADDR_LINKLOCAL) | 414 | ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) |
416 | ireq6->iif = inet6_iif(skb); | 415 | ireq->ir_iif = inet6_iif(skb); |
417 | 416 | ||
418 | /* | 417 | /* |
419 | * Step 3: Process LISTEN state | 418 | * Step 3: Process LISTEN state |
@@ -446,7 +445,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
446 | struct request_sock *req, | 445 | struct request_sock *req, |
447 | struct dst_entry *dst) | 446 | struct dst_entry *dst) |
448 | { | 447 | { |
449 | struct inet6_request_sock *ireq6 = inet6_rsk(req); | 448 | struct inet_request_sock *ireq = inet_rsk(req); |
450 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); | 449 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); |
451 | struct inet_sock *newinet; | 450 | struct inet_sock *newinet; |
452 | struct dccp6_sock *newdp6; | 451 | struct dccp6_sock *newdp6; |
@@ -467,11 +466,11 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
467 | 466 | ||
468 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); | 467 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); |
469 | 468 | ||
470 | ipv6_addr_set_v4mapped(newinet->inet_daddr, &newnp->daddr); | 469 | ipv6_addr_set_v4mapped(newinet->inet_daddr, &newsk->sk_v6_daddr); |
471 | 470 | ||
472 | ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); | 471 | ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); |
473 | 472 | ||
474 | newnp->rcv_saddr = newnp->saddr; | 473 | newsk->sk_v6_rcv_saddr = newnp->saddr; |
475 | 474 | ||
476 | inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; | 475 | inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; |
477 | newsk->sk_backlog_rcv = dccp_v4_do_rcv; | 476 | newsk->sk_backlog_rcv = dccp_v4_do_rcv; |
@@ -505,12 +504,12 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
505 | 504 | ||
506 | memset(&fl6, 0, sizeof(fl6)); | 505 | memset(&fl6, 0, sizeof(fl6)); |
507 | fl6.flowi6_proto = IPPROTO_DCCP; | 506 | fl6.flowi6_proto = IPPROTO_DCCP; |
508 | fl6.daddr = ireq6->rmt_addr; | 507 | fl6.daddr = ireq->ir_v6_rmt_addr; |
509 | final_p = fl6_update_dst(&fl6, np->opt, &final); | 508 | final_p = fl6_update_dst(&fl6, np->opt, &final); |
510 | fl6.saddr = ireq6->loc_addr; | 509 | fl6.saddr = ireq->ir_v6_loc_addr; |
511 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 510 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
512 | fl6.fl6_dport = inet_rsk(req)->rmt_port; | 511 | fl6.fl6_dport = ireq->ir_rmt_port; |
513 | fl6.fl6_sport = inet_rsk(req)->loc_port; | 512 | fl6.fl6_sport = htons(ireq->ir_num); |
514 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 513 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
515 | 514 | ||
516 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); | 515 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); |
@@ -538,10 +537,10 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
538 | 537 | ||
539 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); | 538 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); |
540 | 539 | ||
541 | newnp->daddr = ireq6->rmt_addr; | 540 | newsk->sk_v6_daddr = ireq->ir_v6_rmt_addr; |
542 | newnp->saddr = ireq6->loc_addr; | 541 | newnp->saddr = ireq->ir_v6_loc_addr; |
543 | newnp->rcv_saddr = ireq6->loc_addr; | 542 | newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr; |
544 | newsk->sk_bound_dev_if = ireq6->iif; | 543 | newsk->sk_bound_dev_if = ireq->ir_iif; |
545 | 544 | ||
546 | /* Now IPv6 options... | 545 | /* Now IPv6 options... |
547 | 546 | ||
@@ -554,10 +553,10 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
554 | 553 | ||
555 | /* Clone pktoptions received with SYN */ | 554 | /* Clone pktoptions received with SYN */ |
556 | newnp->pktoptions = NULL; | 555 | newnp->pktoptions = NULL; |
557 | if (ireq6->pktopts != NULL) { | 556 | if (ireq->pktopts != NULL) { |
558 | newnp->pktoptions = skb_clone(ireq6->pktopts, GFP_ATOMIC); | 557 | newnp->pktoptions = skb_clone(ireq->pktopts, GFP_ATOMIC); |
559 | consume_skb(ireq6->pktopts); | 558 | consume_skb(ireq->pktopts); |
560 | ireq6->pktopts = NULL; | 559 | ireq->pktopts = NULL; |
561 | if (newnp->pktoptions) | 560 | if (newnp->pktoptions) |
562 | skb_set_owner_r(newnp->pktoptions, newsk); | 561 | skb_set_owner_r(newnp->pktoptions, newsk); |
563 | } | 562 | } |
@@ -885,7 +884,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
885 | return -EINVAL; | 884 | return -EINVAL; |
886 | } | 885 | } |
887 | 886 | ||
888 | np->daddr = usin->sin6_addr; | 887 | sk->sk_v6_daddr = usin->sin6_addr; |
889 | np->flow_label = fl6.flowlabel; | 888 | np->flow_label = fl6.flowlabel; |
890 | 889 | ||
891 | /* | 890 | /* |
@@ -915,16 +914,16 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
915 | goto failure; | 914 | goto failure; |
916 | } | 915 | } |
917 | ipv6_addr_set_v4mapped(inet->inet_saddr, &np->saddr); | 916 | ipv6_addr_set_v4mapped(inet->inet_saddr, &np->saddr); |
918 | ipv6_addr_set_v4mapped(inet->inet_rcv_saddr, &np->rcv_saddr); | 917 | ipv6_addr_set_v4mapped(inet->inet_rcv_saddr, &sk->sk_v6_rcv_saddr); |
919 | 918 | ||
920 | return err; | 919 | return err; |
921 | } | 920 | } |
922 | 921 | ||
923 | if (!ipv6_addr_any(&np->rcv_saddr)) | 922 | if (!ipv6_addr_any(&sk->sk_v6_rcv_saddr)) |
924 | saddr = &np->rcv_saddr; | 923 | saddr = &sk->sk_v6_rcv_saddr; |
925 | 924 | ||
926 | fl6.flowi6_proto = IPPROTO_DCCP; | 925 | fl6.flowi6_proto = IPPROTO_DCCP; |
927 | fl6.daddr = np->daddr; | 926 | fl6.daddr = sk->sk_v6_daddr; |
928 | fl6.saddr = saddr ? *saddr : np->saddr; | 927 | fl6.saddr = saddr ? *saddr : np->saddr; |
929 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 928 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
930 | fl6.fl6_dport = usin->sin6_port; | 929 | fl6.fl6_dport = usin->sin6_port; |
@@ -941,7 +940,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
941 | 940 | ||
942 | if (saddr == NULL) { | 941 | if (saddr == NULL) { |
943 | saddr = &fl6.saddr; | 942 | saddr = &fl6.saddr; |
944 | np->rcv_saddr = *saddr; | 943 | sk->sk_v6_rcv_saddr = *saddr; |
945 | } | 944 | } |
946 | 945 | ||
947 | /* set the source address */ | 946 | /* set the source address */ |
@@ -963,7 +962,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
963 | goto late_failure; | 962 | goto late_failure; |
964 | 963 | ||
965 | dp->dccps_iss = secure_dccpv6_sequence_number(np->saddr.s6_addr32, | 964 | dp->dccps_iss = secure_dccpv6_sequence_number(np->saddr.s6_addr32, |
966 | np->daddr.s6_addr32, | 965 | sk->sk_v6_daddr.s6_addr32, |
967 | inet->inet_sport, | 966 | inet->inet_sport, |
968 | inet->inet_dport); | 967 | inet->inet_dport); |
969 | err = dccp_connect(sk); | 968 | err = dccp_connect(sk); |
diff --git a/net/dccp/ipv6.h b/net/dccp/ipv6.h index 6eef81fdbe56..af259e15e7f0 100644 --- a/net/dccp/ipv6.h +++ b/net/dccp/ipv6.h | |||
@@ -25,12 +25,10 @@ struct dccp6_sock { | |||
25 | 25 | ||
26 | struct dccp6_request_sock { | 26 | struct dccp6_request_sock { |
27 | struct dccp_request_sock dccp; | 27 | struct dccp_request_sock dccp; |
28 | struct inet6_request_sock inet6; | ||
29 | }; | 28 | }; |
30 | 29 | ||
31 | struct dccp6_timewait_sock { | 30 | struct dccp6_timewait_sock { |
32 | struct inet_timewait_sock inet; | 31 | struct inet_timewait_sock inet; |
33 | struct inet6_timewait_sock tw6; | ||
34 | }; | 32 | }; |
35 | 33 | ||
36 | #endif /* _DCCP_IPV6_H */ | 34 | #endif /* _DCCP_IPV6_H */ |
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index 662071b249cc..9e2f78bc1553 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
@@ -56,12 +56,9 @@ void dccp_time_wait(struct sock *sk, int state, int timeo) | |||
56 | #if IS_ENABLED(CONFIG_IPV6) | 56 | #if IS_ENABLED(CONFIG_IPV6) |
57 | if (tw->tw_family == PF_INET6) { | 57 | if (tw->tw_family == PF_INET6) { |
58 | const struct ipv6_pinfo *np = inet6_sk(sk); | 58 | const struct ipv6_pinfo *np = inet6_sk(sk); |
59 | struct inet6_timewait_sock *tw6; | ||
60 | 59 | ||
61 | tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot); | 60 | tw->tw_v6_daddr = sk->sk_v6_daddr; |
62 | tw6 = inet6_twsk((struct sock *)tw); | 61 | tw->tw_v6_rcv_saddr = sk->sk_v6_rcv_saddr; |
63 | tw6->tw_v6_daddr = np->daddr; | ||
64 | tw6->tw_v6_rcv_saddr = np->rcv_saddr; | ||
65 | tw->tw_ipv6only = np->ipv6only; | 62 | tw->tw_ipv6only = np->ipv6only; |
66 | } | 63 | } |
67 | #endif | 64 | #endif |
@@ -269,10 +266,10 @@ int dccp_reqsk_init(struct request_sock *req, | |||
269 | { | 266 | { |
270 | struct dccp_request_sock *dreq = dccp_rsk(req); | 267 | struct dccp_request_sock *dreq = dccp_rsk(req); |
271 | 268 | ||
272 | inet_rsk(req)->rmt_port = dccp_hdr(skb)->dccph_sport; | 269 | inet_rsk(req)->ir_rmt_port = dccp_hdr(skb)->dccph_sport; |
273 | inet_rsk(req)->loc_port = dccp_hdr(skb)->dccph_dport; | 270 | inet_rsk(req)->ir_num = ntohs(dccp_hdr(skb)->dccph_dport); |
274 | inet_rsk(req)->acked = 0; | 271 | inet_rsk(req)->acked = 0; |
275 | dreq->dreq_timestamp_echo = 0; | 272 | dreq->dreq_timestamp_echo = 0; |
276 | 273 | ||
277 | /* inherit feature negotiation options from listening socket */ | 274 | /* inherit feature negotiation options from listening socket */ |
278 | return dccp_feat_clone_list(&dp->dccps_featneg, &dreq->dreq_featneg); | 275 | return dccp_feat_clone_list(&dp->dccps_featneg, &dreq->dreq_featneg); |
diff --git a/net/dccp/output.c b/net/dccp/output.c index d17fc90a74b6..8876078859da 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -424,8 +424,8 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | |||
424 | /* Build and checksum header */ | 424 | /* Build and checksum header */ |
425 | dh = dccp_zeroed_hdr(skb, dccp_header_size); | 425 | dh = dccp_zeroed_hdr(skb, dccp_header_size); |
426 | 426 | ||
427 | dh->dccph_sport = inet_rsk(req)->loc_port; | 427 | dh->dccph_sport = htons(inet_rsk(req)->ir_num); |
428 | dh->dccph_dport = inet_rsk(req)->rmt_port; | 428 | dh->dccph_dport = inet_rsk(req)->ir_rmt_port; |
429 | dh->dccph_doff = (dccp_header_size + | 429 | dh->dccph_doff = (dccp_header_size + |
430 | DCCP_SKB_CB(skb)->dccpd_opt_len) / 4; | 430 | DCCP_SKB_CB(skb)->dccpd_opt_len) / 4; |
431 | dh->dccph_type = DCCP_PKT_RESPONSE; | 431 | dh->dccph_type = DCCP_PKT_RESPONSE; |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index ba64750f0387..eb892b4f4814 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -1158,10 +1158,8 @@ static int __init dccp_init(void) | |||
1158 | goto out_free_bind_bucket_cachep; | 1158 | goto out_free_bind_bucket_cachep; |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | for (i = 0; i <= dccp_hashinfo.ehash_mask; i++) { | 1161 | for (i = 0; i <= dccp_hashinfo.ehash_mask; i++) |
1162 | INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].chain, i); | 1162 | INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].chain, i); |
1163 | INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].twchain, i); | ||
1164 | } | ||
1165 | 1163 | ||
1166 | if (inet_ehash_locks_alloc(&dccp_hashinfo)) | 1164 | if (inet_ehash_locks_alloc(&dccp_hashinfo)) |
1167 | goto out_free_dccp_ehash; | 1165 | goto out_free_dccp_ehash; |