blob: caca877beec3f548db83045a88144c3a5579c8ea [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From fcb30aa4da732d279527feba01cacc7dc996d137 Mon Sep 17 00:00:00 2001
2From: Nick Hainke <vincent@systemli.org>
3Date: Sun, 16 Jan 2022 00:08:56 +0100
4Subject: [PATCH] unix: fix meshing with wireguard/point-to-point interfaces
5
6Wireguard interfaces have no BROADCAST flag. We can also mesh on
7point-to-point links. That is why we mesh now also on interfaces with
8the IFF_POINTOPOINT flag enabled.
9
10Signed-off-by: Nick Hainke <vincent@systemli.org>
11---
12 src/unix/ifnet.c | 8 ++++----
13 1 file changed, 4 insertions(+), 4 deletions(-)
14
15--- a/src/unix/ifnet.c
16+++ b/src/unix/ifnet.c
17@@ -184,8 +184,8 @@ chk_if_changed(struct olsr_if *iface)
18
19 /* Check broadcast */
20 if ((olsr_cnf->ip_version == AF_INET) && !iface->cnf->ipv4_multicast.v4.s_addr && /* Skip if fixed bcast */
21- (!(ifp->int_flags & IFF_BROADCAST))) {
22- OLSR_PRINTF(3, "\tNo broadcast - removing\n");
23+ ((!(ifp->int_flags & IFF_BROADCAST) && !(ifp->int_flags & IFF_POINTOPOINT)))) {
24+ OLSR_PRINTF(3, "\tNo broadcast or point-to-point - removing\n");
25 goto remove_interface;
26 }
27
28@@ -552,8 +552,8 @@ chk_if_up(struct olsr_if *iface, int deb
29
30 /* Check broadcast */
31 if ((olsr_cnf->ip_version == AF_INET) && !iface->cnf->ipv4_multicast.v4.s_addr && /* Skip if fixed bcast */
32- (!(ifs.int_flags & IFF_BROADCAST))) {
33- OLSR_PRINTF(debuglvl, "\tNo broadcast - skipping\n");
34+ (!(ifs.int_flags & IFF_BROADCAST) && !(ifs.int_flags & IFF_POINTOPOINT))) {
35+ OLSR_PRINTF(debuglvl, "\tNo broadcast or point-to-point - skipping\n");
36 return 0;
37 }
38