gateway: minor simplification to olsr_delete_gateway_entry
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 24 Jul 2012 15:33:11 +0000 (17:33 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Jul 2012 06:55:06 +0000 (08:55 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 041d2f6..f7ba1b0 100644 (file)
@@ -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 */