summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ripd/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ripd/message.c')
-rw-r--r--usr.sbin/ripd/message.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/usr.sbin/ripd/message.c b/usr.sbin/ripd/message.c
index 62d2fc33578..be56650f6fd 100644
--- a/usr.sbin/ripd/message.c
+++ b/usr.sbin/ripd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.14 2019/12/09 20:49:40 remi Exp $ */
+/* $OpenBSD: message.c,v 1.15 2019/12/15 20:51:39 remi Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -105,15 +105,15 @@ send_triggered_update(struct iface *iface, struct rip_route *rr)
u_int16_t afi, route_tag;
u_int32_t address, netmask, nexthop, metric;
+ if (iface->passive)
+ return (0);
+
inet_aton(ALL_RIP_ROUTERS, &dst.sin_addr);
dst.sin_port = htons(RIP_PORT);
dst.sin_family = AF_INET;
dst.sin_len = sizeof(struct sockaddr_in);
- if (iface->passive)
- return (0);
-
if ((buf = ibuf_open(iface->mtu - sizeof(struct ip) -
sizeof(struct udphdr))) == NULL)
fatal("send_triggered_update");
@@ -166,13 +166,15 @@ send_request(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
port = htons(RIP_PORT);
}
+ if (iface->passive) {
+ clear_list(r_list);
+ return (0);
+ }
+
dst.sin_port = port;
dst.sin_family = AF_INET;
dst.sin_len = sizeof(struct sockaddr_in);
- if (iface->passive)
- return (0);
-
while (!TAILQ_EMPTY(r_list)) {
if ((buf = ibuf_open(iface->mtu - sizeof(struct ip) -
sizeof(struct udphdr))) == NULL)
@@ -240,13 +242,15 @@ send_response(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
port = htons(RIP_PORT);
}
+ if (iface->passive) {
+ clear_list(r_list);
+ return (0);
+ }
+
dst.sin_port = port;
dst.sin_family = AF_INET;
dst.sin_len = sizeof(struct sockaddr_in);
- if (iface->passive)
- return (0);
-
while (!TAILQ_EMPTY(r_list)) {
if ((buf = ibuf_open(iface->mtu - sizeof(struct ip) -
sizeof(struct udphdr))) == NULL)