hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/batman-adv/routing.c
....@@ -1,19 +1,7 @@
11 // 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:
33 *
44 * 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/>.
175 */
186
197 #include "routing.h"
....@@ -83,13 +71,13 @@
8371 * the code needs to ensure the curr_router variable contains a pointer
8472 * to the replaced best neighbor.
8573 */
86
- curr_router = rcu_dereference_protected(orig_ifinfo->router, true);
8774
8875 /* increase refcount of new best neighbor */
8976 if (neigh_node)
9077 kref_get(&neigh_node->refcount);
9178
92
- rcu_assign_pointer(orig_ifinfo->router, neigh_node);
79
+ curr_router = rcu_replace_pointer(orig_ifinfo->router, neigh_node,
80
+ true);
9381 spin_unlock_bh(&orig_node->neigh_list_lock);
9482 batadv_orig_ifinfo_put(orig_ifinfo);
9583
....@@ -461,7 +449,7 @@
461449 * @skb: packet to check
462450 * @hdr_size: size of header to pull
463451 *
464
- * Check for short header and bad addresses in given packet.
452
+ * Checks for short header and bad addresses in the given packet.
465453 *
466454 * Return: negative value when check fails and 0 otherwise. The negative value
467455 * depends on the reason: -ENODATA for bad header, -EBADR for broadcast
....@@ -1047,6 +1035,8 @@
10471035 hdr_size))
10481036 goto rx_success;
10491037
1038
+ batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size);
1039
+
10501040 batadv_interface_rx(recv_if->soft_iface, skb, hdr_size,
10511041 orig_node);
10521042
....@@ -1127,7 +1117,7 @@
11271117 * @recv_if: interface that the skb is received on
11281118 *
11291119 * 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
11311121 * lack further fragments; 3) Merge fragments, if we have all needed parts.
11321122 *
11331123 * Return: NET_RX_DROP if the skb is not consumed, NET_RX_SUCCESS otherwise.
....@@ -1282,6 +1272,8 @@
12821272 if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size))
12831273 goto rx_success;
12841274
1275
+ batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size);
1276
+
12851277 /* broadcast for me */
12861278 batadv_interface_rx(recv_if->soft_iface, skb, hdr_size, orig_node);
12871279