[Olsr-dev] [olsrd] [PATCH v2 2/2] gateway: only advertise linkspeed when the link is bi-directional
Ferry Huberts
(spam-protected)
Wed Jul 18 18:30:38 CEST 2012
From: Ferry Huberts <(spam-protected)>
Uni-directional links produce all kinds of funky network behaviour.
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/gateway.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/gateway.c b/src/gateway.c
index 67b5779..5655374 100644
--- a/src/gateway.c
+++ b/src/gateway.c
@@ -131,7 +131,8 @@ void refresh_smartgw_netmask(void) {
ip = (uint8_t *) &smart_gateway_netmask;
- if (olsr_cnf->smart_gw_uplink > 0 || olsr_cnf->smart_gw_downlink > 0) {
+ if (olsr_cnf->smart_gw_uplink > 0 && olsr_cnf->smart_gw_downlink > 0) {
+ /* the link is bi-directional with a non-zero bandwidth */
ip[GW_HNA_FLAGS] |= GW_HNA_FLAG_LINKSPEED;
ip[GW_HNA_DOWNLINK] = serialize_gw_speed(olsr_cnf->smart_gw_downlink);
ip[GW_HNA_UPLINK] = serialize_gw_speed(olsr_cnf->smart_gw_uplink);
--
1.7.10.4
More information about the Olsr-dev
mailing list