summaryrefslogtreecommitdiff
path: root/proto/rip/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-03-14 17:04:49 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-03-14 17:04:49 +0100
commitd516c68ad838351fa5e20e3e10bd3fb2b3157618 (patch)
tree84ec0fcda3700affdf4299b560271eded166dcf9 /proto/rip/packets.c
parentdc042d87cb68e44b49e9f4f153db444afaa00fba (diff)
RIP: Improvements to demand circuit mode
Restart iface after changing demand circuit mode during reconfiguration. Fix next_regular interval reset during reconfiguration. Send flushing response when iface goes down.
Diffstat (limited to 'proto/rip/packets.c')
-rw-r--r--proto/rip/packets.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/proto/rip/packets.c b/proto/rip/packets.c
index 8de691af..9c3bd7a3 100644
--- a/proto/rip/packets.c
+++ b/proto/rip/packets.c
@@ -780,6 +780,25 @@ rip_receive_response(struct rip_proto *p, struct rip_iface *ifa, struct rip_pack
}
}
+int
+rip_send_flush(struct rip_proto *p, struct rip_iface *ifa)
+{
+ /* Caller should handle cleanup of pending response */
+ if (ifa->tx_pending)
+ return 0;
+
+ struct rip_packet *pkt = rip_tx_buffer(ifa);
+
+ rip_fill_header(ifa, pkt, RIP_CMD_UPDATE_RESPONSE);
+ rip_fill_update_hdr(pkt, 1, ifa->tx_seqnum);
+
+ /* We suppose that iface is going down, so we do not expect ACK */
+ ifa->tx_seqnum++;
+
+ TRACE(D_PACKETS, "Sending response via %s", ifa->iface->name);
+ return rip_send_to(p, ifa, pkt, rip_pkt_hdrlen(ifa), ifa->tx_addr);
+}
+
static int
rip_send_ack(struct rip_proto *p, struct rip_iface *ifa, uint flush, uint seqnum)