mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
Merge pull request #5226 from donaldsharp/interface_fixup
Interface fixup
This commit is contained in:
commit
d4b391321d
@ -99,6 +99,9 @@ struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp,
|
|||||||
ei->params.auth_type = EIGRP_AUTH_TYPE_NONE;
|
ei->params.auth_type = EIGRP_AUTH_TYPE_NONE;
|
||||||
ei->params.auth_keychain = NULL;
|
ei->params.auth_keychain = NULL;
|
||||||
|
|
||||||
|
ei->curr_bandwidth = ifp->bandwidth;
|
||||||
|
ei->curr_mtu = ifp->mtu;
|
||||||
|
|
||||||
return ei;
|
return ei;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,45 +142,40 @@ static int eigrp_ifp_create(struct interface *ifp)
|
|||||||
|
|
||||||
static int eigrp_ifp_up(struct interface *ifp)
|
static int eigrp_ifp_up(struct interface *ifp)
|
||||||
{
|
{
|
||||||
/* Interface is already up. */
|
struct eigrp_interface *ei = ifp->info;
|
||||||
if (if_is_operative(ifp)) {
|
|
||||||
/* Temporarily keep ifp values. */
|
|
||||||
struct interface if_tmp;
|
|
||||||
memcpy(&if_tmp, ifp, sizeof(struct interface));
|
|
||||||
|
|
||||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
|
||||||
zlog_debug("Zebra: Interface[%s] state update.",
|
|
||||||
ifp->name);
|
|
||||||
|
|
||||||
if (if_tmp.bandwidth != ifp->bandwidth) {
|
|
||||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
|
||||||
zlog_debug(
|
|
||||||
"Zebra: Interface[%s] bandwidth change %d -> %d.",
|
|
||||||
ifp->name, if_tmp.bandwidth,
|
|
||||||
ifp->bandwidth);
|
|
||||||
|
|
||||||
// eigrp_if_recalculate_output_cost (ifp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (if_tmp.mtu != ifp->mtu) {
|
|
||||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
|
||||||
zlog_debug(
|
|
||||||
"Zebra: Interface[%s] MTU change %u -> %u.",
|
|
||||||
ifp->name, if_tmp.mtu, ifp->mtu);
|
|
||||||
|
|
||||||
/* Must reset the interface (simulate down/up) when MTU
|
|
||||||
* changes. */
|
|
||||||
eigrp_if_reset(ifp);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
||||||
zlog_debug("Zebra: Interface[%s] state change to up.",
|
zlog_debug("Zebra: Interface[%s] state change to up.",
|
||||||
ifp->name);
|
ifp->name);
|
||||||
|
|
||||||
if (ifp->info)
|
if (!ei)
|
||||||
eigrp_if_up(ifp->info);
|
return 0;
|
||||||
|
|
||||||
|
if (ei->curr_bandwidth != ifp->bandwidth) {
|
||||||
|
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
||||||
|
zlog_debug(
|
||||||
|
"Zebra: Interface[%s] bandwidth change %d -> %d.",
|
||||||
|
ifp->name, ei->curr_bandwidth,
|
||||||
|
ifp->bandwidth);
|
||||||
|
|
||||||
|
ei->curr_bandwidth = ifp->bandwidth;
|
||||||
|
// eigrp_if_recalculate_output_cost (ifp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ei->curr_mtu != ifp->mtu) {
|
||||||
|
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
||||||
|
zlog_debug(
|
||||||
|
"Zebra: Interface[%s] MTU change %u -> %u.",
|
||||||
|
ifp->name, ei->curr_mtu, ifp->mtu);
|
||||||
|
|
||||||
|
ei->curr_mtu = ifp->mtu;
|
||||||
|
/* Must reset the interface (simulate down/up) when MTU
|
||||||
|
* changes. */
|
||||||
|
eigrp_if_reset(ifp);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
eigrp_if_up(ifp->info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,8 @@ struct eigrp_interface {
|
|||||||
|
|
||||||
/* To which multicast groups do we currently belong? */
|
/* To which multicast groups do we currently belong? */
|
||||||
|
|
||||||
|
uint32_t curr_bandwidth;
|
||||||
|
uint32_t curr_mtu;
|
||||||
|
|
||||||
uint8_t multicast_memberships;
|
uint8_t multicast_memberships;
|
||||||
|
|
||||||
|
@ -636,9 +636,13 @@ void ospf_if_update_params(struct interface *ifp, struct in_addr addr)
|
|||||||
int ospf_if_new_hook(struct interface *ifp)
|
int ospf_if_new_hook(struct interface *ifp)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
struct ospf_if_info *oii;
|
||||||
|
|
||||||
ifp->info = XCALLOC(MTYPE_OSPF_IF_INFO, sizeof(struct ospf_if_info));
|
ifp->info = XCALLOC(MTYPE_OSPF_IF_INFO, sizeof(struct ospf_if_info));
|
||||||
|
|
||||||
|
oii = ifp->info;
|
||||||
|
oii->curr_mtu = ifp->mtu;
|
||||||
|
|
||||||
IF_OIFS(ifp) = route_table_init();
|
IF_OIFS(ifp) = route_table_init();
|
||||||
IF_OIFS_PARAMS(ifp) = route_table_init();
|
IF_OIFS_PARAMS(ifp) = route_table_init();
|
||||||
|
|
||||||
@ -1261,31 +1265,21 @@ static int ospf_ifp_up(struct interface *ifp)
|
|||||||
{
|
{
|
||||||
struct ospf_interface *oi;
|
struct ospf_interface *oi;
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
|
struct ospf_if_info *oii = ifp->info;
|
||||||
|
|
||||||
/* Interface is already up. */
|
ospf_if_recalculate_output_cost(ifp);
|
||||||
if (if_is_operative(ifp)) {
|
|
||||||
/* Temporarily keep ifp values. */
|
|
||||||
struct interface if_tmp;
|
|
||||||
memcpy(&if_tmp, ifp, sizeof(struct interface));
|
|
||||||
|
|
||||||
|
if (oii && oii->curr_mtu != ifp->mtu) {
|
||||||
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"Zebra: Interface[%s] state update speed %u -> %u, bw %d -> %d",
|
"Zebra: Interface[%s] MTU change %u -> %u.",
|
||||||
ifp->name, if_tmp.speed, ifp->speed,
|
ifp->name, oii->curr_mtu, ifp->mtu);
|
||||||
if_tmp.bandwidth, ifp->bandwidth);
|
|
||||||
|
|
||||||
ospf_if_recalculate_output_cost(ifp);
|
oii->curr_mtu = ifp->mtu;
|
||||||
|
/* Must reset the interface (simulate down/up) when MTU
|
||||||
|
* changes. */
|
||||||
|
ospf_if_reset(ifp);
|
||||||
|
|
||||||
if (if_tmp.mtu != ifp->mtu) {
|
|
||||||
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
|
||||||
zlog_debug(
|
|
||||||
"Zebra: Interface[%s] MTU change %u -> %u.",
|
|
||||||
ifp->name, if_tmp.mtu, ifp->mtu);
|
|
||||||
|
|
||||||
/* Must reset the interface (simulate down/up) when MTU
|
|
||||||
* changes. */
|
|
||||||
ospf_if_reset(ifp);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,6 +117,8 @@ struct ospf_if_info {
|
|||||||
struct route_table *oifs;
|
struct route_table *oifs;
|
||||||
unsigned int
|
unsigned int
|
||||||
membership_counts[MEMBER_MAX]; /* multicast group refcnts */
|
membership_counts[MEMBER_MAX]; /* multicast group refcnts */
|
||||||
|
|
||||||
|
uint32_t curr_mtu;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ospf_interface;
|
struct ospf_interface;
|
||||||
|
@ -4154,7 +4154,7 @@ DEFUN (show_ip_ospf_interface_traffic,
|
|||||||
|
|
||||||
static void show_ip_ospf_neighbour_header(struct vty *vty)
|
static void show_ip_ospf_neighbour_header(struct vty *vty)
|
||||||
{
|
{
|
||||||
vty_out(vty, "\n%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s\n",
|
vty_out(vty, "\n%-15s %3s %-15s %9s %-15s %-32s %5s %5s %5s\n",
|
||||||
"Neighbor ID", "Pri", "State", "Dead Time", "Address",
|
"Neighbor ID", "Pri", "State", "Dead Time", "Address",
|
||||||
"Interface", "RXmtL", "RqstL", "DBsmL");
|
"Interface", "RXmtL", "RqstL", "DBsmL");
|
||||||
}
|
}
|
||||||
@ -4260,7 +4260,7 @@ static void show_ip_ospf_neighbor_sub(struct vty *vty,
|
|||||||
timebuf,
|
timebuf,
|
||||||
sizeof(timebuf)));
|
sizeof(timebuf)));
|
||||||
vty_out(vty, "%-15s ", inet_ntoa(nbr->src));
|
vty_out(vty, "%-15s ", inet_ntoa(nbr->src));
|
||||||
vty_out(vty, "%-20s %5ld %5ld %5d\n",
|
vty_out(vty, "%-32s %5ld %5ld %5d\n",
|
||||||
IF_NAME(oi),
|
IF_NAME(oi),
|
||||||
ospf_ls_retransmit_count(nbr),
|
ospf_ls_retransmit_count(nbr),
|
||||||
ospf_ls_request_count(nbr),
|
ospf_ls_request_count(nbr),
|
||||||
@ -4524,7 +4524,7 @@ static int show_ip_ospf_neighbor_all_common(struct vty *vty, struct ospf *ospf,
|
|||||||
"-", nbr_nbma->priority, "Down",
|
"-", nbr_nbma->priority, "Down",
|
||||||
"-");
|
"-");
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
"%-15s %-20s %5d %5d %5d\n",
|
"%-32s %-20s %5d %5d %5d\n",
|
||||||
inet_ntoa(nbr_nbma->addr),
|
inet_ntoa(nbr_nbma->addr),
|
||||||
IF_NAME(oi), 0, 0, 0);
|
IF_NAME(oi), 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -1481,6 +1481,13 @@ void pim_if_create_pimreg(struct pim_instance *pim)
|
|||||||
|
|
||||||
pim_if_new(pim->regiface, false, false, true,
|
pim_if_new(pim->regiface, false, false, true,
|
||||||
false /*vxlan_term*/);
|
false /*vxlan_term*/);
|
||||||
|
/*
|
||||||
|
* On vrf moves we delete the interface if there
|
||||||
|
* is nothing going on with it. We cannot have
|
||||||
|
* the pimregiface deleted.
|
||||||
|
*/
|
||||||
|
pim->regiface->configured = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1581,6 +1588,7 @@ int pim_ifp_create(struct interface *ifp)
|
|||||||
|
|
||||||
int pim_ifp_up(struct interface *ifp)
|
int pim_ifp_up(struct interface *ifp)
|
||||||
{
|
{
|
||||||
|
struct pim_interface *pim_ifp;
|
||||||
struct pim_instance *pim;
|
struct pim_instance *pim;
|
||||||
uint32_t table_id;
|
uint32_t table_id;
|
||||||
|
|
||||||
@ -1593,24 +1601,21 @@ int pim_ifp_up(struct interface *ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pim = pim_get_pim_instance(ifp->vrf_id);
|
pim = pim_get_pim_instance(ifp->vrf_id);
|
||||||
if (if_is_operative(ifp)) {
|
|
||||||
struct pim_interface *pim_ifp;
|
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
/*
|
/*
|
||||||
* If we have a pim_ifp already and this is an if_add
|
* If we have a pim_ifp already and this is an if_add
|
||||||
* that means that we probably have a vrf move event
|
* that means that we probably have a vrf move event
|
||||||
* If that is the case, set the proper vrfness.
|
* If that is the case, set the proper vrfness.
|
||||||
*/
|
*/
|
||||||
if (pim_ifp)
|
if (pim_ifp)
|
||||||
pim_ifp->pim = pim;
|
pim_ifp->pim = pim;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pim_if_addr_add_all() suffices for bringing up both IGMP and
|
pim_if_addr_add_all() suffices for bringing up both IGMP and
|
||||||
PIM
|
PIM
|
||||||
*/
|
*/
|
||||||
pim_if_addr_add_all(ifp);
|
pim_if_addr_add_all(ifp);
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have a pimreg device callback and it's for a specific
|
* If we have a pimreg device callback and it's for a specific
|
||||||
|
Loading…
Reference in New Issue
Block a user