b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From fcb30aa4da732d279527feba01cacc7dc996d137 Mon Sep 17 00:00:00 2001 |
| 2 | From: Nick Hainke <vincent@systemli.org> |
| 3 | Date: Sun, 16 Jan 2022 00:08:56 +0100 |
| 4 | Subject: [PATCH] unix: fix meshing with wireguard/point-to-point interfaces |
| 5 | |
| 6 | Wireguard interfaces have no BROADCAST flag. We can also mesh on |
| 7 | point-to-point links. That is why we mesh now also on interfaces with |
| 8 | the IFF_POINTOPOINT flag enabled. |
| 9 | |
| 10 | Signed-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 | |