diff options
| author | Juergen Werner <pogojotz@gmx.net> | 2019-08-10 11:52:03 +0200 |
|---|---|---|
| committer | Juergen Werner <juergen@opensourcerouting.org> | 2019-08-18 18:54:46 +0200 |
| commit | 0f3af7386e70d8c88453ad1a4252d116240b1416 (patch) | |
| tree | ce152fe6b45b2ddc448b26935514b16b176fd5c5 /zebra/interface.c | |
| parent | ba5d0acfc0db9d44cc4061a6f746f565820cc5d4 (diff) | |
zebra: Do not use connection dest for bcast
The `destination` field of the connection structure was used to store
the broadcast address, if the connection was not p2p. This multipurpose
is not very evident and the benefits over calculating the bcast address
on the fly minimal.
Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 732e900bbd..e82d2eeb37 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1081,12 +1081,10 @@ static void connected_dump_vty(struct vty *vty, struct connected *connected) vty_out(vty, "/%d", p->prefixlen); /* If there is destination address, print it. */ - if (connected->destination) { - vty_out(vty, - (CONNECTED_PEER(connected) ? " peer " : " broadcast ")); + if (CONNECTED_PEER(connected) && connected->destination) { + vty_out(vty, " peer "); prefix_vty_out(vty, connected->destination); - if (CONNECTED_PEER(connected)) - vty_out(vty, "/%d", connected->destination->prefixlen); + vty_out(vty, "/%d", connected->destination->prefixlen); } if (CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY)) @@ -2675,12 +2673,6 @@ static int ip_address_install(struct vty *vty, struct interface *ifp, p = prefix_ipv4_new(); *p = pp; ifc->destination = (struct prefix *)p; - } else if (p->prefixlen <= IPV4_MAX_PREFIXLEN - 2) { - p = prefix_ipv4_new(); - *p = lp; - p->prefix.s_addr = ipv4_broadcast_addr(p->prefix.s_addr, - p->prefixlen); - ifc->destination = (struct prefix *)p; } /* Label. */ |
