aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/ccids/ccid2.c4
-rw-r--r--net/dccp/ccids/ccid3.c2
-rw-r--r--net/dccp/ccids/lib/tfrc.c2
-rw-r--r--net/dccp/ccids/lib/tfrc.h2
-rw-r--r--net/dccp/dccp.h4
-rw-r--r--net/dccp/diag.c20
-rw-r--r--net/dccp/feat.c16
-rw-r--r--net/dccp/ipv4.c5
-rw-r--r--net/dccp/ipv6.c42
-rw-r--r--net/dccp/minisocks.c8
-rw-r--r--net/dccp/options.c2
-rw-r--r--net/dccp/probe.c14
-rw-r--r--net/dccp/proto.c2
13 files changed, 73 insertions, 50 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 67164bb6ae4d..f053198e730c 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -29,7 +29,7 @@
29 29
30 30
31#ifdef CONFIG_IP_DCCP_CCID2_DEBUG 31#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
32static int ccid2_debug; 32static bool ccid2_debug;
33#define ccid2_pr_debug(format, a...) DCCP_PR_DEBUG(ccid2_debug, format, ##a) 33#define ccid2_pr_debug(format, a...) DCCP_PR_DEBUG(ccid2_debug, format, ##a)
34#else 34#else
35#define ccid2_pr_debug(format, a...) 35#define ccid2_pr_debug(format, a...)
@@ -174,7 +174,7 @@ out:
174/* 174/*
175 * Congestion window validation (RFC 2861). 175 * Congestion window validation (RFC 2861).
176 */ 176 */
177static int ccid2_do_cwv = 1; 177static bool ccid2_do_cwv = true;
178module_param(ccid2_do_cwv, bool, 0644); 178module_param(ccid2_do_cwv, bool, 0644);
179MODULE_PARM_DESC(ccid2_do_cwv, "Perform RFC2861 Congestion Window Validation"); 179MODULE_PARM_DESC(ccid2_do_cwv, "Perform RFC2861 Congestion Window Validation");
180 180
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 3d604e1349c0..560627307200 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -38,7 +38,7 @@
38#include <asm/unaligned.h> 38#include <asm/unaligned.h>
39 39
40#ifdef CONFIG_IP_DCCP_CCID3_DEBUG 40#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
41static int ccid3_debug; 41static bool ccid3_debug;
42#define ccid3_pr_debug(format, a...) DCCP_PR_DEBUG(ccid3_debug, format, ##a) 42#define ccid3_pr_debug(format, a...) DCCP_PR_DEBUG(ccid3_debug, format, ##a)
43#else 43#else
44#define ccid3_pr_debug(format, a...) 44#define ccid3_pr_debug(format, a...)
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c
index 1f94b7e01d39..62b5828acde0 100644
--- a/net/dccp/ccids/lib/tfrc.c
+++ b/net/dccp/ccids/lib/tfrc.c
@@ -8,7 +8,7 @@
8#include "tfrc.h" 8#include "tfrc.h"
9 9
10#ifdef CONFIG_IP_DCCP_TFRC_DEBUG 10#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
11int tfrc_debug; 11bool tfrc_debug;
12module_param(tfrc_debug, bool, 0644); 12module_param(tfrc_debug, bool, 0644);
13MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages"); 13MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
14#endif 14#endif
diff --git a/net/dccp/ccids/lib/tfrc.h b/net/dccp/ccids/lib/tfrc.h
index f8ee3f549770..ed698c42a5fb 100644
--- a/net/dccp/ccids/lib/tfrc.h
+++ b/net/dccp/ccids/lib/tfrc.h
@@ -21,7 +21,7 @@
21#include "packet_history.h" 21#include "packet_history.h"
22 22
23#ifdef CONFIG_IP_DCCP_TFRC_DEBUG 23#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
24extern int tfrc_debug; 24extern bool tfrc_debug;
25#define tfrc_pr_debug(format, a...) DCCP_PR_DEBUG(tfrc_debug, format, ##a) 25#define tfrc_pr_debug(format, a...) DCCP_PR_DEBUG(tfrc_debug, format, ##a)
26#else 26#else
27#define tfrc_pr_debug(format, a...) 27#define tfrc_pr_debug(format, a...)
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 583490aaf56f..29d6bb629a6c 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -39,7 +39,7 @@
39 "%s: " fmt, __func__, ##a) 39 "%s: " fmt, __func__, ##a)
40 40
41#ifdef CONFIG_IP_DCCP_DEBUG 41#ifdef CONFIG_IP_DCCP_DEBUG
42extern int dccp_debug; 42extern bool dccp_debug;
43#define dccp_pr_debug(format, a...) DCCP_PR_DEBUG(dccp_debug, format, ##a) 43#define dccp_pr_debug(format, a...) DCCP_PR_DEBUG(dccp_debug, format, ##a)
44#define dccp_pr_debug_cat(format, a...) DCCP_PRINTK(dccp_debug, format, ##a) 44#define dccp_pr_debug_cat(format, a...) DCCP_PRINTK(dccp_debug, format, ##a)
45#define dccp_debug(fmt, a...) dccp_pr_debug_cat(KERN_DEBUG fmt, ##a) 45#define dccp_debug(fmt, a...) dccp_pr_debug_cat(KERN_DEBUG fmt, ##a)
@@ -357,7 +357,7 @@ static inline int dccp_bad_service_code(const struct sock *sk,
357struct dccp_skb_cb { 357struct dccp_skb_cb {
358 union { 358 union {
359 struct inet_skb_parm h4; 359 struct inet_skb_parm h4;
360#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 360#if IS_ENABLED(CONFIG_IPV6)
361 struct inet6_skb_parm h6; 361 struct inet6_skb_parm h6;
362#endif 362#endif
363 } header; 363 } header;
diff --git a/net/dccp/diag.c b/net/dccp/diag.c
index b21f261da75e..8f1625753377 100644
--- a/net/dccp/diag.c
+++ b/net/dccp/diag.c
@@ -48,11 +48,23 @@ static void dccp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
48 dccp_get_info(sk, _info); 48 dccp_get_info(sk, _info);
49} 49}
50 50
51static void dccp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
52 struct inet_diag_req *r, struct nlattr *bc)
53{
54 inet_diag_dump_icsk(&dccp_hashinfo, skb, cb, r, bc);
55}
56
57static int dccp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
58 struct inet_diag_req *req)
59{
60 return inet_diag_dump_one_icsk(&dccp_hashinfo, in_skb, nlh, req);
61}
62
51static const struct inet_diag_handler dccp_diag_handler = { 63static const struct inet_diag_handler dccp_diag_handler = {
52 .idiag_hashinfo = &dccp_hashinfo, 64 .dump = dccp_diag_dump,
65 .dump_one = dccp_diag_dump_one,
53 .idiag_get_info = dccp_diag_get_info, 66 .idiag_get_info = dccp_diag_get_info,
54 .idiag_type = DCCPDIAG_GETSOCK, 67 .idiag_type = IPPROTO_DCCP,
55 .idiag_info_size = sizeof(struct tcp_info),
56}; 68};
57 69
58static int __init dccp_diag_init(void) 70static int __init dccp_diag_init(void)
@@ -71,4 +83,4 @@ module_exit(dccp_diag_fini);
71MODULE_LICENSE("GPL"); 83MODULE_LICENSE("GPL");
72MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>"); 84MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
73MODULE_DESCRIPTION("DCCP inet_diag handler"); 85MODULE_DESCRIPTION("DCCP inet_diag handler");
74MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_INET_DIAG, DCCPDIAG_GETSOCK); 86MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-33 /* AF_INET - IPPROTO_DCCP */);
diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index 23cea0ee3101..78a2ad70e1b0 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -490,8 +490,8 @@ static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local,
490 new->feat_num = feat; 490 new->feat_num = feat;
491 new->is_local = local; 491 new->is_local = local;
492 new->state = FEAT_INITIALISING; 492 new->state = FEAT_INITIALISING;
493 new->needs_confirm = 0; 493 new->needs_confirm = false;
494 new->empty_confirm = 0; 494 new->empty_confirm = false;
495 new->val = *fval; 495 new->val = *fval;
496 new->needs_mandatory = mandatory; 496 new->needs_mandatory = mandatory;
497 497
@@ -517,12 +517,12 @@ static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local,
517 new->feat_num = feat; 517 new->feat_num = feat;
518 new->is_local = local; 518 new->is_local = local;
519 new->state = FEAT_STABLE; /* transition in 6.6.2 */ 519 new->state = FEAT_STABLE; /* transition in 6.6.2 */
520 new->needs_confirm = 1; 520 new->needs_confirm = true;
521 new->empty_confirm = (fval == NULL); 521 new->empty_confirm = (fval == NULL);
522 new->val.nn = 0; /* zeroes the whole structure */ 522 new->val.nn = 0; /* zeroes the whole structure */
523 if (!new->empty_confirm) 523 if (!new->empty_confirm)
524 new->val = *fval; 524 new->val = *fval;
525 new->needs_mandatory = 0; 525 new->needs_mandatory = false;
526 526
527 return 0; 527 return 0;
528} 528}
@@ -1155,7 +1155,7 @@ static u8 dccp_feat_change_recv(struct list_head *fn, u8 is_mandatory, u8 opt,
1155 } 1155 }
1156 1156
1157 if (dccp_feat_reconcile(&entry->val, val, len, server, true)) { 1157 if (dccp_feat_reconcile(&entry->val, val, len, server, true)) {
1158 entry->empty_confirm = 0; 1158 entry->empty_confirm = false;
1159 } else if (is_mandatory) { 1159 } else if (is_mandatory) {
1160 return DCCP_RESET_CODE_MANDATORY_ERROR; 1160 return DCCP_RESET_CODE_MANDATORY_ERROR;
1161 } else if (entry->state == FEAT_INITIALISING) { 1161 } else if (entry->state == FEAT_INITIALISING) {
@@ -1171,10 +1171,10 @@ static u8 dccp_feat_change_recv(struct list_head *fn, u8 is_mandatory, u8 opt,
1171 defval = dccp_feat_default_value(feat); 1171 defval = dccp_feat_default_value(feat);
1172 if (!dccp_feat_reconcile(&entry->val, &defval, 1, server, true)) 1172 if (!dccp_feat_reconcile(&entry->val, &defval, 1, server, true))
1173 return DCCP_RESET_CODE_OPTION_ERROR; 1173 return DCCP_RESET_CODE_OPTION_ERROR;
1174 entry->empty_confirm = 1; 1174 entry->empty_confirm = true;
1175 } 1175 }
1176 entry->needs_confirm = 1; 1176 entry->needs_confirm = true;
1177 entry->needs_mandatory = 0; 1177 entry->needs_mandatory = false;
1178 entry->state = FEAT_STABLE; 1178 entry->state = FEAT_STABLE;
1179 return 0; 1179 return 0;
1180 1180
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 3f4e5414c8e5..1c67fe8ff90d 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -474,10 +474,11 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
474 struct sk_buff *skb) 474 struct sk_buff *skb)
475{ 475{
476 struct rtable *rt; 476 struct rtable *rt;
477 const struct iphdr *iph = ip_hdr(skb);
477 struct flowi4 fl4 = { 478 struct flowi4 fl4 = {
478 .flowi4_oif = skb_rtable(skb)->rt_iif, 479 .flowi4_oif = skb_rtable(skb)->rt_iif,
479 .daddr = ip_hdr(skb)->saddr, 480 .daddr = iph->saddr,
480 .saddr = ip_hdr(skb)->daddr, 481 .saddr = iph->daddr,
481 .flowi4_tos = RT_CONN_FLAGS(sk), 482 .flowi4_tos = RT_CONN_FLAGS(sk),
482 .flowi4_proto = sk->sk_protocol, 483 .flowi4_proto = sk->sk_protocol,
483 .fl4_sport = dccp_hdr(skb)->dccph_dport, 484 .fl4_sport = dccp_hdr(skb)->dccph_dport,
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 17ee85ce148d..ce903f747e64 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -150,8 +150,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
150 */ 150 */
151 memset(&fl6, 0, sizeof(fl6)); 151 memset(&fl6, 0, sizeof(fl6));
152 fl6.flowi6_proto = IPPROTO_DCCP; 152 fl6.flowi6_proto = IPPROTO_DCCP;
153 ipv6_addr_copy(&fl6.daddr, &np->daddr); 153 fl6.daddr = np->daddr;
154 ipv6_addr_copy(&fl6.saddr, &np->saddr); 154 fl6.saddr = np->saddr;
155 fl6.flowi6_oif = sk->sk_bound_dev_if; 155 fl6.flowi6_oif = sk->sk_bound_dev_if;
156 fl6.fl6_dport = inet->inet_dport; 156 fl6.fl6_dport = inet->inet_dport;
157 fl6.fl6_sport = inet->inet_sport; 157 fl6.fl6_sport = inet->inet_sport;
@@ -244,8 +244,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
244 244
245 memset(&fl6, 0, sizeof(fl6)); 245 memset(&fl6, 0, sizeof(fl6));
246 fl6.flowi6_proto = IPPROTO_DCCP; 246 fl6.flowi6_proto = IPPROTO_DCCP;
247 ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); 247 fl6.daddr = ireq6->rmt_addr;
248 ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr); 248 fl6.saddr = ireq6->loc_addr;
249 fl6.flowlabel = 0; 249 fl6.flowlabel = 0;
250 fl6.flowi6_oif = ireq6->iif; 250 fl6.flowi6_oif = ireq6->iif;
251 fl6.fl6_dport = inet_rsk(req)->rmt_port; 251 fl6.fl6_dport = inet_rsk(req)->rmt_port;
@@ -270,7 +270,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
270 dh->dccph_checksum = dccp_v6_csum_finish(skb, 270 dh->dccph_checksum = dccp_v6_csum_finish(skb,
271 &ireq6->loc_addr, 271 &ireq6->loc_addr,
272 &ireq6->rmt_addr); 272 &ireq6->rmt_addr);
273 ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); 273 fl6.daddr = ireq6->rmt_addr;
274 err = ip6_xmit(sk, skb, &fl6, opt, np->tclass); 274 err = ip6_xmit(sk, skb, &fl6, opt, np->tclass);
275 err = net_xmit_eval(err); 275 err = net_xmit_eval(err);
276 } 276 }
@@ -313,8 +313,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
313 &rxip6h->daddr); 313 &rxip6h->daddr);
314 314
315 memset(&fl6, 0, sizeof(fl6)); 315 memset(&fl6, 0, sizeof(fl6));
316 ipv6_addr_copy(&fl6.daddr, &rxip6h->saddr); 316 fl6.daddr = rxip6h->saddr;
317 ipv6_addr_copy(&fl6.saddr, &rxip6h->daddr); 317 fl6.saddr = rxip6h->daddr;
318 318
319 fl6.flowi6_proto = IPPROTO_DCCP; 319 fl6.flowi6_proto = IPPROTO_DCCP;
320 fl6.flowi6_oif = inet6_iif(rxskb); 320 fl6.flowi6_oif = inet6_iif(rxskb);
@@ -419,8 +419,8 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
419 goto drop_and_free; 419 goto drop_and_free;
420 420
421 ireq6 = inet6_rsk(req); 421 ireq6 = inet6_rsk(req);
422 ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr); 422 ireq6->rmt_addr = ipv6_hdr(skb)->saddr;
423 ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr); 423 ireq6->loc_addr = ipv6_hdr(skb)->daddr;
424 424
425 if (ipv6_opt_accepted(sk, skb) || 425 if (ipv6_opt_accepted(sk, skb) ||
426 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || 426 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
@@ -491,7 +491,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
491 491
492 ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); 492 ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr);
493 493
494 ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); 494 newnp->rcv_saddr = newnp->saddr;
495 495
496 inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; 496 inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped;
497 newsk->sk_backlog_rcv = dccp_v4_do_rcv; 497 newsk->sk_backlog_rcv = dccp_v4_do_rcv;
@@ -526,9 +526,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
526 526
527 memset(&fl6, 0, sizeof(fl6)); 527 memset(&fl6, 0, sizeof(fl6));
528 fl6.flowi6_proto = IPPROTO_DCCP; 528 fl6.flowi6_proto = IPPROTO_DCCP;
529 ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); 529 fl6.daddr = ireq6->rmt_addr;
530 final_p = fl6_update_dst(&fl6, opt, &final); 530 final_p = fl6_update_dst(&fl6, opt, &final);
531 ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr); 531 fl6.saddr = ireq6->loc_addr;
532 fl6.flowi6_oif = sk->sk_bound_dev_if; 532 fl6.flowi6_oif = sk->sk_bound_dev_if;
533 fl6.fl6_dport = inet_rsk(req)->rmt_port; 533 fl6.fl6_dport = inet_rsk(req)->rmt_port;
534 fl6.fl6_sport = inet_rsk(req)->loc_port; 534 fl6.fl6_sport = inet_rsk(req)->loc_port;
@@ -559,9 +559,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
559 559
560 memcpy(newnp, np, sizeof(struct ipv6_pinfo)); 560 memcpy(newnp, np, sizeof(struct ipv6_pinfo));
561 561
562 ipv6_addr_copy(&newnp->daddr, &ireq6->rmt_addr); 562 newnp->daddr = ireq6->rmt_addr;
563 ipv6_addr_copy(&newnp->saddr, &ireq6->loc_addr); 563 newnp->saddr = ireq6->loc_addr;
564 ipv6_addr_copy(&newnp->rcv_saddr, &ireq6->loc_addr); 564 newnp->rcv_saddr = ireq6->loc_addr;
565 newsk->sk_bound_dev_if = ireq6->iif; 565 newsk->sk_bound_dev_if = ireq6->iif;
566 566
567 /* Now IPv6 options... 567 /* Now IPv6 options...
@@ -877,7 +877,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
877 flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); 877 flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
878 if (flowlabel == NULL) 878 if (flowlabel == NULL)
879 return -EINVAL; 879 return -EINVAL;
880 ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst); 880 usin->sin6_addr = flowlabel->dst;
881 fl6_sock_release(flowlabel); 881 fl6_sock_release(flowlabel);
882 } 882 }
883 } 883 }
@@ -910,7 +910,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
910 return -EINVAL; 910 return -EINVAL;
911 } 911 }
912 912
913 ipv6_addr_copy(&np->daddr, &usin->sin6_addr); 913 np->daddr = usin->sin6_addr;
914 np->flow_label = fl6.flowlabel; 914 np->flow_label = fl6.flowlabel;
915 915
916 /* 916 /*
@@ -949,8 +949,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
949 saddr = &np->rcv_saddr; 949 saddr = &np->rcv_saddr;
950 950
951 fl6.flowi6_proto = IPPROTO_DCCP; 951 fl6.flowi6_proto = IPPROTO_DCCP;
952 ipv6_addr_copy(&fl6.daddr, &np->daddr); 952 fl6.daddr = np->daddr;
953 ipv6_addr_copy(&fl6.saddr, saddr ? saddr : &np->saddr); 953 fl6.saddr = saddr ? *saddr : np->saddr;
954 fl6.flowi6_oif = sk->sk_bound_dev_if; 954 fl6.flowi6_oif = sk->sk_bound_dev_if;
955 fl6.fl6_dport = usin->sin6_port; 955 fl6.fl6_dport = usin->sin6_port;
956 fl6.fl6_sport = inet->inet_sport; 956 fl6.fl6_sport = inet->inet_sport;
@@ -966,11 +966,11 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
966 966
967 if (saddr == NULL) { 967 if (saddr == NULL) {
968 saddr = &fl6.saddr; 968 saddr = &fl6.saddr;
969 ipv6_addr_copy(&np->rcv_saddr, saddr); 969 np->rcv_saddr = *saddr;
970 } 970 }
971 971
972 /* set the source address */ 972 /* set the source address */
973 ipv6_addr_copy(&np->saddr, saddr); 973 np->saddr = *saddr;
974 inet->inet_rcv_saddr = LOOPBACK4_IPV6; 974 inet->inet_rcv_saddr = LOOPBACK4_IPV6;
975 975
976 __ip6_dst_store(sk, dst, NULL, NULL); 976 __ip6_dst_store(sk, dst, NULL, NULL);
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index d7041a0963af..5a7f90bbffac 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -53,15 +53,15 @@ void dccp_time_wait(struct sock *sk, int state, int timeo)
53 if (tw != NULL) { 53 if (tw != NULL) {
54 const struct inet_connection_sock *icsk = inet_csk(sk); 54 const struct inet_connection_sock *icsk = inet_csk(sk);
55 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); 55 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1);
56#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 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; 59 struct inet6_timewait_sock *tw6;
60 60
61 tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot); 61 tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot);
62 tw6 = inet6_twsk((struct sock *)tw); 62 tw6 = inet6_twsk((struct sock *)tw);
63 ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr); 63 tw6->tw_v6_daddr = np->daddr;
64 ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr); 64 tw6->tw_v6_rcv_saddr = np->rcv_saddr;
65 tw->tw_ipv6only = np->ipv6only; 65 tw->tw_ipv6only = np->ipv6only;
66 } 66 }
67#endif 67#endif
@@ -100,7 +100,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
100 * (* Generate a new socket and switch to that socket *) 100 * (* Generate a new socket and switch to that socket *)
101 * Set S := new socket for this port pair 101 * Set S := new socket for this port pair
102 */ 102 */
103 struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC); 103 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC);
104 104
105 if (newsk != NULL) { 105 if (newsk != NULL) {
106 struct dccp_request_sock *dreq = dccp_rsk(req); 106 struct dccp_request_sock *dreq = dccp_rsk(req);
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 4b2ab657ac8e..68fa6b7a3e01 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -544,7 +544,7 @@ int dccp_insert_fn_opt(struct sk_buff *skb, u8 type, u8 feat,
544 } 544 }
545 545
546 if (unlikely(val == NULL || len == 0)) 546 if (unlikely(val == NULL || len == 0))
547 len = repeat_first = 0; 547 len = repeat_first = false;
548 tot_len = 3 + repeat_first + len; 548 tot_len = 3 + repeat_first + len;
549 549
550 if (DCCP_SKB_CB(skb)->dccpd_opt_len + tot_len > DCCP_MAX_OPT_LEN) { 550 if (DCCP_SKB_CB(skb)->dccpd_opt_len + tot_len > DCCP_MAX_OPT_LEN) {
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 33d0e6297c21..0a8d6ebd9b45 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -152,6 +152,17 @@ static const struct file_operations dccpprobe_fops = {
152 .llseek = noop_llseek, 152 .llseek = noop_llseek,
153}; 153};
154 154
155static __init int setup_jprobe(void)
156{
157 int ret = register_jprobe(&dccp_send_probe);
158
159 if (ret) {
160 request_module("dccp");
161 ret = register_jprobe(&dccp_send_probe);
162 }
163 return ret;
164}
165
155static __init int dccpprobe_init(void) 166static __init int dccpprobe_init(void)
156{ 167{
157 int ret = -ENOMEM; 168 int ret = -ENOMEM;
@@ -163,8 +174,7 @@ static __init int dccpprobe_init(void)
163 if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops)) 174 if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
164 goto err0; 175 goto err0;
165 176
166 try_then_request_module((ret = register_jprobe(&dccp_send_probe)) == 0, 177 ret = setup_jprobe();
167 "dccp");
168 if (ret) 178 if (ret)
169 goto err1; 179 goto err1;
170 180
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index e742f90a6858..7065c0ae1e7b 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -1099,7 +1099,7 @@ module_param(thash_entries, int, 0444);
1099MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); 1099MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");
1100 1100
1101#ifdef CONFIG_IP_DCCP_DEBUG 1101#ifdef CONFIG_IP_DCCP_DEBUG
1102int dccp_debug; 1102bool dccp_debug;
1103module_param(dccp_debug, bool, 0644); 1103module_param(dccp_debug, bool, 0644);
1104MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); 1104MODULE_PARM_DESC(dccp_debug, "Enable debug messages");
1105 1105