[Olsr-dev] [PATCH v1 1/5] gateway: update logic of gw_default_delete_handler
Ferry Huberts
(spam-protected)
Mon Jul 30 15:13:13 CEST 2012
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/gateway_default_handler.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gateway_default_handler.c b/src/gateway_default_handler.c
index ec6225c..132f203 100644
--- a/src/gateway_default_handler.c
+++ b/src/gateway_default_handler.c
@@ -238,10 +238,10 @@ static void gw_default_update_handler(struct gateway_entry *gw) {
* @param gw the gateway entry
*/
static void gw_default_delete_handler(struct gateway_entry *gw) {
- bool isv4 = (gw == olsr_get_ipv4_inet_gateway(NULL));
- bool isv6 = (gw == olsr_get_ipv6_inet_gateway(NULL));
+ bool isv4 = gw && (gw == olsr_get_ipv4_inet_gateway(NULL));
+ bool isv6 = gw && (gw == olsr_get_ipv6_inet_gateway(NULL));
- if (gw && (isv4 || isv6)) {
+ if (isv4 || isv6) {
olsr_gw_default_lookup_gateway(isv4, isv6);
}
}
--
1.7.11.2
More information about the Olsr-dev
mailing list