Skip to content

Commit 97114c4

Browse files
committed
Handle LQ packets for isolated interfaces
1 parent 1c9829e commit 97114c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lq_packet.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ create_lq_hello(struct lq_hello_message *lq_hello, struct interface_olsr *outif)
111111
bool neigh_is_new = false;
112112
uint8_t link_type;
113113

114+
/* Exclude neighbors from other interfaces is this is isolated */
115+
if (outif->mode == IF_MODE_ISOLATED && !ipequal(&walker->local_iface_addr, &outif->ip_addr)) {
116+
continue;
117+
}
118+
114119
// allocate a neighbour entry
115120
neigh = neigh_find(lq_hello, walker);
116121
if (!neigh) {
@@ -256,6 +261,11 @@ create_lq_tc(struct lq_tc_message *lq_tc, struct interface_olsr *outif)
256261
continue; // no link ?
257262
}
258263

264+
/* Don't include if this is an isolated interface */
265+
if (outif->mode == IF_MODE_ISOLATED && outif != lnk->inter) {
266+
continue;
267+
}
268+
259269
if (lnk->linkcost >= LINK_COST_BROKEN) {
260270
continue; // don't advertise links with very low LQ
261271
}

0 commit comments

Comments
 (0)