summaryrefslogtreecommitdiff
path: root/zebra/interface.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 /zebra/interface.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 'zebra/interface.c')
-rw-r--r--zebra/interface.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 5664f41a..a1d0332a 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1107,7 +1107,6 @@ ip_address_install (struct vty *vty, struct interface *ifp,
struct prefix_ipv4 cp;
struct connected *ifc;
struct prefix_ipv4 *p;
- struct in_addr mask;
int ret;
ret = str2prefix_ipv4 (addr_str, &cp);
@@ -1129,12 +1128,11 @@ ip_address_install (struct vty *vty, struct interface *ifp,
ifc->address = (struct prefix *) p;
/* Broadcast. */
- if (p->prefixlen <= 30)
+ if (p->prefixlen <= IPV4_MAX_PREFIXLEN-2)
{
p = prefix_ipv4_new ();
*p = cp;
- masklen2ip (p->prefixlen, &mask);
- p->prefix.s_addr |= ~mask.s_addr;
+ p->prefix.s_addr = ipv4_broadcast_addr(p->prefix.s_addr,p->prefixlen);
ifc->destination = (struct prefix *) p;
}