* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
{
ifp->node->info = NULL;
route_unlock_node(ifp->node);
+ ifp->node = NULL;
}
/* Look up an interface by identifier within a NS */
return ifp;
}
+/* Look up an interface by name within a NS */
+struct interface *
+if_lookup_by_name_per_ns (struct zebra_ns *ns, const char *ifname)
+{
+ struct route_node *rn;
+ struct interface *ifp;
+
+ for (rn = route_top (ns->if_table); rn; rn = route_next (rn))
+ {
+ ifp = (struct interface *)rn->info;
+ if (ifp && strcmp (ifp->name, ifname) == 0)
+ return (ifp);
+ }
+
+ return NULL;
+}
+
const char *
ifindex2ifname_per_ns (struct zebra_ns *zns, unsigned int ifindex)
{
for setting ifindex to IFINDEX_INTERNAL after processing the
interface deletion message. */
ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->node = NULL;
+
+ /* if the ifp is in a vrf, move it to default so vrf can be deleted if desired */
+ if (ifp->vrf_id)
+ if_handle_vrf_change (ifp, VRF_DEFAULT);
}
/* VRF change for an interface */
struct in6_addr *address,
int add)
{
+ struct zebra_vrf *zvrf = vrf_info_lookup(ifp->vrf_id);
char buf[16] = "169.254.0.1";
struct in_addr ipv4_ll;
char mac[6];
ipv6_ll_address_to_mac(address, (u_char *)mac);
kernel_neigh_update (add, ifp->ifindex, ipv4_ll.s_addr, mac, 6);
+ zvrf->neigh_updates++;
}
static void
if_nbr_ipv6ll_to_ipv4ll_neigh_add_all (ifp);
+#if defined (HAVE_RTADV)
/* Enable fast tx of RA if enabled && RA interval is not in msecs */
if (zif->rtadv.AdvSendAdvertisements &&
(zif->rtadv.MaxRtrAdvInterval >= 1000))
zif->rtadv.inFastRexmit = 1;
zif->rtadv.NumFastReXmitsRemain = RTADV_NUM_FAST_REXMITS;
}
+#endif
/* Install connected routes to the kernel. */
if_install_connected (ifp);
return;
}
- vty_out (vty, " index %d metric %d mtu %d ",
- ifp->ifindex, ifp->metric, ifp->mtu);
+ vty_out (vty, " index %d metric %d mtu %d speed %u ",
+ ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed);
if (ifp->mtu6 != ifp->mtu)
vty_out (vty, "mtu6 %d ", ifp->mtu6);
vty_out (vty, "%s flags: %s%s", VTY_NEWLINE,
static void
link_param_cmd_unset (struct interface *ifp, uint32_t type)
{
+ if (ifp->link_params == NULL)
+ return;
/* Unset field */
UNSET_PARAM(ifp->link_params, type);
zebra_interface_parameters_update (ifp);
}
-DEFUN (link_params,
+DEFUN_NOSH (link_params,
link_params_cmd,
"link-params",
LINK_PARAMS_STR)
return CMD_SUCCESS;
}
-DEFUN (exit_link_params,
+DEFUN_NOSH (exit_link_params,
exit_link_params_cmd,
"exit-link-params",
"Exit from Link Params configuration mode\n")