aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/translation-table.c12
-rw-r--r--net/bluetooth/l2cap_core.c14
-rw-r--r--net/bluetooth/mgmt.c2
-rw-r--r--net/caif/caif_dev.c3
-rw-r--r--net/ipv6/ip6_fib.c4
-rw-r--r--net/ipv6/route.c41
-rw-r--r--net/phonet/af_phonet.c4
-rw-r--r--net/phonet/datagram.c4
-rw-r--r--net/phonet/pep-gprs.c2
-rw-r--r--net/phonet/pep.c2
-rw-r--r--net/phonet/pn_dev.c4
-rw-r--r--net/phonet/pn_netlink.c4
-rw-r--r--net/phonet/socket.c4
-rw-r--r--net/phonet/sysctl.c2
-rw-r--r--net/sctp/protocol.c2
15 files changed, 64 insertions, 40 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 5180d50e909d..3806d9bbf55e 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -139,13 +139,14 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
139 struct tt_orig_list_entry *orig_entry; 139 struct tt_orig_list_entry *orig_entry;
140 140
141 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); 141 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu);
142 atomic_dec(&orig_entry->orig_node->tt_size);
143 batadv_orig_node_free_ref(orig_entry->orig_node); 142 batadv_orig_node_free_ref(orig_entry->orig_node);
144 kfree(orig_entry); 143 kfree(orig_entry);
145} 144}
146 145
147static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) 146static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry)
148{ 147{
148 /* to avoid race conditions, immediately decrease the tt counter */
149 atomic_dec(&orig_entry->orig_node->tt_size);
149 call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); 150 call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu);
150} 151}
151 152
@@ -958,7 +959,6 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
958 } 959 }
959 spin_unlock_bh(list_lock); 960 spin_unlock_bh(list_lock);
960 } 961 }
961 atomic_set(&orig_node->tt_size, 0);
962 orig_node->tt_initialised = false; 962 orig_node->tt_initialised = false;
963} 963}
964 964
@@ -2148,10 +2148,10 @@ bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src,
2148{ 2148{
2149 struct tt_local_entry *tt_local_entry = NULL; 2149 struct tt_local_entry *tt_local_entry = NULL;
2150 struct tt_global_entry *tt_global_entry = NULL; 2150 struct tt_global_entry *tt_global_entry = NULL;
2151 bool ret = true; 2151 bool ret = false;
2152 2152
2153 if (!atomic_read(&bat_priv->ap_isolation)) 2153 if (!atomic_read(&bat_priv->ap_isolation))
2154 return false; 2154 goto out;
2155 2155
2156 tt_local_entry = tt_local_hash_find(bat_priv, dst); 2156 tt_local_entry = tt_local_hash_find(bat_priv, dst);
2157 if (!tt_local_entry) 2157 if (!tt_local_entry)
@@ -2161,10 +2161,10 @@ bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src,
2161 if (!tt_global_entry) 2161 if (!tt_global_entry)
2162 goto out; 2162 goto out;
2163 2163
2164 if (_is_ap_isolated(tt_local_entry, tt_global_entry)) 2164 if (!_is_ap_isolated(tt_local_entry, tt_global_entry))
2165 goto out; 2165 goto out;
2166 2166
2167 ret = false; 2167 ret = true;
2168 2168
2169out: 2169out:
2170 if (tt_global_entry) 2170 if (tt_global_entry)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4ca88247b7c2..d42dfdc83ebb 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3278,12 +3278,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
3278 while (len >= L2CAP_CONF_OPT_SIZE) { 3278 while (len >= L2CAP_CONF_OPT_SIZE) {
3279 len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); 3279 len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
3280 3280
3281 switch (type) { 3281 if (type != L2CAP_CONF_RFC)
3282 case L2CAP_CONF_RFC: 3282 continue;
3283 if (olen == sizeof(rfc)) 3283
3284 memcpy(&rfc, (void *)val, olen); 3284 if (olen != sizeof(rfc))
3285 goto done; 3285 break;
3286 } 3286
3287 memcpy(&rfc, (void *)val, olen);
3288 goto done;
3287 } 3289 }
3288 3290
3289 /* Use sane default values in case a misbehaving remote device 3291 /* Use sane default values in case a misbehaving remote device
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c72307cc25fc..a6e0f3d8da6c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
1598 else 1598 else
1599 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); 1599 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr);
1600 1600
1601 if (!conn) { 1601 if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) {
1602 err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, 1602 err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT,
1603 MGMT_STATUS_NOT_CONNECTED); 1603 MGMT_STATUS_NOT_CONNECTED);
1604 goto failed; 1604 goto failed;
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index aa6f716524fd..554b31289607 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -4,8 +4,7 @@
4 * Author: Sjur Brendeland/sjur.brandeland@stericsson.com 4 * Author: Sjur Brendeland/sjur.brandeland@stericsson.com
5 * License terms: GNU General Public License (GPL) version 2 5 * License terms: GNU General Public License (GPL) version 2
6 * 6 *
7 * Borrowed heavily from file: pn_dev.c. Thanks to 7 * Borrowed heavily from file: pn_dev.c. Thanks to Remi Denis-Courmont
8 * Remi Denis-Courmont <remi.denis-courmont@nokia.com>
9 * and Sakari Ailus <sakari.ailus@nokia.com> 8 * and Sakari Ailus <sakari.ailus@nokia.com>
10 */ 9 */
11 10
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 215afc74d8aa..13690d650c3e 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1350,8 +1350,8 @@ static int fib6_walk_continue(struct fib6_walker_t *w)
1350 if (w->leaf && fn->fn_flags & RTN_RTINFO) { 1350 if (w->leaf && fn->fn_flags & RTN_RTINFO) {
1351 int err; 1351 int err;
1352 1352
1353 if (w->count < w->skip) { 1353 if (w->skip) {
1354 w->count++; 1354 w->skip--;
1355 continue; 1355 continue;
1356 } 1356 }
1357 1357
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e649cd78c15f..c5bbece7f9f2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2888,10 +2888,6 @@ static int __net_init ip6_route_net_init(struct net *net)
2888 net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; 2888 net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ;
2889 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; 2889 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
2890 2890
2891#ifdef CONFIG_PROC_FS
2892 proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
2893 proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2894#endif
2895 net->ipv6.ip6_rt_gc_expire = 30*HZ; 2891 net->ipv6.ip6_rt_gc_expire = 30*HZ;
2896 2892
2897 ret = 0; 2893 ret = 0;
@@ -2912,10 +2908,6 @@ out_ip6_dst_ops:
2912 2908
2913static void __net_exit ip6_route_net_exit(struct net *net) 2909static void __net_exit ip6_route_net_exit(struct net *net)
2914{ 2910{
2915#ifdef CONFIG_PROC_FS
2916 proc_net_remove(net, "ipv6_route");
2917 proc_net_remove(net, "rt6_stats");
2918#endif
2919 kfree(net->ipv6.ip6_null_entry); 2911 kfree(net->ipv6.ip6_null_entry);
2920#ifdef CONFIG_IPV6_MULTIPLE_TABLES 2912#ifdef CONFIG_IPV6_MULTIPLE_TABLES
2921 kfree(net->ipv6.ip6_prohibit_entry); 2913 kfree(net->ipv6.ip6_prohibit_entry);
@@ -2924,6 +2916,23 @@ static void __net_exit ip6_route_net_exit(struct net *net)
2924 dst_entries_destroy(&net->ipv6.ip6_dst_ops); 2916 dst_entries_destroy(&net->ipv6.ip6_dst_ops);
2925} 2917}
2926 2918
2919static int __net_init ip6_route_net_init_late(struct net *net)
2920{
2921#ifdef CONFIG_PROC_FS
2922 proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
2923 proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2924#endif
2925 return 0;
2926}
2927
2928static void __net_exit ip6_route_net_exit_late(struct net *net)
2929{
2930#ifdef CONFIG_PROC_FS
2931 proc_net_remove(net, "ipv6_route");
2932 proc_net_remove(net, "rt6_stats");
2933#endif
2934}
2935
2927static struct pernet_operations ip6_route_net_ops = { 2936static struct pernet_operations ip6_route_net_ops = {
2928 .init = ip6_route_net_init, 2937 .init = ip6_route_net_init,
2929 .exit = ip6_route_net_exit, 2938 .exit = ip6_route_net_exit,
@@ -2954,6 +2963,11 @@ static struct pernet_operations ipv6_inetpeer_ops = {
2954 .exit = ipv6_inetpeer_exit, 2963 .exit = ipv6_inetpeer_exit,
2955}; 2964};
2956 2965
2966static struct pernet_operations ip6_route_net_late_ops = {
2967 .init = ip6_route_net_init_late,
2968 .exit = ip6_route_net_exit_late,
2969};
2970
2957static struct notifier_block ip6_route_dev_notifier = { 2971static struct notifier_block ip6_route_dev_notifier = {
2958 .notifier_call = ip6_route_dev_notify, 2972 .notifier_call = ip6_route_dev_notify,
2959 .priority = 0, 2973 .priority = 0,
@@ -3007,19 +3021,25 @@ int __init ip6_route_init(void)
3007 if (ret) 3021 if (ret)
3008 goto xfrm6_init; 3022 goto xfrm6_init;
3009 3023
3024 ret = register_pernet_subsys(&ip6_route_net_late_ops);
3025 if (ret)
3026 goto fib6_rules_init;
3027
3010 ret = -ENOBUFS; 3028 ret = -ENOBUFS;
3011 if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || 3029 if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) ||
3012 __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || 3030 __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) ||
3013 __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) 3031 __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL))
3014 goto fib6_rules_init; 3032 goto out_register_late_subsys;
3015 3033
3016 ret = register_netdevice_notifier(&ip6_route_dev_notifier); 3034 ret = register_netdevice_notifier(&ip6_route_dev_notifier);
3017 if (ret) 3035 if (ret)
3018 goto fib6_rules_init; 3036 goto out_register_late_subsys;
3019 3037
3020out: 3038out:
3021 return ret; 3039 return ret;
3022 3040
3041out_register_late_subsys:
3042 unregister_pernet_subsys(&ip6_route_net_late_ops);
3023fib6_rules_init: 3043fib6_rules_init:
3024 fib6_rules_cleanup(); 3044 fib6_rules_cleanup();
3025xfrm6_init: 3045xfrm6_init:
@@ -3040,6 +3060,7 @@ out_kmem_cache:
3040void ip6_route_cleanup(void) 3060void ip6_route_cleanup(void)
3041{ 3061{
3042 unregister_netdevice_notifier(&ip6_route_dev_notifier); 3062 unregister_netdevice_notifier(&ip6_route_dev_notifier);
3063 unregister_pernet_subsys(&ip6_route_net_late_ops);
3043 fib6_rules_cleanup(); 3064 fib6_rules_cleanup();
3044 xfrm6_fini(); 3065 xfrm6_fini();
3045 fib6_gc_cleanup(); 3066 fib6_gc_cleanup();
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 779ce4ff92ec..5a940dbd74a3 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c
index bf35b4e1a14c..12c30f3e643e 100644
--- a/net/phonet/datagram.c
+++ b/net/phonet/datagram.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c
index d01208968c83..a2fba7edfd1f 100644
--- a/net/phonet/pep-gprs.c
+++ b/net/phonet/pep-gprs.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 9dd4f926f7d1..576f22c9c76e 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 36f75a9e2c3d..5bf6341e2dd4 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index cfdf135fcd69..7dd762a464e5 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Remi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 89cfa9ce4939..0acc943f713a 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c
index 696348fd31a1..d6bbbbd0af18 100644
--- a/net/phonet/sysctl.c
+++ b/net/phonet/sysctl.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 5942d27b1444..9c90811d1134 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -673,7 +673,9 @@ void sctp_addr_wq_timeout_handler(unsigned long arg)
673 SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n"); 673 SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n");
674 sctp_bh_unlock_sock(sk); 674 sctp_bh_unlock_sock(sk);
675 } 675 }
676#if IS_ENABLED(CONFIG_IPV6)
676free_next: 677free_next:
678#endif
677 list_del(&addrw->list); 679 list_del(&addrw->list);
678 kfree(addrw); 680 kfree(addrw);
679 } 681 }