diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/dst.h | 9 | ||||
-rw-r--r-- | include/net/inet6_connection_sock.h | 2 | ||||
-rw-r--r-- | include/net/inet_connection_sock.h | 2 | ||||
-rw-r--r-- | include/net/ip.h | 10 | ||||
-rw-r--r-- | include/net/ipv6.h | 4 | ||||
-rw-r--r-- | include/net/request_sock.h | 4 | ||||
-rw-r--r-- | include/net/route.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 22 |
8 files changed, 30 insertions, 25 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index df0481a07029..779206c15f8b 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -489,7 +489,8 @@ struct flowi; | |||
489 | #ifndef CONFIG_XFRM | 489 | #ifndef CONFIG_XFRM |
490 | static inline struct dst_entry *xfrm_lookup(struct net *net, | 490 | static inline struct dst_entry *xfrm_lookup(struct net *net, |
491 | struct dst_entry *dst_orig, | 491 | struct dst_entry *dst_orig, |
492 | const struct flowi *fl, struct sock *sk, | 492 | const struct flowi *fl, |
493 | const struct sock *sk, | ||
493 | int flags) | 494 | int flags) |
494 | { | 495 | { |
495 | return dst_orig; | 496 | return dst_orig; |
@@ -498,7 +499,7 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, | |||
498 | static inline struct dst_entry *xfrm_lookup_route(struct net *net, | 499 | static inline struct dst_entry *xfrm_lookup_route(struct net *net, |
499 | struct dst_entry *dst_orig, | 500 | struct dst_entry *dst_orig, |
500 | const struct flowi *fl, | 501 | const struct flowi *fl, |
501 | struct sock *sk, | 502 | const struct sock *sk, |
502 | int flags) | 503 | int flags) |
503 | { | 504 | { |
504 | return dst_orig; | 505 | return dst_orig; |
@@ -511,11 +512,11 @@ static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | |||
511 | 512 | ||
512 | #else | 513 | #else |
513 | struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | 514 | struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, |
514 | const struct flowi *fl, struct sock *sk, | 515 | const struct flowi *fl, const struct sock *sk, |
515 | int flags); | 516 | int flags); |
516 | 517 | ||
517 | struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig, | 518 | struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig, |
518 | const struct flowi *fl, struct sock *sk, | 519 | const struct flowi *fl, const struct sock *sk, |
519 | int flags); | 520 | int flags); |
520 | 521 | ||
521 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ | 522 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index 6d539e4e5ba7..81d937e820c4 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
@@ -25,7 +25,7 @@ struct sockaddr; | |||
25 | int inet6_csk_bind_conflict(const struct sock *sk, | 25 | int inet6_csk_bind_conflict(const struct sock *sk, |
26 | const struct inet_bind_bucket *tb, bool relax); | 26 | const struct inet_bind_bucket *tb, bool relax); |
27 | 27 | ||
28 | struct dst_entry *inet6_csk_route_req(struct sock *sk, struct flowi6 *fl6, | 28 | struct dst_entry *inet6_csk_route_req(const struct sock *sk, struct flowi6 *fl6, |
29 | const struct request_sock *req); | 29 | const struct request_sock *req); |
30 | 30 | ||
31 | struct request_sock *inet6_csk_search_req(struct sock *sk, | 31 | struct request_sock *inet6_csk_search_req(struct sock *sk, |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 0320bbb7d7b5..00c3ced6ee55 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -266,7 +266,7 @@ int inet_csk_bind_conflict(const struct sock *sk, | |||
266 | const struct inet_bind_bucket *tb, bool relax); | 266 | const struct inet_bind_bucket *tb, bool relax); |
267 | int inet_csk_get_port(struct sock *sk, unsigned short snum); | 267 | int inet_csk_get_port(struct sock *sk, unsigned short snum); |
268 | 268 | ||
269 | struct dst_entry *inet_csk_route_req(struct sock *sk, struct flowi4 *fl4, | 269 | struct dst_entry *inet_csk_route_req(const struct sock *sk, struct flowi4 *fl4, |
270 | const struct request_sock *req); | 270 | const struct request_sock *req); |
271 | struct dst_entry *inet_csk_route_child_sock(struct sock *sk, struct sock *newsk, | 271 | struct dst_entry *inet_csk_route_child_sock(struct sock *sk, struct sock *newsk, |
272 | const struct request_sock *req); | 272 | const struct request_sock *req); |
diff --git a/include/net/ip.h b/include/net/ip.h index 9b9ca2839399..91a6b2c88341 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -100,7 +100,7 @@ int igmp_mc_init(void); | |||
100 | * Functions provided by ip.c | 100 | * Functions provided by ip.c |
101 | */ | 101 | */ |
102 | 102 | ||
103 | int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | 103 | int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk, |
104 | __be32 saddr, __be32 daddr, | 104 | __be32 saddr, __be32 daddr, |
105 | struct ip_options_rcu *opt); | 105 | struct ip_options_rcu *opt); |
106 | int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | 106 | int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, |
@@ -282,10 +282,12 @@ int ip_decrease_ttl(struct iphdr *iph) | |||
282 | } | 282 | } |
283 | 283 | ||
284 | static inline | 284 | static inline |
285 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | 285 | int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst) |
286 | { | 286 | { |
287 | return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || | 287 | u8 pmtudisc = READ_ONCE(inet_sk(sk)->pmtudisc); |
288 | (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && | 288 | |
289 | return pmtudisc == IP_PMTUDISC_DO || | ||
290 | (pmtudisc == IP_PMTUDISC_WANT && | ||
289 | !(dst_metric_locked(dst, RTAX_MTU))); | 291 | !(dst_metric_locked(dst, RTAX_MTU))); |
290 | } | 292 | } |
291 | 293 | ||
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 384a93cf07d6..3dde042bcd3f 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -812,7 +812,7 @@ int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb); | |||
812 | /* | 812 | /* |
813 | * upper-layer output functions | 813 | * upper-layer output functions |
814 | */ | 814 | */ |
815 | int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, | 815 | int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, |
816 | struct ipv6_txoptions *opt, int tclass); | 816 | struct ipv6_txoptions *opt, int tclass); |
817 | 817 | ||
818 | int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | 818 | int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); |
@@ -849,7 +849,7 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk) | |||
849 | 849 | ||
850 | int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst, | 850 | int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst, |
851 | struct flowi6 *fl6); | 851 | struct flowi6 *fl6); |
852 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 852 | struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, |
853 | const struct in6_addr *final_dst); | 853 | const struct in6_addr *final_dst); |
854 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 854 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
855 | const struct in6_addr *final_dst); | 855 | const struct in6_addr *final_dst); |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 87935cad2f7b..181f97f9fe1c 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -32,7 +32,7 @@ struct request_sock_ops { | |||
32 | int obj_size; | 32 | int obj_size; |
33 | struct kmem_cache *slab; | 33 | struct kmem_cache *slab; |
34 | char *slab_name; | 34 | char *slab_name; |
35 | int (*rtx_syn_ack)(struct sock *sk, | 35 | int (*rtx_syn_ack)(const struct sock *sk, |
36 | struct request_sock *req); | 36 | struct request_sock *req); |
37 | void (*send_ack)(struct sock *sk, struct sk_buff *skb, | 37 | void (*send_ack)(struct sock *sk, struct sk_buff *skb, |
38 | struct request_sock *req); | 38 | struct request_sock *req); |
@@ -42,7 +42,7 @@ struct request_sock_ops { | |||
42 | void (*syn_ack_timeout)(const struct request_sock *req); | 42 | void (*syn_ack_timeout)(const struct request_sock *req); |
43 | }; | 43 | }; |
44 | 44 | ||
45 | int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); | 45 | int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req); |
46 | 46 | ||
47 | /* struct request_sock - mini sock to represent a connection request | 47 | /* struct request_sock - mini sock to represent a connection request |
48 | */ | 48 | */ |
diff --git a/include/net/route.h b/include/net/route.h index 10a7d21a211c..414beadc619f 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -114,7 +114,7 @@ void rt_cache_flush(struct net *net); | |||
114 | void rt_flush_dev(struct net_device *dev); | 114 | void rt_flush_dev(struct net_device *dev); |
115 | struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 115 | struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
116 | struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 116 | struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
117 | struct sock *sk); | 117 | const struct sock *sk); |
118 | struct dst_entry *ipv4_blackhole_route(struct net *net, | 118 | struct dst_entry *ipv4_blackhole_route(struct net *net, |
119 | struct dst_entry *dst_orig); | 119 | struct dst_entry *dst_orig); |
120 | 120 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 5cf9672c13e2..6630ab180f5c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -461,7 +461,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
461 | int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); | 461 | int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); |
462 | int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); | 462 | int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
463 | int tcp_connect(struct sock *sk); | 463 | int tcp_connect(struct sock *sk); |
464 | struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | 464 | struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, |
465 | struct request_sock *req, | 465 | struct request_sock *req, |
466 | struct tcp_fastopen_cookie *foc); | 466 | struct tcp_fastopen_cookie *foc); |
467 | int tcp_disconnect(struct sock *sk, int flags); | 467 | int tcp_disconnect(struct sock *sk, int flags); |
@@ -1207,7 +1207,8 @@ static inline int tcp_full_space(const struct sock *sk) | |||
1207 | } | 1207 | } |
1208 | 1208 | ||
1209 | extern void tcp_openreq_init_rwin(struct request_sock *req, | 1209 | extern void tcp_openreq_init_rwin(struct request_sock *req, |
1210 | struct sock *sk, struct dst_entry *dst); | 1210 | const struct sock *sk_listener, |
1211 | const struct dst_entry *dst); | ||
1211 | 1212 | ||
1212 | void tcp_enter_memory_pressure(struct sock *sk); | 1213 | void tcp_enter_memory_pressure(struct sock *sk); |
1213 | 1214 | ||
@@ -1371,16 +1372,16 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, | |||
1371 | int family, const u8 *newkey, u8 newkeylen, gfp_t gfp); | 1372 | int family, const u8 *newkey, u8 newkeylen, gfp_t gfp); |
1372 | int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, | 1373 | int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, |
1373 | int family); | 1374 | int family); |
1374 | struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, | 1375 | struct tcp_md5sig_key *tcp_v4_md5_lookup(const struct sock *sk, |
1375 | const struct sock *addr_sk); | 1376 | const struct sock *addr_sk); |
1376 | 1377 | ||
1377 | #ifdef CONFIG_TCP_MD5SIG | 1378 | #ifdef CONFIG_TCP_MD5SIG |
1378 | struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, | 1379 | struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk, |
1379 | const union tcp_md5_addr *addr, | 1380 | const union tcp_md5_addr *addr, |
1380 | int family); | 1381 | int family); |
1381 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key) | 1382 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key) |
1382 | #else | 1383 | #else |
1383 | static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, | 1384 | static inline struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk, |
1384 | const union tcp_md5_addr *addr, | 1385 | const union tcp_md5_addr *addr, |
1385 | int family) | 1386 | int family) |
1386 | { | 1387 | { |
@@ -1675,7 +1676,7 @@ int tcp4_proc_init(void); | |||
1675 | void tcp4_proc_exit(void); | 1676 | void tcp4_proc_exit(void); |
1676 | #endif | 1677 | #endif |
1677 | 1678 | ||
1678 | int tcp_rtx_synack(struct sock *sk, struct request_sock *req); | 1679 | int tcp_rtx_synack(const struct sock *sk, struct request_sock *req); |
1679 | int tcp_conn_request(struct request_sock_ops *rsk_ops, | 1680 | int tcp_conn_request(struct request_sock_ops *rsk_ops, |
1680 | const struct tcp_request_sock_ops *af_ops, | 1681 | const struct tcp_request_sock_ops *af_ops, |
1681 | struct sock *sk, struct sk_buff *skb); | 1682 | struct sock *sk, struct sk_buff *skb); |
@@ -1683,7 +1684,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
1683 | /* TCP af-specific functions */ | 1684 | /* TCP af-specific functions */ |
1684 | struct tcp_sock_af_ops { | 1685 | struct tcp_sock_af_ops { |
1685 | #ifdef CONFIG_TCP_MD5SIG | 1686 | #ifdef CONFIG_TCP_MD5SIG |
1686 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, | 1687 | struct tcp_md5sig_key *(*md5_lookup) (const struct sock *sk, |
1687 | const struct sock *addr_sk); | 1688 | const struct sock *addr_sk); |
1688 | int (*calc_md5_hash)(char *location, | 1689 | int (*calc_md5_hash)(char *location, |
1689 | const struct tcp_md5sig_key *md5, | 1690 | const struct tcp_md5sig_key *md5, |
@@ -1698,14 +1699,15 @@ struct tcp_sock_af_ops { | |||
1698 | struct tcp_request_sock_ops { | 1699 | struct tcp_request_sock_ops { |
1699 | u16 mss_clamp; | 1700 | u16 mss_clamp; |
1700 | #ifdef CONFIG_TCP_MD5SIG | 1701 | #ifdef CONFIG_TCP_MD5SIG |
1701 | struct tcp_md5sig_key *(*req_md5_lookup)(struct sock *sk, | 1702 | struct tcp_md5sig_key *(*req_md5_lookup)(const struct sock *sk, |
1702 | const struct sock *addr_sk); | 1703 | const struct sock *addr_sk); |
1703 | int (*calc_md5_hash) (char *location, | 1704 | int (*calc_md5_hash) (char *location, |
1704 | const struct tcp_md5sig_key *md5, | 1705 | const struct tcp_md5sig_key *md5, |
1705 | const struct sock *sk, | 1706 | const struct sock *sk, |
1706 | const struct sk_buff *skb); | 1707 | const struct sk_buff *skb); |
1707 | #endif | 1708 | #endif |
1708 | void (*init_req)(struct request_sock *req, struct sock *sk, | 1709 | void (*init_req)(struct request_sock *req, |
1710 | const struct sock *sk_listener, | ||
1709 | struct sk_buff *skb); | 1711 | struct sk_buff *skb); |
1710 | #ifdef CONFIG_SYN_COOKIES | 1712 | #ifdef CONFIG_SYN_COOKIES |
1711 | __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb, | 1713 | __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb, |
@@ -1715,7 +1717,7 @@ struct tcp_request_sock_ops { | |||
1715 | const struct request_sock *req, | 1717 | const struct request_sock *req, |
1716 | bool *strict); | 1718 | bool *strict); |
1717 | __u32 (*init_seq)(const struct sk_buff *skb); | 1719 | __u32 (*init_seq)(const struct sk_buff *skb); |
1718 | int (*send_synack)(struct sock *sk, struct dst_entry *dst, | 1720 | int (*send_synack)(const struct sock *sk, struct dst_entry *dst, |
1719 | struct flowi *fl, struct request_sock *req, | 1721 | struct flowi *fl, struct request_sock *req, |
1720 | u16 queue_mapping, struct tcp_fastopen_cookie *foc); | 1722 | u16 queue_mapping, struct tcp_fastopen_cookie *foc); |
1721 | void (*queue_hash_add)(struct sock *sk, struct request_sock *req, | 1723 | void (*queue_hash_add)(struct sock *sk, struct request_sock *req, |