if (exist_id != VRF_DEFAULT) {
vrf = vrf_lookup_by_id(exist_id);
- flog_err(
- EC_ZEBRA_VRF_MISCONFIGURED,
- "VRF %s id %u table id overlaps existing vrf %s(%d), misconfiguration exiting",
- name, ifindex, vrf->name, vrf->vrf_id);
+ if (vrf)
+ flog_err(EC_ZEBRA_VRF_MISCONFIGURED,
+ "VRF %s id %u table id overlaps existing vrf %s(%d), misconfiguration exiting",
+ name, ifindex, vrf->name,
+ vrf->vrf_id);
+ else
+ flog_err(EC_ZEBRA_VRF_NOT_FOUND,
+ "VRF %s id %u does not exist",
+ name, ifindex);
+
exit(-1);
}
}