diff options
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1090,9 +1090,6 @@ struct if_link_params *if_link_params_get(struct interface *ifp) struct if_link_params *iflp = XCALLOC(MTYPE_IF_LINK_PARAMS, sizeof(struct if_link_params)); - /* Set TE metric equal to standard metric */ - iflp->te_metric = ifp->metric; - /* Compute default bandwidth based on interface */ iflp->default_bw = ((ifp->bandwidth ? ifp->bandwidth : DEFAULT_BANDWIDTH) @@ -1105,8 +1102,13 @@ struct if_link_params *if_link_params_get(struct interface *ifp) iflp->unrsv_bw[i] = iflp->default_bw; /* Update Link parameters status */ - iflp->lp_status = - LP_TE_METRIC | LP_MAX_BW | LP_MAX_RSV_BW | LP_UNRSV_BW; + iflp->lp_status = LP_MAX_BW | LP_MAX_RSV_BW | LP_UNRSV_BW; + + /* Set TE metric equal to standard metric only if it is set */ + if (ifp->metric != 0) { + iflp->te_metric = ifp->metric; + iflp->lp_status |= LP_TE_METRIC; + } /* Finally attach newly created Link Parameters */ ifp->link_params = iflp; |
