static void
vrrp_vrid_handler(vector strvec)
{
	vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
	vrrp->vrid = atoi(VECTOR_SLOT(strvec, 1));

	if (VRRP_IS_BAD_VID(vrrp->vrid)) {
		log_message(LOG_INFO, "VRRP Error : VRID not valid !\n");
		log_message(LOG_INFO,
		       "             must be between 1 & 255. reconfigure !\n");
	} else
		alloc_vrrp_bucket(vrrp);
}
Esempio n. 2
0
static void
vrrp_vrid_handler(vector_t *strvec)
{
	vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
	vrrp->vrid = atoi(vector_slot(strvec, 1));

	if (VRRP_IS_BAD_VID(vrrp->vrid)) {
		log_message(LOG_INFO, "VRRP Error : VRID not valid !");
		log_message(LOG_INFO,
		       "             must be between 1 & 255. reconfigure !");

		vrrp->vrid = 0;
		return;
	}

	alloc_vrrp_bucket(vrrp);
}
Esempio n. 3
0
static void
vrrp_vrid_handler(vector_t *strvec)
{
	vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
	vrrp->vrid = atoi(vector_slot(strvec, 1));

	if (VRRP_IS_BAD_VID(vrrp->vrid)) {
		log_message(LOG_INFO, "VRRP Error : VRID not valid !");
		log_message(LOG_INFO,
		       "             must be between 1 & 255. reconfigure !");
	} else {
		alloc_vrrp_bucket(vrrp);
		if (vrrp->vmac_flags & VRRP_VMAC_FL_SET) {
			if (strlen(vrrp->vmac_ifname) == 0)
				snprintf(vrrp->vmac_ifname, IFNAMSIZ, "vrrp.%d", vrrp->vrid);
			netlink_link_add_vmac(vrrp);
		}
	}
}
Esempio n. 4
0
static void
vrrp_vrid_handler(vector_t *strvec)
{
	vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
	vrrp->vrid = atoi(vector_slot(strvec, 1));

	if (VRRP_IS_BAD_VID(vrrp->vrid)) {
		log_message(LOG_INFO, "VRRP Error : VRID not valid !");
		log_message(LOG_INFO,
		       "             must be between 1 & 255. reconfigure !");
	} else {
		alloc_vrrp_bucket(vrrp);
		if (vrrp->vmac && strlen(vrrp->vmac_ifname) == 0) {
			snprintf(vrrp->vmac_ifname, IFNAMSIZ, "vrrp.%d"
						  , vrrp->vrid);
			log_message(LOG_INFO, "vmac_ifname=%s for vrrp_instace %s"
					    , vrrp->vmac_ifname
					    , vrrp->iname);
		}
	}
}