Commit c7b44dac by Juliusz Chroboczek

Make flush_interface return a value.

1 parent c4438c80
...@@ -95,7 +95,7 @@ add_interface(char *ifname, struct interface_conf *if_conf) ...@@ -95,7 +95,7 @@ add_interface(char *ifname, struct interface_conf *if_conf)
return ifp; return ifp;
} }
void int
flush_interface(char *ifname) flush_interface(char *ifname)
{ {
struct interface *ifp, *prev; struct interface *ifp, *prev;
...@@ -109,10 +109,9 @@ flush_interface(char *ifname) ...@@ -109,10 +109,9 @@ flush_interface(char *ifname)
ifp = ifp->next; ifp = ifp->next;
} }
if(ifp == NULL) { if(ifp == NULL)
fprintf(stderr, "Warning: attempting to flush nonexistent interface.\n"); return 0;
return;
}
interface_up(ifp, 0); interface_up(ifp, 0);
if(prev) if(prev)
prev->next = ifp->next; prev->next = ifp->next;
...@@ -127,6 +126,8 @@ flush_interface(char *ifname) ...@@ -127,6 +126,8 @@ flush_interface(char *ifname)
local_notify_interface(ifp, LOCAL_FLUSH); local_notify_interface(ifp, LOCAL_FLUSH);
free(ifp); free(ifp);
return 1;
} }
/* This should be no more than half the hello interval, so that hellos /* This should be no more than half the hello interval, so that hellos
......
...@@ -123,7 +123,7 @@ if_up(struct interface *ifp) ...@@ -123,7 +123,7 @@ if_up(struct interface *ifp)
} }
struct interface *add_interface(char *ifname, struct interface_conf *if_conf); struct interface *add_interface(char *ifname, struct interface_conf *if_conf);
void flush_interface(char *ifname); int flush_interface(char *ifname);
unsigned jitter(struct interface *ifp, int urgent); unsigned jitter(struct interface *ifp, int urgent);
unsigned update_jitter(struct interface *ifp, int urgent); unsigned update_jitter(struct interface *ifp, int urgent);
void set_timeout(struct timeval *timeout, int msecs); void set_timeout(struct timeval *timeout, int msecs);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!