.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
2 | | -/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors: |
---|
| 2 | +/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors: |
---|
3 | 3 | * |
---|
4 | 4 | * Marek Lindner, Simon Wunderlich |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of version 2 of the GNU General Public |
---|
8 | | - * License as published by the Free Software Foundation. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, but |
---|
11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
13 | | - * General Public License for more details. |
---|
14 | | - * |
---|
15 | | - * You should have received a copy of the GNU General Public License |
---|
16 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
---|
17 | 5 | */ |
---|
18 | 6 | |
---|
19 | 7 | #include "routing.h" |
---|
.. | .. |
---|
83 | 71 | * the code needs to ensure the curr_router variable contains a pointer |
---|
84 | 72 | * to the replaced best neighbor. |
---|
85 | 73 | */ |
---|
86 | | - curr_router = rcu_dereference_protected(orig_ifinfo->router, true); |
---|
87 | 74 | |
---|
88 | 75 | /* increase refcount of new best neighbor */ |
---|
89 | 76 | if (neigh_node) |
---|
90 | 77 | kref_get(&neigh_node->refcount); |
---|
91 | 78 | |
---|
92 | | - rcu_assign_pointer(orig_ifinfo->router, neigh_node); |
---|
| 79 | + curr_router = rcu_replace_pointer(orig_ifinfo->router, neigh_node, |
---|
| 80 | + true); |
---|
93 | 81 | spin_unlock_bh(&orig_node->neigh_list_lock); |
---|
94 | 82 | batadv_orig_ifinfo_put(orig_ifinfo); |
---|
95 | 83 | |
---|
.. | .. |
---|
461 | 449 | * @skb: packet to check |
---|
462 | 450 | * @hdr_size: size of header to pull |
---|
463 | 451 | * |
---|
464 | | - * Check for short header and bad addresses in given packet. |
---|
| 452 | + * Checks for short header and bad addresses in the given packet. |
---|
465 | 453 | * |
---|
466 | 454 | * Return: negative value when check fails and 0 otherwise. The negative value |
---|
467 | 455 | * depends on the reason: -ENODATA for bad header, -EBADR for broadcast |
---|
.. | .. |
---|
1047 | 1035 | hdr_size)) |
---|
1048 | 1036 | goto rx_success; |
---|
1049 | 1037 | |
---|
| 1038 | + batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); |
---|
| 1039 | + |
---|
1050 | 1040 | batadv_interface_rx(recv_if->soft_iface, skb, hdr_size, |
---|
1051 | 1041 | orig_node); |
---|
1052 | 1042 | |
---|
.. | .. |
---|
1127 | 1117 | * @recv_if: interface that the skb is received on |
---|
1128 | 1118 | * |
---|
1129 | 1119 | * This function does one of the three following things: 1) Forward fragment, if |
---|
1130 | | - * the assembled packet will exceed our MTU; 2) Buffer fragment, if we till |
---|
| 1120 | + * the assembled packet will exceed our MTU; 2) Buffer fragment, if we still |
---|
1131 | 1121 | * lack further fragments; 3) Merge fragments, if we have all needed parts. |
---|
1132 | 1122 | * |
---|
1133 | 1123 | * Return: NET_RX_DROP if the skb is not consumed, NET_RX_SUCCESS otherwise. |
---|
.. | .. |
---|
1282 | 1272 | if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size)) |
---|
1283 | 1273 | goto rx_success; |
---|
1284 | 1274 | |
---|
| 1275 | + batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); |
---|
| 1276 | + |
---|
1285 | 1277 | /* broadcast for me */ |
---|
1286 | 1278 | batadv_interface_rx(recv_if->soft_iface, skb, hdr_size, orig_node); |
---|
1287 | 1279 | |
---|