sd-ndisc: Reset counter for sent Router Solicitations (#5874)
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 2 May 2017 19:36:24 +0000 (22:36 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 2 May 2017 19:36:24 +0000 (15:36 -0400)
Reset also the counter for number of Router Solicitations sent when
the associated file descriptor is closed and the event source
unreferenced. With this change the router discovery can now be
stopped and restarted arbitrary many times.

src/libsystemd-network/sd-ndisc.c

index 1d3be9b..83e57d4 100644 (file)
@@ -131,6 +131,7 @@ static int ndisc_reset(sd_ndisc *nd) {
         nd->timeout_event_source = sd_event_source_unref(nd->timeout_event_source);
         nd->recv_event_source = sd_event_source_unref(nd->recv_event_source);
         nd->fd = safe_close(nd->fd);
+        nd->nd_sent = 0;
 
         return 0;
 }