[Olsr-dev] [olsrd] [PATCH v1 27/29] gateway: minor simplification to olsr_delete_gateway_entry
Ferry Huberts
(spam-protected)
Tue Jul 24 18:09:16 CEST 2012
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/gateway.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gateway.c b/src/gateway.c
index 86b3676..d5815cf 100644
--- a/src/gateway.c
+++ b/src/gateway.c
@@ -349,9 +349,9 @@ olsr_update_gateway_entry(union olsr_ip_addr *originator, union olsr_ip_addr *ma
*/
void
olsr_delete_gateway_entry(union olsr_ip_addr *originator, uint8_t prefixlen) {
- struct gateway_entry *gw;
+ struct gateway_entry *gw = olsr_find_gateway_entry(originator);
bool change = false;
- gw = olsr_find_gateway_entry(originator);
+
if (gw && (gw->cleanup_timer == NULL || gw->ipv4 || gw->ipv6)) {
/* found a gw and it wasn't deleted yet */
--
1.7.10.4
More information about the Olsr-dev
mailing list