[Olsr-dev] [olsrd] [PATCH v3 2/2] gateway: only advertise linkspeed when the link is bi-directional
Ferry Huberts
(spam-protected)
Thu Jul 19 09:54:53 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 ee122b7..74b7d19 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