summaryrefslogtreecommitdiff
path: root/ripd/ripd.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-19 19:44:43 +0000
committerhasso <hasso>2004-10-19 19:44:43 +0000
commit3fb9cd6ef456959b6eff939d5c316f6785c2dda4 (patch)
treee350cb3ef7b20b8bbccfb1aa9309152311e845bd /ripd/ripd.c
parent5ae35f45f1292dce3a01f241accafeb2e59b10cc (diff)
OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,
ripd might need some more testing though.
Diffstat (limited to 'ripd/ripd.c')
-rw-r--r--ripd/ripd.c16
1 files changed, 9 insertions, 7 deletions
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)