From 3fb9cd6ef456959b6eff939d5c316f6785c2dda4 Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 19 Oct 2004 19:44:43 +0000 Subject: OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd, ripd might need some more testing though. --- ripd/ripd.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'ripd/ripd.c') diff --git a/ripd/ripd.c b/ripd/ripd.c index 2b4e1b2f..94324f03 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2391,7 +2391,6 @@ void rip_update_interface (struct interface *ifp, u_char version, int route_type, struct connected *sconn) { - struct prefix_ipv4 *p; struct connected *connected; struct listnode *node; struct sockaddr_in to; @@ -2415,15 +2414,18 @@ rip_update_interface (struct interface *ifp, u_char version, int route_type, { connected = getdata (node); - /* Fetch broadcast address or poin-to-point destination - address . */ - p = (struct prefix_ipv4 *) connected->destination; - - if (p->family == AF_INET) + if (connected->address->family == AF_INET) { /* Destination address and port setting. */ memset (&to, 0, sizeof (struct sockaddr_in)); - to.sin_addr = p->prefix; + if (connected->destination) + /* use specified broadcast or point-to-point destination addr */ + to.sin_addr = connected->destination->u.prefix4; + else + /* calculate the appropriate broadcast address */ + to.sin_addr.s_addr = + ipv4_broadcast_addr(connected->address->u.prefix4.s_addr, + connected->address->prefixlen); to.sin_port = htons (RIP_PORT_DEFAULT); if (IS_RIP_DEBUG_EVENT) -- cgit v1.2.3