ospfd: OSPF_[ERR|WARN] -> EC_OSPF

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2018-09-13 18:56:04 +00:00
parent e50f7cfdbd
commit cf444bcf40
15 changed files with 232 additions and 232 deletions

View File

@ -743,7 +743,7 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost,
prefix2str((struct prefix *)p, buf, prefix2str((struct prefix *)p, buf,
sizeof(buf)); sizeof(buf));
flog_warn(OSPF_WARN_LSA_MISSING, flog_warn(EC_OSPF_LSA_MISSING,
"%s: Could not refresh %s to %s", "%s: Could not refresh %s to %s",
__func__, buf, __func__, buf,
inet_ntoa(area->area_id)); inet_ntoa(area->area_id));
@ -766,7 +766,7 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost,
char buf[PREFIX2STR_BUFFER]; char buf[PREFIX2STR_BUFFER];
prefix2str((struct prefix *)p, buf, sizeof(buf)); prefix2str((struct prefix *)p, buf, sizeof(buf));
flog_warn(OSPF_WARN_LSA_MISSING, flog_warn(EC_OSPF_LSA_MISSING,
"%s: Could not originate %s to %s", __func__, "%s: Could not originate %s to %s", __func__,
buf, inet_ntoa(area->area_id)); buf, inet_ntoa(area->area_id));
return; return;
@ -1135,7 +1135,7 @@ static void ospf_abr_announce_rtr_to_area(struct prefix_ipv4 *p, uint32_t cost,
char buf[PREFIX2STR_BUFFER]; char buf[PREFIX2STR_BUFFER];
prefix2str((struct prefix *)p, buf, sizeof(buf)); prefix2str((struct prefix *)p, buf, sizeof(buf));
flog_warn(OSPF_WARN_LSA_MISSING, flog_warn(EC_OSPF_LSA_MISSING,
"%s: Could not refresh/originate %s to %s", "%s: Could not refresh/originate %s to %s",
__func__, buf, inet_ntoa(area->area_id)); __func__, buf, inet_ntoa(area->area_id));
return; return;

View File

@ -154,7 +154,7 @@ int ospf_apiserver_init(void)
ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete); ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete);
if (rc != 0) { if (rc != 0) {
flog_warn( flog_warn(
OSPF_WARN_OPAQUE_REGISTRATION, EC_OSPF_OPAQUE_REGISTRATION,
"ospf_apiserver_init: Failed to register opaque type [0/0]"); "ospf_apiserver_init: Failed to register opaque type [0/0]");
} }
@ -869,7 +869,7 @@ int ospf_apiserver_register_opaque_type(struct ospf_apiserver *apiserv,
NULL /* ospf_apiserver_lsa_delete */); NULL /* ospf_apiserver_lsa_delete */);
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(EC_OSPF_OPAQUE_REGISTRATION,
"Failed to register opaque type [%d/%d]", lsa_type, "Failed to register opaque type [%d/%d]", lsa_type,
opaque_type); opaque_type);
return OSPF_API_OPAQUETYPEINUSE; return OSPF_API_OPAQUETYPEINUSE;
@ -1665,7 +1665,7 @@ int ospf_apiserver_originate1(struct ospf_lsa *lsa)
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(ospf, lsa->oi, lsa) == NULL) { if (ospf_lsa_install(ospf, lsa->oi, lsa) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_apiserver_originate1: ospf_lsa_install failed"); "ospf_apiserver_originate1: ospf_lsa_install failed");
return -1; return -1;
} }
@ -1778,7 +1778,7 @@ struct ospf_lsa *ospf_apiserver_lsa_refresher(struct ospf_lsa *lsa)
/* Install LSA into LSDB. */ /* Install LSA into LSDB. */
if (ospf_lsa_install(ospf, new->oi, new) == NULL) { if (ospf_lsa_install(ospf, new->oi, new) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA_INSTALL_FAILURE, EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_apiserver_lsa_refresher: ospf_lsa_install failed"); "ospf_apiserver_lsa_refresher: ospf_lsa_install failed");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
goto out; goto out;

View File

@ -26,85 +26,85 @@
/* clang-format off */ /* clang-format off */
static struct log_ref ferr_ospf_warn[] = { static struct log_ref ferr_ospf_warn[] = {
{ {
.code = OSPF_WARN_SET_METRIC_PLUS, .code = EC_OSPF_SET_METRIC_PLUS,
.title = "OSPF does not support `set metric +rtt/-rtt`", .title = "OSPF does not support `set metric +rtt/-rtt`",
.description = "This implementation of OSPF does not currently support `set metric +rtt/-rtt`", .description = "This implementation of OSPF does not currently support `set metric +rtt/-rtt`",
.suggestion = "Do not use this particular set command for an ospf route-map", .suggestion = "Do not use this particular set command for an ospf route-map",
}, },
{ {
.code = OSPF_WARN_MD5, .code = EC_OSPF_MD5,
.title = "OSPF has noticed a MD5 issue", .title = "OSPF has noticed a MD5 issue",
.description = "Something has gone wrong with the calculation of the MD5 data", .description = "Something has gone wrong with the calculation of the MD5 data",
.suggestion = "Ensure your key is correct, gather log data from this side as well as peer and open an Issue", .suggestion = "Ensure your key is correct, gather log data from this side as well as peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_PACKET, .code = EC_OSPF_PACKET,
.title = "OSPF has detected packet information missmatch", .title = "OSPF has detected packet information missmatch",
.description = "OSPF has detected that packet information received is incorrect", .description = "OSPF has detected that packet information received is incorrect",
.suggestion = "Ensure interface configuration is correct, gather log files from here and the peer and open an Issue", .suggestion = "Ensure interface configuration is correct, gather log files from here and the peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_LARGE_LSA, .code = EC_OSPF_LARGE_LSA,
.title = "OSPF has determined that a LSA packet will be too large", .title = "OSPF has determined that a LSA packet will be too large",
.description = "OSPF has received data that is causing it to recalculate how large packets should be and has discovered that the packet size needed would be too large and we will need to fragment packets", .description = "OSPF has received data that is causing it to recalculate how large packets should be and has discovered that the packet size needed would be too large and we will need to fragment packets",
.suggestion = "Further divide up your network with areas", .suggestion = "Further divide up your network with areas",
}, },
{ {
.code = OSPF_WARN_LSA_UNEXPECTED, .code = EC_OSPF_LSA_UNEXPECTED,
.title = "OSPF has received a LSA-type that it was not expecting", .title = "OSPF has received a LSA-type that it was not expecting",
.description = "OSPF has received a LSA-type that it was not expecting during processing", .description = "OSPF has received a LSA-type that it was not expecting during processing",
.suggestion = "Gather log data from this machine and it's peer and open an Issue", .suggestion = "Gather log data from this machine and it's peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_LSA, .code = EC_OSPF_LSA,
.title = "OSPF has discovered inconsistent internal state for a LSA", .title = "OSPF has discovered inconsistent internal state for a LSA",
.description = "During handling of a LSA, OSPF has discovered that the LSA's internal state is inconsistent", .description = "During handling of a LSA, OSPF has discovered that the LSA's internal state is inconsistent",
.suggestion = "Gather log data and open an Issue", .suggestion = "Gather log data and open an Issue",
}, },
{ {
.code = OSPF_WARN_OPAQUE_REGISTRATION, .code = EC_OSPF_OPAQUE_REGISTRATION,
.title = "OSPF has failed to properly register Opaque Handler", .title = "OSPF has failed to properly register Opaque Handler",
.description = "During initialization OSPF has detected a failure to install an opaque handler", .description = "During initialization OSPF has detected a failure to install an opaque handler",
.suggestion = "Gather log data and open an Issue", .suggestion = "Gather log data and open an Issue",
}, },
{ {
.code = OSPF_WARN_TE_UNEXPECTED, .code = EC_OSPF_TE_UNEXPECTED,
.title = "OSPF has received TE information that it was not expecting", .title = "OSPF has received TE information that it was not expecting",
.description = "OSPF has received TE information that it was not expecting during normal processing of data", .description = "OSPF has received TE information that it was not expecting during normal processing of data",
.suggestion = "Gather log data from this machine and it's peer and open an Issue", .suggestion = "Gather log data from this machine and it's peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_LSA_INSTALL_FAILURE, .code = EC_OSPF_LSA_INSTALL_FAILURE,
.title = "OSPF was unable to save the LSA into it's database", .title = "OSPF was unable to save the LSA into it's database",
.description = "During processing of a new lsa and attempting to save the lsa into the OSPF database, this process failed.", .description = "During processing of a new lsa and attempting to save the lsa into the OSPF database, this process failed.",
.suggestion = "Gather log data from this machine and open an Issue", .suggestion = "Gather log data from this machine and open an Issue",
}, },
{ {
.code = OSPF_WARN_LSA_NULL, .code = EC_OSPF_LSA_NULL,
.title = "OSPF has received a NULL lsa pointer", .title = "OSPF has received a NULL lsa pointer",
.description = "When processing a LSA update we have found and noticed an internal error where we are passing around a NULL pointer", .description = "When processing a LSA update we have found and noticed an internal error where we are passing around a NULL pointer",
.suggestion = "Gather data from this machine and it's peer and open an Issue", .suggestion = "Gather data from this machine and it's peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_EXT_LSA_UNEXPECTED, .code = EC_OSPF_EXT_LSA_UNEXPECTED,
.title = "OSPF has received EXT information that leaves it in an unexpected state", .title = "OSPF has received EXT information that leaves it in an unexpected state",
.description = "While processing EXT LSA information, OSPF has noticed that the internal state of OSPF has gotten inconsistent", .description = "While processing EXT LSA information, OSPF has noticed that the internal state of OSPF has gotten inconsistent",
.suggestion = "Gather data from this machine and it's peer and open an Issue", .suggestion = "Gather data from this machine and it's peer and open an Issue",
}, },
{ {
.code = OSPF_WARN_LSA_MISSING, .code = EC_OSPF_LSA_MISSING,
.title = "OSPF attempted to look up a LSA and it was not found", .title = "OSPF attempted to look up a LSA and it was not found",
.description = "During processing of new LSA information, we attempted to look up an old LSA and it was not found", .description = "During processing of new LSA information, we attempted to look up an old LSA and it was not found",
.suggestion = "Gather data from this machine and open an Issue", .suggestion = "Gather data from this machine and open an Issue",
}, },
{ {
.code = OSPF_WARN_PTP_NEIGHBOR, .code = EC_OSPF_PTP_NEIGHBOR,
.title = "OSPF has detected more than 1 neighbor on a P2P interface", .title = "OSPF has detected more than 1 neighbor on a P2P interface",
.description = "If you configure a ospf interface as P2P we should not detect more than one neighbor on the interface", .description = "If you configure a ospf interface as P2P we should not detect more than one neighbor on the interface",
.suggestion = "Fix your config", .suggestion = "Fix your config",
}, },
{ {
.code = OSPF_WARN_LSA_SIZE, .code = EC_OSPF_LSA_SIZE,
.title = "OSPF has detected an invalid LSA size", .title = "OSPF has detected an invalid LSA size",
.description = "OSPF has detected a state where we are attempting to grow a LSA but the LSA has reached it's maximum size", .description = "OSPF has detected a state where we are attempting to grow a LSA but the LSA has reached it's maximum size",
.suggestion = "Gather data and open an Issue", .suggestion = "Gather data and open an Issue",
@ -116,55 +116,55 @@ static struct log_ref ferr_ospf_warn[] = {
static struct log_ref ferr_ospf_err[] = { static struct log_ref ferr_ospf_err[] = {
{ {
.code = OSPF_ERR_PKT_PROCESS, .code = EC_OSPF_PKT_PROCESS,
.title = "Failure to process a packet", .title = "Failure to process a packet",
.description = "OSPF attempted to process a received packet but could not", .description = "OSPF attempted to process a received packet but could not",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_ROUTER_LSA_MISMATCH, .code = EC_OSPF_ROUTER_LSA_MISMATCH,
.title = "Failure to process Router LSA", .title = "Failure to process Router LSA",
.description = "OSPF attempted to process a Router LSA but Advertising ID mismatch with link id", .description = "OSPF attempted to process a Router LSA but Advertising ID mismatch with link id",
.suggestion = "Check OSPF network config for any config issue, If the problem persists, report the problem for troubleshooting" .suggestion = "Check OSPF network config for any config issue, If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_DOMAIN_CORRUPT, .code = EC_OSPF_DOMAIN_CORRUPT,
.title = "OSPF Domain Corruption", .title = "OSPF Domain Corruption",
.description = "OSPF attempted to process a Router LSA but Advertising ID mismatch with link id", .description = "OSPF attempted to process a Router LSA but Advertising ID mismatch with link id",
.suggestion = "Check OSPF network Database for corrupted LSA, If the problem persists, shutdown OSPF domain and report the problem for troubleshooting" .suggestion = "Check OSPF network Database for corrupted LSA, If the problem persists, shutdown OSPF domain and report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_INIT_FAIL, .code = EC_OSPF_INIT_FAIL,
.title = "OSPF Initialization failure", .title = "OSPF Initialization failure",
.description = "OSPF failed to initialized OSPF default insance", .description = "OSPF failed to initialized OSPF default insance",
.suggestion = "Ensure there is adequate memory on the device. If the problem persists, report the problem for troubleshooting" .suggestion = "Ensure there is adequate memory on the device. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_SR_INVALID_DB, .code = EC_OSPF_SR_INVALID_DB,
.title = "OSPF SR Invalid DB", .title = "OSPF SR Invalid DB",
.description = "OSPF Segment Routing Database is invalid", .description = "OSPF Segment Routing Database is invalid",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_SR_NODE_CREATE, .code = EC_OSPF_SR_NODE_CREATE,
.title = "OSPF SR hash node creation failed", .title = "OSPF SR hash node creation failed",
.description = "OSPF Segment Routing node creation failed", .description = "OSPF Segment Routing node creation failed",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_SR_INVALID_LSA_ID, .code = EC_OSPF_SR_INVALID_LSA_ID,
.title = "OSPF SR Invalid LSA ID", .title = "OSPF SR Invalid LSA ID",
.description = "OSPF Segment Routing invalid lsa id", .description = "OSPF Segment Routing invalid lsa id",
.suggestion = "Restart OSPF instance, If the problem persists, report the problem for troubleshooting" .suggestion = "Restart OSPF instance, If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_INVALID_ALGORITHM, .code = EC_OSPF_INVALID_ALGORITHM,
.title = "OSPF SR Invalid Algorithm", .title = "OSPF SR Invalid Algorithm",
.description = "OSPF Segment Routing invalid Algorithm", .description = "OSPF Segment Routing invalid Algorithm",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = OSPF_ERR_FSM_INVALID_STATE, .code = EC_OSPF_FSM_INVALID_STATE,
.title = "OSPF FSM invalid state detected", .title = "OSPF FSM invalid state detected",
.description = "OSPF has attempted to change states when it should not be able to", .description = "OSPF has attempted to change states when it should not be able to",
.suggestion = "Gather log files and open an issue", .suggestion = "Gather log files and open an issue",

View File

@ -24,29 +24,29 @@
#include "lib/ferr.h" #include "lib/ferr.h"
enum ospf_log_refs { enum ospf_log_refs {
OSPF_ERR_PKT_PROCESS = OSPF_FERR_START, EC_OSPF_PKT_PROCESS = OSPF_FERR_START,
OSPF_ERR_ROUTER_LSA_MISMATCH, EC_OSPF_ROUTER_LSA_MISMATCH,
OSPF_ERR_DOMAIN_CORRUPT, EC_OSPF_DOMAIN_CORRUPT,
OSPF_ERR_INIT_FAIL, EC_OSPF_INIT_FAIL,
OSPF_ERR_SR_INVALID_DB, EC_OSPF_SR_INVALID_DB,
OSPF_ERR_SR_NODE_CREATE, EC_OSPF_SR_NODE_CREATE,
OSPF_ERR_SR_INVALID_LSA_ID, EC_OSPF_SR_INVALID_LSA_ID,
OSPF_ERR_INVALID_ALGORITHM, EC_OSPF_INVALID_ALGORITHM,
OSPF_ERR_FSM_INVALID_STATE, EC_OSPF_FSM_INVALID_STATE,
OSPF_WARN_SET_METRIC_PLUS, EC_OSPF_SET_METRIC_PLUS,
OSPF_WARN_MD5, EC_OSPF_MD5,
OSPF_WARN_PACKET, EC_OSPF_PACKET,
OSPF_WARN_LARGE_LSA, EC_OSPF_LARGE_LSA,
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
OSPF_WARN_LSA, EC_OSPF_LSA,
OSPF_WARN_OPAQUE_REGISTRATION, EC_OSPF_OPAQUE_REGISTRATION,
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
OSPF_WARN_LSA_INSTALL_FAILURE, EC_OSPF_LSA_INSTALL_FAILURE,
OSPF_WARN_LSA_NULL, EC_OSPF_LSA_NULL,
OSPF_WARN_EXT_LSA_UNEXPECTED, EC_OSPF_EXT_LSA_UNEXPECTED,
OSPF_WARN_LSA_MISSING, EC_OSPF_LSA_MISSING,
OSPF_WARN_PTP_NEIGHBOR, EC_OSPF_PTP_NEIGHBOR,
OSPF_WARN_LSA_SIZE, EC_OSPF_LSA_SIZE,
}; };
extern void ospf_error_init(void); extern void ospf_error_init(void);

View File

@ -137,7 +137,7 @@ int ospf_ext_init(void)
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(EC_OSPF_OPAQUE_REGISTRATION,
"EXT (%s): Failed to register Extended Link LSA", "EXT (%s): Failed to register Extended Link LSA",
__func__); __func__);
return rc; return rc;
@ -159,7 +159,7 @@ int ospf_ext_init(void)
ospf_ext_pref_lsa_update, /* new_lsa_hook */ ospf_ext_pref_lsa_update, /* new_lsa_hook */
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(EC_OSPF_OPAQUE_REGISTRATION,
"EXT (%s): Failed to register Extended Prefix LSA", "EXT (%s): Failed to register Extended Prefix LSA",
__func__); __func__);
return rc; return rc;
@ -315,7 +315,7 @@ static void set_prefix_sid(struct ext_itf *exti, uint8_t algorithm,
if ((algorithm != SR_ALGORITHM_SPF) if ((algorithm != SR_ALGORITHM_SPF)
&& (algorithm != SR_ALGORITHM_STRICT_SPF)) { && (algorithm != SR_ALGORITHM_STRICT_SPF)) {
flog_err(OSPF_ERR_INVALID_ALGORITHM, flog_err(EC_OSPF_INVALID_ALGORITHM,
"EXT (%s): unrecognized algorithm, not SPF or S-SPF", "EXT (%s): unrecognized algorithm, not SPF or S-SPF",
__func__); __func__);
return; return;
@ -571,7 +571,7 @@ static int ospf_ext_link_del_if(struct interface *ifp)
rc = 0; rc = 0;
} else { } else {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): interface %s is not found", __func__, "EXT (%s): interface %s is not found", __func__,
ifp ? ifp->name : "-"); ifp ? ifp->name : "-");
} }
@ -619,7 +619,7 @@ static void ospf_ext_pref_ism_change(struct ospf_interface *oi, int old_status)
/* Get interface information for Segment Routing */ /* Get interface information for Segment Routing */
exti = lookup_ext_by_ifp(oi->ifp); exti = lookup_ext_by_ifp(oi->ifp);
if (exti == NULL) { if (exti == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Cannot get Extended info. from OI(%s)", "EXT (%s): Cannot get Extended info. from OI(%s)",
__func__, IF_NAME(oi)); __func__, IF_NAME(oi));
return; return;
@ -657,14 +657,14 @@ static void ospf_ext_link_nsm_change(struct ospf_neighbor *nbr, int old_status)
/* Get interface information for Segment Routing */ /* Get interface information for Segment Routing */
exti = lookup_ext_by_ifp(oi->ifp); exti = lookup_ext_by_ifp(oi->ifp);
if (exti == NULL) { if (exti == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Cannot get Extended info. from OI(%s)", "EXT (%s): Cannot get Extended info. from OI(%s)",
__func__, IF_NAME(oi)); __func__, IF_NAME(oi));
return; return;
} }
if (oi->area == NULL || oi->area->ospf == NULL) { if (oi->area == NULL || oi->area->ospf == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Cannot refer to OSPF from OI(%s)", "EXT (%s): Cannot refer to OSPF from OI(%s)",
__func__, IF_NAME(oi)); __func__, IF_NAME(oi));
return; return;
@ -760,7 +760,7 @@ static int ospf_ext_link_lsa_update(struct ospf_lsa *lsa)
{ {
/* Sanity Check */ /* Sanity Check */
if (lsa == NULL) { if (lsa == NULL) {
flog_warn(OSPF_WARN_LSA_NULL, "EXT (%s): Abort! LSA is NULL", flog_warn(EC_OSPF_LSA_NULL, "EXT (%s): Abort! LSA is NULL",
__func__); __func__);
return -1; return -1;
} }
@ -794,7 +794,7 @@ static int ospf_ext_pref_lsa_update(struct ospf_lsa *lsa)
/* Sanity Check */ /* Sanity Check */
if (lsa == NULL) { if (lsa == NULL) {
flog_warn(OSPF_WARN_LSA_NULL, "EXT (%s): Abort! LSA is NULL", flog_warn(EC_OSPF_LSA_NULL, "EXT (%s): Abort! LSA is NULL",
__func__); __func__);
return -1; return -1;
} }
@ -1062,14 +1062,14 @@ static int ospf_ext_pref_lsa_originate1(struct ospf_area *area,
/* Create new Opaque-LSA/Extended Prefix Opaque LSA instance. */ /* Create new Opaque-LSA/Extended Prefix Opaque LSA instance. */
new = ospf_ext_pref_lsa_new(area, exti); new = ospf_ext_pref_lsa_new(area, exti);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): ospf_ext_pref_lsa_new() error", __func__); "EXT (%s): ospf_ext_pref_lsa_new() error", __func__);
return rc; return rc;
} }
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"EXT (%s): ospf_lsa_install() error", __func__); "EXT (%s): ospf_lsa_install() error", __func__);
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return rc; return rc;
@ -1116,14 +1116,14 @@ static int ospf_ext_link_lsa_originate1(struct ospf_area *area,
/* Create new Opaque-LSA/Extended Link Opaque LSA instance. */ /* Create new Opaque-LSA/Extended Link Opaque LSA instance. */
new = ospf_ext_link_lsa_new(area, exti); new = ospf_ext_link_lsa_new(area, exti);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): ospf_ext_link_lsa_new() error", __func__); "EXT (%s): ospf_ext_link_lsa_new() error", __func__);
return rc; return rc;
} }
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"EXT (%s): ospf_lsa_install() error", __func__); "EXT (%s): ospf_lsa_install() error", __func__);
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return rc; return rc;
@ -1191,7 +1191,7 @@ static int ospf_ext_pref_lsa_originate(void *arg)
if (CHECK_FLAG(exti->flags, if (CHECK_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH)) { EXT_LPFLG_LSA_FORCED_REFRESH)) {
flog_warn( flog_warn(
OSPF_WARN_EXT_LSA_UNEXPECTED, EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Refresh instead of Originate", "EXT (%s): Refresh instead of Originate",
__func__); __func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
@ -1249,7 +1249,7 @@ static int ospf_ext_link_lsa_originate(void *arg)
if (CHECK_FLAG(exti->flags, if (CHECK_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH)) { EXT_LPFLG_LSA_FORCED_REFRESH)) {
flog_warn( flog_warn(
OSPF_WARN_EXT_LSA_UNEXPECTED, EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Refresh instead of Originate", "EXT (%s): Refresh instead of Originate",
__func__); __func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
@ -1300,7 +1300,7 @@ static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa)
/* Lookup this lsa corresponding Extended parameters */ /* Lookup this lsa corresponding Extended parameters */
exti = lookup_ext_by_instance(lsa); exti = lookup_ext_by_instance(lsa);
if (exti == NULL) { if (exti == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Invalid parameter LSA ID", __func__); "EXT (%s): Invalid parameter LSA ID", __func__);
/* Flush it anyway. */ /* Flush it anyway. */
lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
@ -1308,7 +1308,7 @@ static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa)
/* Check if Interface was not disable in the interval */ /* Check if Interface was not disable in the interval */
if ((exti != NULL) && !CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ACTIVE)) { if ((exti != NULL) && !CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ACTIVE)) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Interface was Disabled: Flush it!", "EXT (%s): Interface was Disabled: Flush it!",
__func__); __func__);
/* Flush it anyway. */ /* Flush it anyway. */
@ -1327,7 +1327,7 @@ static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa)
new = ospf_ext_pref_lsa_new(area, exti); new = ospf_ext_pref_lsa_new(area, exti);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): ospf_ext_pref_lsa_new() error", __func__); "EXT (%s): ospf_ext_pref_lsa_new() error", __func__);
return NULL; return NULL;
} }
@ -1345,7 +1345,7 @@ static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa)
top = ospf_lookup_by_vrf_id(VRF_DEFAULT); top = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"EXT (%s): ospf_lsa_install() error", __func__); "EXT (%s): ospf_lsa_install() error", __func__);
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return NULL; return NULL;
@ -1387,7 +1387,7 @@ static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa)
/* Lookup this LSA corresponding Extended parameters */ /* Lookup this LSA corresponding Extended parameters */
exti = lookup_ext_by_instance(lsa); exti = lookup_ext_by_instance(lsa);
if (exti == NULL) { if (exti == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Invalid parameter LSA ID", __func__); "EXT (%s): Invalid parameter LSA ID", __func__);
/* Flush it anyway. */ /* Flush it anyway. */
lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
@ -1395,7 +1395,7 @@ static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa)
/* Check if Interface was not disable in the interval */ /* Check if Interface was not disable in the interval */
if ((exti != NULL) && !CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ACTIVE)) { if ((exti != NULL) && !CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ACTIVE)) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Interface was Disabled: Flush it!", "EXT (%s): Interface was Disabled: Flush it!",
__func__); __func__);
lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
@ -1412,7 +1412,7 @@ static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa)
/* Create new Opaque-LSA/Extended Link instance */ /* Create new Opaque-LSA/Extended Link instance */
new = ospf_ext_link_lsa_new(area, exti); new = ospf_ext_link_lsa_new(area, exti);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Error creating new LSA", __func__); "EXT (%s): Error creating new LSA", __func__);
return NULL; return NULL;
} }
@ -1421,7 +1421,7 @@ static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa)
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
/* Given "lsa" will be freed in the next function */ /* Given "lsa" will be freed in the next function */
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"EXT (%s): Error installing new LSA", __func__); "EXT (%s): Error installing new LSA", __func__);
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return NULL; return NULL;
@ -1470,7 +1470,7 @@ static void ospf_ext_pref_lsa_schedule(struct ext_itf *exti,
/* Set LSA header information */ /* Set LSA header information */
if (exti->area == NULL) { if (exti->area == NULL) {
flog_warn( flog_warn(
OSPF_WARN_EXT_LSA_UNEXPECTED, EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Flooding is Area scope but area is not yet set", "EXT (%s): Flooding is Area scope but area is not yet set",
__func__); __func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {
@ -1531,7 +1531,7 @@ static void ospf_ext_link_lsa_schedule(struct ext_itf *exti,
/* Set LSA header information */ /* Set LSA header information */
if (exti->area == NULL) { if (exti->area == NULL) {
flog_warn( flog_warn(
OSPF_WARN_EXT_LSA_UNEXPECTED, EC_OSPF_EXT_LSA_UNEXPECTED,
"EXT (%s): Flooding is Area scope but area is not yet set", "EXT (%s): Flooding is Area scope but area is not yet set",
__func__); __func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {

View File

@ -398,7 +398,7 @@ struct ospf_neighbor *ospf_nbr_lookup_ptop(struct ospf_interface *oi)
/* PtoP link must have only 1 neighbor. */ /* PtoP link must have only 1 neighbor. */
if (ospf_nbr_count(oi, 0) > 1) if (ospf_nbr_count(oi, 0) > 1)
flog_warn(OSPF_WARN_PTP_NEIGHBOR, flog_warn(EC_OSPF_PTP_NEIGHBOR,
"Point-to-Point link has more than 1 neighobrs."); "Point-to-Point link has more than 1 neighobrs.");
return nbr; return nbr;
@ -448,7 +448,7 @@ static char link_info_set(struct stream **s, struct in_addr id,
if (ret == OSPF_MAX_LSA_SIZE) { if (ret == OSPF_MAX_LSA_SIZE) {
flog_warn( flog_warn(
OSPF_WARN_LSA_SIZE, EC_OSPF_LSA_SIZE,
"%s: Out of space in LSA stream, left %zd, size %zd", "%s: Out of space in LSA stream, left %zd, size %zd",
__func__, STREAM_WRITEABLE(*s), __func__, STREAM_WRITEABLE(*s),
STREAM_SIZE(*s)); STREAM_SIZE(*s));
@ -1819,7 +1819,7 @@ struct ospf_lsa *ospf_translated_nssa_originate(struct ospf *ospf,
} }
if ((new = ospf_lsa_install(ospf, NULL, new)) == NULL) { if ((new = ospf_lsa_install(ospf, NULL, new)) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_lsa_translated_nssa_originate(): " "ospf_lsa_translated_nssa_originate(): "
"Could not install LSA " "Could not install LSA "
"id %s", "id %s",
@ -1920,7 +1920,7 @@ struct ospf_lsa *ospf_translated_nssa_refresh(struct ospf *ospf,
if (!(new = ospf_lsa_install(ospf, NULL, new))) { if (!(new = ospf_lsa_install(ospf, NULL, new))) {
flog_warn( flog_warn(
OSPF_WARN_LSA_INSTALL_FAILURE, EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_translated_nssa_refresh(): Could not install translated LSA, Id %s", "ospf_translated_nssa_refresh(): Could not install translated LSA, Id %s",
inet_ntoa(type7->data->id)); inet_ntoa(type7->data->id));
return NULL; return NULL;
@ -2061,7 +2061,7 @@ int ospf_external_lsa_originate_timer(struct thread *thread)
if (!ospf_external_lsa_originate(ospf, ei)) if (!ospf_external_lsa_originate(ospf, ei))
flog_warn( flog_warn(
OSPF_WARN_LSA_INSTALL_FAILURE, EC_OSPF_LSA_INSTALL_FAILURE,
"LSA: AS-external-LSA was not originated."); "LSA: AS-external-LSA was not originated.");
} }
} }

View File

@ -216,7 +216,7 @@ int main(int argc, char **argv)
ospf', ospf',
when quagga(ospfd) is restarted */ when quagga(ospfd) is restarted */
if (!ospf_get_instance(instance)) { if (!ospf_get_instance(instance)) {
flog_err(OSPF_ERR_INIT_FAIL, "OSPF instance init failed: %s", flog_err(EC_OSPF_INIT_FAIL, "OSPF instance init failed: %s",
strerror(errno)); strerror(errno));
exit(1); exit(1);
} }

View File

@ -797,7 +797,7 @@ int ospf_nsm_event(struct thread *thread)
* try set next_state. * try set next_state.
*/ */
flog_err( flog_err(
OSPF_ERR_FSM_INVALID_STATE, EC_OSPF_FSM_INVALID_STATE,
"NSM[%s:%s]: %s (%s): " "NSM[%s:%s]: %s (%s): "
"Warning: action tried to change next_state to %s", "Warning: action tried to change next_state to %s",
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id), IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),

View File

@ -353,7 +353,7 @@ static struct list *ospf_get_opaque_funclist(uint8_t lsa_type)
funclist = ospf_opaque_type11_funclist; funclist = ospf_opaque_type11_funclist;
break; break;
default: default:
flog_warn(OSPF_WARN_LSA_UNEXPECTED, flog_warn(EC_OSPF_LSA_UNEXPECTED,
"ospf_get_opaque_funclist: Unexpected LSA-type(%u)", "ospf_get_opaque_funclist: Unexpected LSA-type(%u)",
lsa_type); lsa_type);
break; break;
@ -389,7 +389,7 @@ int ospf_register_opaque_functab(
for (ALL_LIST_ELEMENTS(funclist, node, nnode, functab)) for (ALL_LIST_ELEMENTS(funclist, node, nnode, functab))
if (functab->opaque_type == opaque_type) { if (functab->opaque_type == opaque_type) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_register_opaque_functab: Duplicated entry?: lsa_type(%u), opaque_type(%u)", "ospf_register_opaque_functab: Duplicated entry?: lsa_type(%u), opaque_type(%u)",
lsa_type, opaque_type); lsa_type, opaque_type);
return -1; return -1;
@ -568,7 +568,7 @@ register_opaque_info_per_type(struct ospf_opaque_functab *functab,
break; break;
default: default:
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"register_opaque_info_per_type: Unexpected LSA-type(%u)", "register_opaque_info_per_type: Unexpected LSA-type(%u)",
new->data->type); new->data->type);
free_opaque_info_per_type((void *)oipt); free_opaque_info_per_type((void *)oipt);
@ -613,7 +613,7 @@ static void free_opaque_info_owner(void *val)
break; break;
} }
default: default:
flog_warn(OSPF_WARN_LSA_UNEXPECTED, flog_warn(EC_OSPF_LSA_UNEXPECTED,
"free_opaque_info_owner: Unexpected LSA-type(%u)", "free_opaque_info_owner: Unexpected LSA-type(%u)",
oipt->lsa_type); oipt->lsa_type);
break; /* This case may not exist. */ break; /* This case may not exist. */
@ -659,7 +659,7 @@ lookup_opaque_info_by_type(struct ospf_lsa *lsa)
listtop = oi->opaque_lsa_self; listtop = oi->opaque_lsa_self;
else else
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-9 Opaque-LSA: Reference to OI is missing?"); "Type-9 Opaque-LSA: Reference to OI is missing?");
break; break;
case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AREA_LSA:
@ -667,21 +667,21 @@ lookup_opaque_info_by_type(struct ospf_lsa *lsa)
listtop = area->opaque_lsa_self; listtop = area->opaque_lsa_self;
else else
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-10 Opaque-LSA: Reference to AREA is missing?"); "Type-10 Opaque-LSA: Reference to AREA is missing?");
break; break;
case OSPF_OPAQUE_AS_LSA: case OSPF_OPAQUE_AS_LSA:
top = ospf_lookup_by_vrf_id(lsa->vrf_id); top = ospf_lookup_by_vrf_id(lsa->vrf_id);
if ((area = lsa->area) != NULL && (top = area->ospf) == NULL) { if ((area = lsa->area) != NULL && (top = area->ospf) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-11 Opaque-LSA: Reference to OSPF is missing?"); "Type-11 Opaque-LSA: Reference to OSPF is missing?");
break; /* Unlikely to happen. */ break; /* Unlikely to happen. */
} }
listtop = top->opaque_lsa_self; listtop = top->opaque_lsa_self;
break; break;
default: default:
flog_warn(OSPF_WARN_LSA_UNEXPECTED, flog_warn(EC_OSPF_LSA_UNEXPECTED,
"lookup_opaque_info_by_type: Unexpected LSA-type(%u)", "lookup_opaque_info_by_type: Unexpected LSA-type(%u)",
lsa->data->type); lsa->data->type);
break; break;
@ -1523,7 +1523,7 @@ static void ospf_opaque_lsa_reoriginate_resume(struct list *listtop, void *arg)
if ((*functab->lsa_originator)(arg) != 0) { if ((*functab->lsa_originator)(arg) != 0) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_resume: Failed (opaque-type=%u)", "ospf_opaque_lsa_reoriginate_resume: Failed (opaque-type=%u)",
oipt->opaque_type); oipt->opaque_type);
continue; continue;
@ -1563,7 +1563,7 @@ struct ospf_lsa *ospf_opaque_lsa_install(struct ospf_lsa *lsa, int rt_recalc)
} }
/* Register the new lsa entry and get its control info. */ /* Register the new lsa entry and get its control info. */
else if ((oipi = register_opaque_lsa(lsa)) == NULL) { else if ((oipi = register_opaque_lsa(lsa)) == NULL) {
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_install: register_opaque_lsa() ?"); "ospf_opaque_lsa_install: register_opaque_lsa() ?");
goto out; goto out;
} }
@ -1576,7 +1576,7 @@ struct ospf_lsa *ospf_opaque_lsa_install(struct ospf_lsa *lsa, int rt_recalc)
case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_LINK_LSA:
if ((top = oi_to_top(lsa->oi)) == NULL) { if ((top = oi_to_top(lsa->oi)) == NULL) {
/* Above conditions must have passed. */ /* Above conditions must have passed. */
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_install: Something wrong?"); "ospf_opaque_lsa_install: Something wrong?");
goto out; goto out;
} }
@ -1584,7 +1584,7 @@ struct ospf_lsa *ospf_opaque_lsa_install(struct ospf_lsa *lsa, int rt_recalc)
case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AREA_LSA:
if (lsa->area == NULL || (top = lsa->area->ospf) == NULL) { if (lsa->area == NULL || (top = lsa->area->ospf) == NULL) {
/* Above conditions must have passed. */ /* Above conditions must have passed. */
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_install: Something wrong?"); "ospf_opaque_lsa_install: Something wrong?");
goto out; goto out;
} }
@ -1593,13 +1593,13 @@ struct ospf_lsa *ospf_opaque_lsa_install(struct ospf_lsa *lsa, int rt_recalc)
top = ospf_lookup_by_vrf_id(lsa->vrf_id); top = ospf_lookup_by_vrf_id(lsa->vrf_id);
if (lsa->area != NULL && (top = lsa->area->ospf) == NULL) { if (lsa->area != NULL && (top = lsa->area->ospf) == NULL) {
/* Above conditions must have passed. */ /* Above conditions must have passed. */
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_install: Something wrong?"); "ospf_opaque_lsa_install: Something wrong?");
goto out; goto out;
} }
break; break;
default: default:
flog_warn(OSPF_WARN_LSA_UNEXPECTED, flog_warn(EC_OSPF_LSA_UNEXPECTED,
"ospf_opaque_lsa_install: Unexpected LSA-type(%u)", "ospf_opaque_lsa_install: Unexpected LSA-type(%u)",
lsa->data->type); lsa->data->type);
goto out; goto out;
@ -1673,13 +1673,13 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
if ((oi = (struct ospf_interface *)lsa_type_dependent) if ((oi = (struct ospf_interface *)lsa_type_dependent)
== NULL) { == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: Type-9 Opaque-LSA: Invalid parameter?"); "ospf_opaque_lsa_reoriginate_schedule: Type-9 Opaque-LSA: Invalid parameter?");
goto out; goto out;
} }
if ((top = oi_to_top(oi)) == NULL) { if ((top = oi_to_top(oi)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: OI(%s) -> TOP?", "ospf_opaque_lsa_reoriginate_schedule: OI(%s) -> TOP?",
IF_NAME(oi)); IF_NAME(oi));
goto out; goto out;
@ -1688,7 +1688,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
&& list_isempty(oi->opaque_lsa_self) && list_isempty(oi->opaque_lsa_self)
&& oi->t_opaque_lsa_self != NULL) { && oi->t_opaque_lsa_self != NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-9 Opaque-LSA (opaque_type=%u): Common origination for OI(%s) has already started", "Type-9 Opaque-LSA (opaque_type=%u): Common origination for OI(%s) has already started",
opaque_type, IF_NAME(oi)); opaque_type, IF_NAME(oi));
goto out; goto out;
@ -1698,13 +1698,13 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AREA_LSA:
if ((area = (struct ospf_area *)lsa_type_dependent) == NULL) { if ((area = (struct ospf_area *)lsa_type_dependent) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: Type-10 Opaque-LSA: Invalid parameter?"); "ospf_opaque_lsa_reoriginate_schedule: Type-10 Opaque-LSA: Invalid parameter?");
goto out; goto out;
} }
if ((top = area->ospf) == NULL) { if ((top = area->ospf) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: AREA(%s) -> TOP?", "ospf_opaque_lsa_reoriginate_schedule: AREA(%s) -> TOP?",
inet_ntoa(area->area_id)); inet_ntoa(area->area_id));
goto out; goto out;
@ -1713,7 +1713,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
&& list_isempty(area->opaque_lsa_self) && list_isempty(area->opaque_lsa_self)
&& area->t_opaque_lsa_self != NULL) { && area->t_opaque_lsa_self != NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-10 Opaque-LSA (opaque_type=%u): Common origination for AREA(%s) has already started", "Type-10 Opaque-LSA (opaque_type=%u): Common origination for AREA(%s) has already started",
opaque_type, inet_ntoa(area->area_id)); opaque_type, inet_ntoa(area->area_id));
goto out; goto out;
@ -1723,7 +1723,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
case OSPF_OPAQUE_AS_LSA: case OSPF_OPAQUE_AS_LSA:
if ((top = (struct ospf *)lsa_type_dependent) == NULL) { if ((top = (struct ospf *)lsa_type_dependent) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: Type-11 Opaque-LSA: Invalid parameter?"); "ospf_opaque_lsa_reoriginate_schedule: Type-11 Opaque-LSA: Invalid parameter?");
goto out; goto out;
} }
@ -1731,7 +1731,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
&& list_isempty(top->opaque_lsa_self) && list_isempty(top->opaque_lsa_self)
&& top->t_opaque_lsa_self != NULL) { && top->t_opaque_lsa_self != NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"Type-11 Opaque-LSA (opaque_type=%u): Common origination has already started", "Type-11 Opaque-LSA (opaque_type=%u): Common origination has already started",
opaque_type); opaque_type);
goto out; goto out;
@ -1745,7 +1745,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
break; break;
default: default:
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"ospf_opaque_lsa_reoriginate_schedule: Unexpected LSA-type(%u)", "ospf_opaque_lsa_reoriginate_schedule: Unexpected LSA-type(%u)",
lsa_type); lsa_type);
goto out; goto out;
@ -1767,7 +1767,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
struct ospf_opaque_functab *functab; struct ospf_opaque_functab *functab;
if ((functab = ospf_opaque_functab_lookup(lsa)) == NULL) { if ((functab = ospf_opaque_functab_lookup(lsa)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: No associated function?: lsa_type(%u), opaque_type(%u)", "ospf_opaque_lsa_reoriginate_schedule: No associated function?: lsa_type(%u), opaque_type(%u)",
lsa_type, opaque_type); lsa_type, opaque_type);
goto out; goto out;
@ -1775,7 +1775,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
if ((oipt = register_opaque_info_per_type(functab, lsa)) if ((oipt = register_opaque_info_per_type(functab, lsa))
== NULL) { == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_reoriginate_schedule: Cannot get a control info?: lsa_type(%u), opaque_type(%u)", "ospf_opaque_lsa_reoriginate_schedule: Cannot get a control info?: lsa_type(%u), opaque_type(%u)",
lsa_type, opaque_type); lsa_type, opaque_type);
goto out; goto out;
@ -1848,7 +1848,7 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
if ((functab = oipt->functab) == NULL if ((functab = oipt->functab) == NULL
|| functab->lsa_originator == NULL) { || functab->lsa_originator == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type9_lsa_reoriginate_timer: No associated function?"); "ospf_opaque_type9_lsa_reoriginate_timer: No associated function?");
goto out; goto out;
} }
@ -1856,7 +1856,7 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
oi = (struct ospf_interface *)oipt->owner; oi = (struct ospf_interface *)oipt->owner;
if ((top = oi_to_top(oi)) == NULL) { if ((top = oi_to_top(oi)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type9_lsa_reoriginate_timer: Something wrong?"); "ospf_opaque_type9_lsa_reoriginate_timer: Something wrong?");
goto out; goto out;
} }
@ -1900,7 +1900,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
if ((functab = oipt->functab) == NULL if ((functab = oipt->functab) == NULL
|| functab->lsa_originator == NULL) { || functab->lsa_originator == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type10_lsa_reoriginate_timer: No associated function?"); "ospf_opaque_type10_lsa_reoriginate_timer: No associated function?");
goto out; goto out;
} }
@ -1908,7 +1908,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
area = (struct ospf_area *)oipt->owner; area = (struct ospf_area *)oipt->owner;
if (area == NULL || (top = area->ospf) == NULL) { if (area == NULL || (top = area->ospf) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type10_lsa_reoriginate_timer: Something wrong?"); "ospf_opaque_type10_lsa_reoriginate_timer: Something wrong?");
goto out; goto out;
} }
@ -1956,14 +1956,14 @@ static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
if ((functab = oipt->functab) == NULL if ((functab = oipt->functab) == NULL
|| functab->lsa_originator == NULL) { || functab->lsa_originator == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type11_lsa_reoriginate_timer: No associated function?"); "ospf_opaque_type11_lsa_reoriginate_timer: No associated function?");
goto out; goto out;
} }
if ((top = (struct ospf *)oipt->owner) == NULL) { if ((top = (struct ospf *)oipt->owner) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_type11_lsa_reoriginate_timer: Something wrong?"); "ospf_opaque_type11_lsa_reoriginate_timer: Something wrong?");
goto out; goto out;
} }
@ -2000,14 +2000,14 @@ void ospf_opaque_lsa_refresh_schedule(struct ospf_lsa *lsa0)
if ((oipt = lookup_opaque_info_by_type(lsa0)) == NULL if ((oipt = lookup_opaque_info_by_type(lsa0)) == NULL
|| (oipi = lookup_opaque_info_by_id(oipt, lsa0)) == NULL) { || (oipi = lookup_opaque_info_by_id(oipt, lsa0)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_opaque_lsa_refresh_schedule: Invalid parameter?"); "ospf_opaque_lsa_refresh_schedule: Invalid parameter?");
goto out; goto out;
} }
/* Given "lsa0" and current "oipi->lsa" may different, but harmless. */ /* Given "lsa0" and current "oipi->lsa" may different, but harmless. */
if ((lsa = oipi->lsa) == NULL) { if ((lsa = oipi->lsa) == NULL) {
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_refresh_schedule: Something wrong?"); "ospf_opaque_lsa_refresh_schedule: Something wrong?");
goto out; goto out;
} }
@ -2036,7 +2036,7 @@ void ospf_opaque_lsa_refresh_schedule(struct ospf_lsa *lsa0)
break; break;
default: default:
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"ospf_opaque_lsa_refresh_schedule: Unexpected LSA-type(%u)", "ospf_opaque_lsa_refresh_schedule: Unexpected LSA-type(%u)",
lsa->data->type); lsa->data->type);
goto out; goto out;
@ -2088,14 +2088,14 @@ void ospf_opaque_lsa_flush_schedule(struct ospf_lsa *lsa0)
if ((oipt = lookup_opaque_info_by_type(lsa0)) == NULL if ((oipt = lookup_opaque_info_by_type(lsa0)) == NULL
|| (oipi = lookup_opaque_info_by_id(oipt, lsa0)) == NULL) { || (oipi = lookup_opaque_info_by_id(oipt, lsa0)) == NULL) {
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_flush_schedule: Invalid parameter?"); "ospf_opaque_lsa_flush_schedule: Invalid parameter?");
goto out; goto out;
} }
/* Given "lsa0" and current "oipi->lsa" may different, but harmless. */ /* Given "lsa0" and current "oipi->lsa" may different, but harmless. */
if ((lsa = oipi->lsa) == NULL) { if ((lsa = oipi->lsa) == NULL) {
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"ospf_opaque_lsa_flush_schedule: Something wrong?"); "ospf_opaque_lsa_flush_schedule: Something wrong?");
goto out; goto out;
} }
@ -2113,7 +2113,7 @@ void ospf_opaque_lsa_flush_schedule(struct ospf_lsa *lsa0)
break; break;
default: default:
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"ospf_opaque_lsa_flush_schedule: Unexpected LSA-type(%u)", "ospf_opaque_lsa_flush_schedule: Unexpected LSA-type(%u)",
lsa->data->type); lsa->data->type);
goto out; goto out;
@ -2171,7 +2171,7 @@ void ospf_opaque_self_originated_lsa_received(struct ospf_neighbor *nbr,
break; break;
default: default:
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"ospf_opaque_self_originated_lsa_received: Unexpected LSA-type(%u)", "ospf_opaque_self_originated_lsa_received: Unexpected LSA-type(%u)",
lsa->data->type); lsa->data->type);
return; return;
@ -2190,7 +2190,7 @@ struct ospf *oi_to_top(struct ospf_interface *oi)
if (oi == NULL || (area = oi->area) == NULL if (oi == NULL || (area = oi->area) == NULL
|| (top = area->ospf) == NULL) || (top = area->ospf) == NULL)
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"Broken relationship for \"OI -> AREA -> OSPF\"?"); "Broken relationship for \"OI -> AREA -> OSPF\"?");
return top; return top;

View File

@ -233,7 +233,7 @@ void ospf_packet_add(struct ospf_interface *oi, struct ospf_packet *op)
{ {
if (!oi->obuf) { if (!oi->obuf) {
flog_err( flog_err(
OSPF_ERR_PKT_PROCESS, EC_OSPF_PKT_PROCESS,
"ospf_packet_add(interface %s in state %d [%s], packet type %s, " "ospf_packet_add(interface %s in state %d [%s], packet type %s, "
"destination %s) called with NULL obuf, ignoring " "destination %s) called with NULL obuf, ignoring "
"(please report this bug)!\n", "(please report this bug)!\n",
@ -257,7 +257,7 @@ static void ospf_packet_add_top(struct ospf_interface *oi,
{ {
if (!oi->obuf) { if (!oi->obuf) {
flog_err( flog_err(
OSPF_ERR_PKT_PROCESS, EC_OSPF_PKT_PROCESS,
"ospf_packet_add(interface %s in state %d [%s], packet type %s, " "ospf_packet_add(interface %s in state %d [%s], packet type %s, "
"destination %s) called with NULL obuf, ignoring " "destination %s) called with NULL obuf, ignoring "
"(please report this bug)!\n", "(please report this bug)!\n",
@ -342,7 +342,7 @@ static int ospf_check_md5_digest(struct ospf_interface *oi,
ck = ospf_crypt_key_lookup(OSPF_IF_PARAM(oi, auth_crypt), ck = ospf_crypt_key_lookup(OSPF_IF_PARAM(oi, auth_crypt),
ospfh->u.crypt.key_id); ospfh->u.crypt.key_id);
if (ck == NULL) { if (ck == NULL) {
flog_warn(OSPF_WARN_MD5, flog_warn(EC_OSPF_MD5,
"interface %s: ospf_check_md5 no key %d", IF_NAME(oi), "interface %s: ospf_check_md5 no key %d", IF_NAME(oi),
ospfh->u.crypt.key_id); ospfh->u.crypt.key_id);
return 0; return 0;
@ -354,7 +354,7 @@ static int ospf_check_md5_digest(struct ospf_interface *oi,
if (nbr if (nbr
&& ntohl(nbr->crypt_seqnum) > ntohl(ospfh->u.crypt.crypt_seqnum)) { && ntohl(nbr->crypt_seqnum) > ntohl(ospfh->u.crypt.crypt_seqnum)) {
flog_warn( flog_warn(
OSPF_WARN_MD5, EC_OSPF_MD5,
"interface %s: ospf_check_md5 bad sequence %d (expect %d)", "interface %s: ospf_check_md5 bad sequence %d (expect %d)",
IF_NAME(oi), ntohl(ospfh->u.crypt.crypt_seqnum), IF_NAME(oi), ntohl(ospfh->u.crypt.crypt_seqnum),
ntohl(nbr->crypt_seqnum)); ntohl(nbr->crypt_seqnum));
@ -370,7 +370,7 @@ static int ospf_check_md5_digest(struct ospf_interface *oi,
/* compare the two */ /* compare the two */
if (memcmp((caddr_t)ospfh + length, digest, OSPF_AUTH_MD5_SIZE)) { if (memcmp((caddr_t)ospfh + length, digest, OSPF_AUTH_MD5_SIZE)) {
flog_warn(OSPF_WARN_MD5, flog_warn(EC_OSPF_MD5,
"interface %s: ospf_check_md5 checksum mismatch", "interface %s: ospf_check_md5 checksum mismatch",
IF_NAME(oi)); IF_NAME(oi));
return 0; return 0;
@ -438,7 +438,7 @@ static int ospf_make_md5_digest(struct ospf_interface *oi,
if (stream_get_endp(op->s) != op->length) if (stream_get_endp(op->s) != op->length)
/* XXX size_t */ /* XXX size_t */
flog_warn( flog_warn(
OSPF_WARN_MD5, EC_OSPF_MD5,
"ospf_make_md5_digest: length mismatch stream %lu ospf_packet %u", "ospf_make_md5_digest: length mismatch stream %lu ospf_packet %u",
(unsigned long)stream_get_endp(op->s), op->length); (unsigned long)stream_get_endp(op->s), op->length);
@ -923,7 +923,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
&& oi->type != OSPF_IFTYPE_VIRTUALLINK) && oi->type != OSPF_IFTYPE_VIRTUALLINK)
if (oi->address->prefixlen != p.prefixlen) { if (oi->address->prefixlen != p.prefixlen) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: NetworkMask mismatch on %s (configured prefix length is %d, but hello packet indicates %d).", "Packet %s [Hello:RECV]: NetworkMask mismatch on %s (configured prefix length is %d, but hello packet indicates %d).",
inet_ntoa(ospfh->router_id), IF_NAME(oi), inet_ntoa(ospfh->router_id), IF_NAME(oi),
(int)oi->address->prefixlen, (int)p.prefixlen); (int)oi->address->prefixlen, (int)p.prefixlen);
@ -932,7 +932,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
/* Compare Router Dead Interval. */ /* Compare Router Dead Interval. */
if (OSPF_IF_PARAM(oi, v_wait) != ntohl(hello->dead_interval)) { if (OSPF_IF_PARAM(oi, v_wait) != ntohl(hello->dead_interval)) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: RouterDeadInterval mismatch " "Packet %s [Hello:RECV]: RouterDeadInterval mismatch "
"(expected %u, but received %u).", "(expected %u, but received %u).",
inet_ntoa(ospfh->router_id), inet_ntoa(ospfh->router_id),
@ -946,7 +946,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
if (OSPF_IF_PARAM(oi, v_hello) if (OSPF_IF_PARAM(oi, v_hello)
!= ntohs(hello->hello_interval)) { != ntohs(hello->hello_interval)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: HelloInterval mismatch " "Packet %s [Hello:RECV]: HelloInterval mismatch "
"(expected %u, but received %u).", "(expected %u, but received %u).",
inet_ntoa(ospfh->router_id), inet_ntoa(ospfh->router_id),
@ -971,7 +971,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
* Drop this Hello packet not to establish neighbor * Drop this Hello packet not to establish neighbor
* relationship. * relationship.
*/ */
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: T-bit on, drop it.", "Packet %s [Hello:RECV]: T-bit on, drop it.",
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
return; return;
@ -984,7 +984,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
* This router does know the correct usage of O-bit * This router does know the correct usage of O-bit
* the bit should be set in DD packet only. * the bit should be set in DD packet only.
*/ */
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: O-bit abuse?", "Packet %s [Hello:RECV]: O-bit abuse?",
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
#ifdef STRICT_OBIT_USAGE_CHECK #ifdef STRICT_OBIT_USAGE_CHECK
@ -1002,7 +1002,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
&& !CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_E) && !CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_E)
&& !CHECK_FLAG(hello->options, OSPF_OPTION_E))) { && !CHECK_FLAG(hello->options, OSPF_OPTION_E))) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"NSSA-Packet-%s[Hello:RECV]: my options: %x, his options %x", "NSSA-Packet-%s[Hello:RECV]: my options: %x, his options %x",
inet_ntoa(ospfh->router_id), OPTIONS(oi), inet_ntoa(ospfh->router_id), OPTIONS(oi),
hello->options); hello->options);
@ -1020,7 +1020,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
if (CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_E) if (CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_E)
!= CHECK_FLAG(hello->options, OSPF_OPTION_E)) { != CHECK_FLAG(hello->options, OSPF_OPTION_E)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet %s [Hello:RECV]: my options: %x, his options %x", "Packet %s [Hello:RECV]: my options: %x, his options %x",
inet_ntoa(ospfh->router_id), OPTIONS(oi), inet_ntoa(ospfh->router_id), OPTIONS(oi),
hello->options); hello->options);
@ -1137,7 +1137,7 @@ static void ospf_db_desc_proc(struct stream *s, struct ospf_interface *oi,
/* Unknown LS type. */ /* Unknown LS type. */
if (lsah->type < OSPF_MIN_LSA || lsah->type >= OSPF_MAX_LSA) { if (lsah->type < OSPF_MIN_LSA || lsah->type >= OSPF_MAX_LSA) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet [DD:RECV]: Unknown LS type %d.", "Packet [DD:RECV]: Unknown LS type %d.",
lsah->type); lsah->type);
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
@ -1146,7 +1146,7 @@ static void ospf_db_desc_proc(struct stream *s, struct ospf_interface *oi,
if (IS_OPAQUE_LSA(lsah->type) if (IS_OPAQUE_LSA(lsah->type)
&& !CHECK_FLAG(nbr->options, OSPF_OPTION_O)) { && !CHECK_FLAG(nbr->options, OSPF_OPTION_O)) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"LSA[Type%d:%s]: Opaque capability mismatch?", "LSA[Type%d:%s]: Opaque capability mismatch?",
lsah->type, inet_ntoa(lsah->id)); lsah->type, inet_ntoa(lsah->id));
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
@ -1161,7 +1161,7 @@ static void ospf_db_desc_proc(struct stream *s, struct ospf_interface *oi,
allow if from NSSA. */ allow if from NSSA. */
if (oi->area->external_routing == OSPF_AREA_STUB) { if (oi->area->external_routing == OSPF_AREA_STUB) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet [DD:RECV]: LSA[Type%d:%s] from %s area.", "Packet [DD:RECV]: LSA[Type%d:%s] from %s area.",
lsah->type, inet_ntoa(lsah->id), lsah->type, inet_ntoa(lsah->id),
(oi->area->external_routing (oi->area->external_routing
@ -1288,7 +1288,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
nbr = ospf_nbr_lookup(oi, iph, ospfh); nbr = ospf_nbr_lookup(oi, iph, ospfh);
if (nbr == NULL) { if (nbr == NULL) {
flog_warn(OSPF_WARN_PACKET, "Packet[DD]: Unknown Neighbor %s", flog_warn(EC_OSPF_PACKET, "Packet[DD]: Unknown Neighbor %s",
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
return; return;
} }
@ -1297,7 +1297,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
if ((OSPF_IF_PARAM(oi, mtu_ignore) == 0) if ((OSPF_IF_PARAM(oi, mtu_ignore) == 0)
&& (ntohs(dd->mtu) > oi->ifp->mtu)) { && (ntohs(dd->mtu) > oi->ifp->mtu)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s MTU %u is larger than [%s]'s MTU %u", "Packet[DD]: Neighbor %s MTU %u is larger than [%s]'s MTU %u",
inet_ntoa(nbr->router_id), ntohs(dd->mtu), IF_NAME(oi), inet_ntoa(nbr->router_id), ntohs(dd->mtu), IF_NAME(oi),
oi->ifp->mtu); oi->ifp->mtu);
@ -1336,7 +1336,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
* In Hello protocol, optional capability must have checked * In Hello protocol, optional capability must have checked
* to prevent this T-bit enabled router be my neighbor. * to prevent this T-bit enabled router be my neighbor.
*/ */
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s: T-bit on?", "Packet[DD]: Neighbor %s: T-bit on?",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
return; return;
@ -1362,7 +1362,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
case NSM_Attempt: case NSM_Attempt:
case NSM_TwoWay: case NSM_TwoWay:
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s state is %s, packet discarded.", "Packet[DD]: Neighbor %s state is %s, packet discarded.",
inet_ntoa(nbr->router_id), inet_ntoa(nbr->router_id),
lookup_msg(ospf_nsm_state_msg, nbr->state, NULL)); lookup_msg(ospf_nsm_state_msg, nbr->state, NULL));
@ -1416,7 +1416,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
/* Reset I, leaving MS */ /* Reset I, leaving MS */
UNSET_FLAG(nbr->dd_flags, OSPF_DD_FLAG_I); UNSET_FLAG(nbr->dd_flags, OSPF_DD_FLAG_I);
} else { } else {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s Negotiation fails.", "Packet[DD]: Neighbor %s Negotiation fails.",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
break; break;
@ -1438,7 +1438,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
&& IPV4_ADDR_SAME(&DR(oi), && IPV4_ADDR_SAME(&DR(oi),
&nbr->address.u.prefix4)) { &nbr->address.u.prefix4)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"DR-neighbor[%s] is NOT opaque-capable; Opaque-LSAs cannot be reliably advertised in this network.", "DR-neighbor[%s] is NOT opaque-capable; Opaque-LSAs cannot be reliably advertised in this network.",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
/* This situation is undesirable, but not a real /* This situation is undesirable, but not a real
@ -1474,7 +1474,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
/* Check Master/Slave bit mismatch */ /* Check Master/Slave bit mismatch */
if (IS_SET_DD_MS(dd->flags) if (IS_SET_DD_MS(dd->flags)
!= IS_SET_DD_MS(nbr->last_recv.flags)) { != IS_SET_DD_MS(nbr->last_recv.flags)) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s MS-bit mismatch.", "Packet[DD]: Neighbor %s MS-bit mismatch.",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
@ -1499,7 +1499,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
/* Save the new options for debugging */ /* Save the new options for debugging */
nbr->options = dd->options; nbr->options = dd->options;
#endif /* ORIGINAL_CODING */ #endif /* ORIGINAL_CODING */
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s options mismatch.", "Packet[DD]: Neighbor %s options mismatch.",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
@ -1512,7 +1512,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
|| (!IS_SET_DD_MS(nbr->dd_flags) || (!IS_SET_DD_MS(nbr->dd_flags)
&& ntohl(dd->dd_seqnum) != nbr->dd_seqnum + 1)) { && ntohl(dd->dd_seqnum) != nbr->dd_seqnum + 1)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s sequence number mismatch.", "Packet[DD]: Neighbor %s sequence number mismatch.",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
@ -1562,7 +1562,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch);
break; break;
default: default:
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet[DD]: Neighbor %s NSM illegal status %u.", "Packet[DD]: Neighbor %s NSM illegal status %u.",
inet_ntoa(nbr->router_id), nbr->state); inet_ntoa(nbr->router_id), nbr->state);
break; break;
@ -1589,7 +1589,7 @@ static void ospf_ls_req(struct ip *iph, struct ospf_header *ospfh,
nbr = ospf_nbr_lookup(oi, iph, ospfh); nbr = ospf_nbr_lookup(oi, iph, ospfh);
if (nbr == NULL) { if (nbr == NULL) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Link State Request: Unknown Neighbor %s.", "Link State Request: Unknown Neighbor %s.",
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
return; return;
@ -1602,7 +1602,7 @@ static void ospf_ls_req(struct ip *iph, struct ospf_header *ospfh,
if (nbr->state != NSM_Exchange && nbr->state != NSM_Loading if (nbr->state != NSM_Exchange && nbr->state != NSM_Loading
&& nbr->state != NSM_Full) { && nbr->state != NSM_Full) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Link State Request received from %s: Neighbor state is %s, packet discarded.", "Link State Request received from %s: Neighbor state is %s, packet discarded.",
inet_ntoa(ospfh->router_id), inet_ntoa(ospfh->router_id),
lookup_msg(ospf_nsm_state_msg, nbr->state, NULL)); lookup_msg(ospf_nsm_state_msg, nbr->state, NULL));
@ -1695,7 +1695,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
if (length > size) { if (length > size) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Link State Update: LSA length exceeds packet size."); "Link State Update: LSA length exceeds packet size.");
break; break;
} }
@ -1710,7 +1710,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
* chance to compress repeated messages in syslog on the * chance to compress repeated messages in syslog on the
* other */ * other */
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Link State Update: LSA checksum error %x/%x, ID=%s from: nbr %s, router ID %s, adv router %s", "Link State Update: LSA checksum error %x/%x, ID=%s from: nbr %s, router ID %s, adv router %s",
sum, lsah->checksum, inet_ntoa(lsah->id), sum, lsah->checksum, inet_ntoa(lsah->id),
inet_ntoa(nbr->src), inet_ntoa(nbr->router_id), inet_ntoa(nbr->src), inet_ntoa(nbr->router_id),
@ -1720,7 +1720,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
/* Examine the LSA's LS type. */ /* Examine the LSA's LS type. */
if (lsah->type < OSPF_MIN_LSA || lsah->type >= OSPF_MAX_LSA) { if (lsah->type < OSPF_MIN_LSA || lsah->type >= OSPF_MAX_LSA) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Link State Update: Unknown LS type %d", "Link State Update: Unknown LS type %d",
lsah->type); lsah->type);
continue; continue;
@ -1745,7 +1745,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
* the bit will be set in Type-9,10,11 LSAs * the bit will be set in Type-9,10,11 LSAs
* only. * only.
*/ */
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"LSA[Type%d:%s]: O-bit abuse?", "LSA[Type%d:%s]: O-bit abuse?",
lsah->type, inet_ntoa(lsah->id)); lsah->type, inet_ntoa(lsah->id));
continue; continue;
@ -1765,7 +1765,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
continue; continue;
} }
} else if (IS_OPAQUE_LSA(lsah->type)) { } else if (IS_OPAQUE_LSA(lsah->type)) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"LSA[Type%d:%s]: Opaque capability mismatch?", "LSA[Type%d:%s]: Opaque capability mismatch?",
lsah->type, inet_ntoa(lsah->id)); lsah->type, inet_ntoa(lsah->id));
continue; continue;
@ -1836,7 +1836,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
/* Check neighbor. */ /* Check neighbor. */
nbr = ospf_nbr_lookup(oi, iph, ospfh); nbr = ospf_nbr_lookup(oi, iph, ospfh);
if (nbr == NULL) { if (nbr == NULL) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Link State Update: Unknown Neighbor %s on int: %s", "Link State Update: Unknown Neighbor %s on int: %s",
inet_ntoa(ospfh->router_id), IF_NAME(oi)); inet_ntoa(ospfh->router_id), IF_NAME(oi));
return; return;
@ -1948,7 +1948,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
char buf2[INET_ADDRSTRLEN]; char buf2[INET_ADDRSTRLEN];
char buf3[INET_ADDRSTRLEN]; char buf3[INET_ADDRSTRLEN];
flog_err(OSPF_ERR_ROUTER_LSA_MISMATCH, flog_err(EC_OSPF_ROUTER_LSA_MISMATCH,
"Incoming Router-LSA from %s with " "Incoming Router-LSA from %s with "
"Adv-ID[%s] != LS-ID[%s]", "Adv-ID[%s] != LS-ID[%s]",
inet_ntop(AF_INET, &ospfh->router_id, inet_ntop(AF_INET, &ospfh->router_id,
@ -1959,7 +1959,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
&lsa->data->adv_router, &lsa->data->adv_router,
buf3, INET_ADDRSTRLEN)); buf3, INET_ADDRSTRLEN));
flog_err( flog_err(
OSPF_ERR_DOMAIN_CORRUPT, EC_OSPF_DOMAIN_CORRUPT,
"OSPF domain compromised by attack or corruption. " "OSPF domain compromised by attack or corruption. "
"Verify correct operation of -ALL- OSPF routers."); "Verify correct operation of -ALL- OSPF routers.");
DISCARD_LSA(lsa, 0); DISCARD_LSA(lsa, 0);
@ -2119,7 +2119,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
if (ospf_ls_request_lookup(nbr, lsa)) { if (ospf_ls_request_lookup(nbr, lsa)) {
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_BadLSReq); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_BadLSReq);
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"LSA[%s] instance exists on Link state request list", "LSA[%s] instance exists on Link state request list",
dump_lsa_key(lsa)); dump_lsa_key(lsa));
@ -2232,7 +2232,7 @@ static void ospf_ls_ack(struct ip *iph, struct ospf_header *ospfh,
nbr = ospf_nbr_lookup(oi, iph, ospfh); nbr = ospf_nbr_lookup(oi, iph, ospfh);
if (nbr == NULL) { if (nbr == NULL) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Link State Acknowledgment: Unknown Neighbor %s.", "Link State Acknowledgment: Unknown Neighbor %s.",
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
return; return;
@ -2303,14 +2303,14 @@ static struct stream *ospf_recv_packet(struct ospf *ospf, int fd,
ret = stream_recvmsg(ibuf, fd, &msgh, 0, OSPF_MAX_PACKET_SIZE + 1); ret = stream_recvmsg(ibuf, fd, &msgh, 0, OSPF_MAX_PACKET_SIZE + 1);
if (ret < 0) { if (ret < 0) {
flog_warn(OSPF_WARN_PACKET, "stream_recvmsg failed: %s", flog_warn(EC_OSPF_PACKET, "stream_recvmsg failed: %s",
safe_strerror(errno)); safe_strerror(errno));
return NULL; return NULL;
} }
if ((unsigned int)ret < sizeof(iph)) /* ret must be > 0 now */ if ((unsigned int)ret < sizeof(iph)) /* ret must be > 0 now */
{ {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"ospf_recv_packet: discarding runt packet of length %d " "ospf_recv_packet: discarding runt packet of length %d "
"(ip header size is %u)", "(ip header size is %u)",
ret, (unsigned int)sizeof(iph)); ret, (unsigned int)sizeof(iph));
@ -2357,7 +2357,7 @@ static struct stream *ospf_recv_packet(struct ospf *ospf, int fd,
if (ret != ip_len) { if (ret != ip_len) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"ospf_recv_packet read length mismatch: ip_len is %d, " "ospf_recv_packet read length mismatch: ip_len is %d, "
"but recvmsg returned %d", "but recvmsg returned %d",
ip_len, ret); ip_len, ret);
@ -2464,7 +2464,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
if (OSPF_AUTH_NULL != (iface_auth_type = ospf_auth_type(oi))) { if (OSPF_AUTH_NULL != (iface_auth_type = ospf_auth_type(oi))) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: auth-type mismatch, local %s, rcvd Null", "interface %s: auth-type mismatch, local %s, rcvd Null",
IF_NAME(oi), IF_NAME(oi),
lookup_msg(ospf_auth_type_str, lookup_msg(ospf_auth_type_str,
@ -2474,7 +2474,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
if (!ospf_check_sum(ospfh)) { if (!ospf_check_sum(ospfh)) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: Null auth OK, but checksum error, Router-ID %s", "interface %s: Null auth OK, but checksum error, Router-ID %s",
IF_NAME(oi), IF_NAME(oi),
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
@ -2486,7 +2486,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
!= (iface_auth_type = ospf_auth_type(oi))) { != (iface_auth_type = ospf_auth_type(oi))) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: auth-type mismatch, local %s, rcvd Simple", "interface %s: auth-type mismatch, local %s, rcvd Simple",
IF_NAME(oi), IF_NAME(oi),
lookup_msg(ospf_auth_type_str, lookup_msg(ospf_auth_type_str,
@ -2496,7 +2496,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
if (memcmp(OSPF_IF_PARAM(oi, auth_simple), ospfh->u.auth_data, if (memcmp(OSPF_IF_PARAM(oi, auth_simple), ospfh->u.auth_data,
OSPF_AUTH_SIMPLE_SIZE)) { OSPF_AUTH_SIMPLE_SIZE)) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"interface %s: Simple auth failed", "interface %s: Simple auth failed",
IF_NAME(oi)); IF_NAME(oi));
return 0; return 0;
@ -2504,7 +2504,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
if (!ospf_check_sum(ospfh)) { if (!ospf_check_sum(ospfh)) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: Simple auth OK, checksum error, Router-ID %s", "interface %s: Simple auth OK, checksum error, Router-ID %s",
IF_NAME(oi), IF_NAME(oi),
inet_ntoa(ospfh->router_id)); inet_ntoa(ospfh->router_id));
@ -2516,7 +2516,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
!= (iface_auth_type = ospf_auth_type(oi))) { != (iface_auth_type = ospf_auth_type(oi))) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: auth-type mismatch, local %s, rcvd Cryptographic", "interface %s: auth-type mismatch, local %s, rcvd Cryptographic",
IF_NAME(oi), IF_NAME(oi),
lookup_msg(ospf_auth_type_str, lookup_msg(ospf_auth_type_str,
@ -2526,7 +2526,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
if (ospfh->checksum) { if (ospfh->checksum) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: OSPF header checksum is not 0", "interface %s: OSPF header checksum is not 0",
IF_NAME(oi)); IF_NAME(oi));
return 0; return 0;
@ -2541,7 +2541,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
bug? */ bug? */
!ospf_check_md5_digest(oi, ospfh)) { !ospf_check_md5_digest(oi, ospfh)) {
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn(OSPF_WARN_MD5, flog_warn(EC_OSPF_MD5,
"interface %s: MD5 auth failed", "interface %s: MD5 auth failed",
IF_NAME(oi)); IF_NAME(oi));
return 0; return 0;
@ -2550,7 +2550,7 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
default: default:
if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV)) if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: invalid packet auth-type (%02x)", "interface %s: invalid packet auth-type (%02x)",
IF_NAME(oi), pkt_auth_type); IF_NAME(oi), pkt_auth_type);
return 0; return 0;
@ -2899,7 +2899,7 @@ static int ospf_verify_header(struct stream *ibuf, struct ospf_interface *oi,
{ {
/* Check Area ID. */ /* Check Area ID. */
if (!ospf_check_area_id(oi, ospfh)) { if (!ospf_check_area_id(oi, ospfh)) {
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"interface %s: ospf_read invalid Area ID %s.", "interface %s: ospf_read invalid Area ID %s.",
IF_NAME(oi), inet_ntoa(ospfh->area_id)); IF_NAME(oi), inet_ntoa(ospfh->area_id));
return -1; return -1;
@ -2908,7 +2908,7 @@ static int ospf_verify_header(struct stream *ibuf, struct ospf_interface *oi,
/* Check network mask, Silently discarded. */ /* Check network mask, Silently discarded. */
if (!ospf_check_network_mask(oi, iph->ip_src)) { if (!ospf_check_network_mask(oi, iph->ip_src)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"interface %s: ospf_read network address is not same [%s]", "interface %s: ospf_read network address is not same [%s]",
IF_NAME(oi), inet_ntoa(iph->ip_src)); IF_NAME(oi), inet_ntoa(iph->ip_src));
return -1; return -1;
@ -3053,14 +3053,14 @@ int ospf_read(struct thread *thread)
*/ */
else if (oi->ifp != ifp) { else if (oi->ifp != ifp) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"Packet from [%s] received on wrong link %s", "Packet from [%s] received on wrong link %s",
inet_ntoa(iph->ip_src), ifp->name); inet_ntoa(iph->ip_src), ifp->name);
return 0; return 0;
} else if (oi->state == ISM_Down) { } else if (oi->state == ISM_Down) {
char buf[2][INET_ADDRSTRLEN]; char buf[2][INET_ADDRSTRLEN];
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Ignoring packet from %s to %s received on interface that is " "Ignoring packet from %s to %s received on interface that is "
"down [%s]; interface flags are %s", "down [%s]; interface flags are %s",
inet_ntop(AF_INET, &iph->ip_src, buf[0], inet_ntop(AF_INET, &iph->ip_src, buf[0],
@ -3086,7 +3086,7 @@ int ospf_read(struct thread *thread)
if (iph->ip_dst.s_addr == htonl(OSPF_ALLDROUTERS) if (iph->ip_dst.s_addr == htonl(OSPF_ALLDROUTERS)
&& (oi->state != ISM_DR && oi->state != ISM_Backup)) { && (oi->state != ISM_DR && oi->state != ISM_Backup)) {
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"Dropping packet for AllDRouters from [%s] via [%s] (ISM: %s)", "Dropping packet for AllDRouters from [%s] via [%s] (ISM: %s)",
inet_ntoa(iph->ip_src), IF_NAME(oi), inet_ntoa(iph->ip_src), IF_NAME(oi),
lookup_msg(ospf_ism_state_msg, oi->state, NULL)); lookup_msg(ospf_ism_state_msg, oi->state, NULL));
@ -3149,7 +3149,7 @@ int ospf_read(struct thread *thread)
ospf_ls_ack(iph, ospfh, ibuf, oi, length); ospf_ls_ack(iph, ospfh, ibuf, oi, length);
break; break;
default: default:
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"interface %s: OSPF packet header type %d is illegal", "interface %s: OSPF packet header type %d is illegal",
IF_NAME(oi), ospfh->type); IF_NAME(oi), ospfh->type);
break; break;
@ -3882,7 +3882,7 @@ static struct ospf_packet *ospf_ls_upd_packet_new(struct list *update,
> ospf_packet_max(oi)) { > ospf_packet_max(oi)) {
if (!warned) { if (!warned) {
flog_warn( flog_warn(
OSPF_WARN_LARGE_LSA, EC_OSPF_LARGE_LSA,
"ospf_ls_upd_packet_new: oversized LSA encountered!" "ospf_ls_upd_packet_new: oversized LSA encountered!"
"will need to fragment. Not optimal. Try divide up" "will need to fragment. Not optimal. Try divide up"
" your network with areas. Use 'debug ospf packet send'" " your network with areas. Use 'debug ospf packet send'"
@ -3910,7 +3910,7 @@ static struct ospf_packet *ospf_ls_upd_packet_new(struct list *update,
size = oi->ifp->mtu; size = oi->ifp->mtu;
if (size > OSPF_MAX_PACKET_SIZE) { if (size > OSPF_MAX_PACKET_SIZE) {
flog_warn(OSPF_WARN_LARGE_LSA, flog_warn(EC_OSPF_LARGE_LSA,
"ospf_ls_upd_packet_new: oversized LSA id:%s too big," "ospf_ls_upd_packet_new: oversized LSA id:%s too big,"
" %d bytes, packet size %ld, dropping it completely." " %d bytes, packet size %ld, dropping it completely."
" OSPF routing is broken!", " OSPF routing is broken!",
@ -4072,10 +4072,10 @@ void ospf_ls_upd_send(struct ospf_neighbor *nbr, struct list *update, int flag,
if (oi->type == OSPF_IFTYPE_NBMA) { if (oi->type == OSPF_IFTYPE_NBMA) {
if (flag == OSPF_SEND_PACKET_INDIRECT) if (flag == OSPF_SEND_PACKET_INDIRECT)
flog_warn( flog_warn(
OSPF_WARN_PACKET, EC_OSPF_PACKET,
"* LS-Update is directly sent on NBMA network."); "* LS-Update is directly sent on NBMA network.");
if (IPV4_ADDR_SAME(&oi->address->u.prefix4, &p.prefix)) if (IPV4_ADDR_SAME(&oi->address->u.prefix4, &p.prefix))
flog_warn(OSPF_WARN_PACKET, flog_warn(EC_OSPF_PACKET,
"* LS-Update is sent to myself."); "* LS-Update is sent to myself.");
} }

View File

@ -187,7 +187,7 @@ static int ospf_router_info_register(uint8_t scope)
if (rc != 0) { if (rc != 0) {
flog_warn( flog_warn(
OSPF_WARN_OPAQUE_REGISTRATION, EC_OSPF_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register functions"); "ospf_router_info_init: Failed to register functions");
return rc; return rc;
} }
@ -829,7 +829,7 @@ static int ospf_router_info_lsa_originate1(void *arg)
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA_INSTALL_FAILURE, EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_router_info_lsa_originate1: ospf_lsa_install() ?"); "ospf_router_info_lsa_originate1: ospf_lsa_install() ?");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return rc; return rc;
@ -879,7 +879,7 @@ static int ospf_router_info_lsa_originate(void *arg)
} else { } else {
if (!is_mandated_params_set(OspfRI)) if (!is_mandated_params_set(OspfRI))
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_router_info_lsa_originate: lacks mandated ROUTER INFORMATION parameters"); "ospf_router_info_lsa_originate: lacks mandated ROUTER INFORMATION parameters");
/* Ok, let's try to originate an LSA */ /* Ok, let's try to originate an LSA */
@ -911,7 +911,7 @@ static struct ospf_lsa *ospf_router_info_lsa_refresh(struct ospf_lsa *lsa)
/* Verify that the Router Information ID is supported */ /* Verify that the Router Information ID is supported */
if (GET_OPAQUE_ID(ntohl(lsa->data->id.s_addr)) != 0) { if (GET_OPAQUE_ID(ntohl(lsa->data->id.s_addr)) != 0) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_router_info_lsa_refresh: Unsupported Router Information ID"); "ospf_router_info_lsa_refresh: Unsupported Router Information ID");
return NULL; return NULL;
} }
@ -932,7 +932,7 @@ static struct ospf_lsa *ospf_router_info_lsa_refresh(struct ospf_lsa *lsa)
/* Given "lsa" will be freed in the next function. */ /* Given "lsa" will be freed in the next function. */
top = ospf_lookup_by_vrf_id(lsa->vrf_id); top = ospf_lookup_by_vrf_id(lsa->vrf_id);
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_router_info_lsa_refresh: ospf_lsa_install() ?"); "ospf_router_info_lsa_refresh: ospf_lsa_install() ?");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return new; return new;
@ -982,7 +982,7 @@ static void ospf_router_info_lsa_schedule(enum lsa_opcode opcode)
top = ospf_lookup_by_vrf_id(VRF_DEFAULT); top = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if ((OspfRI.scope == OSPF_OPAQUE_AREA_LSA) && (OspfRI.area == NULL)) { if ((OspfRI.scope == OSPF_OPAQUE_AREA_LSA) && (OspfRI.area == NULL)) {
flog_warn( flog_warn(
OSPF_WARN_LSA, EC_OSPF_LSA,
"ospf_router_info_lsa_schedule(): Router Info is Area scope flooding but area is not set"); "ospf_router_info_lsa_schedule(): Router Info is Area scope flooding but area is not set");
OspfRI.area = ospf_area_lookup_by_area_id(top, OspfRI.area_id); OspfRI.area = ospf_area_lookup_by_area_id(top, OspfRI.area_id);
} }
@ -1023,7 +1023,7 @@ static int ospf_router_info_lsa_update(struct ospf_lsa *lsa)
/* Sanity Check */ /* Sanity Check */
if (lsa == NULL) { if (lsa == NULL) {
flog_warn(OSPF_WARN_LSA, "OSPF-RI (%s): Abort! LSA is NULL", flog_warn(EC_OSPF_LSA, "OSPF-RI (%s): Abort! LSA is NULL",
__func__); __func__);
return -1; return -1;
} }
@ -1449,7 +1449,7 @@ DEFUN (router_info,
vty_out(vty, vty_out(vty,
"%% Unable to register Router Information callbacks."); "%% Unable to register Router Information callbacks.");
flog_err( flog_err(
OSPF_ERR_INIT_FAIL, EC_OSPF_INIT_FAIL,
"Unable to register Router Information callbacks. Abort!"); "Unable to register Router Information callbacks. Abort!");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }

View File

@ -393,7 +393,7 @@ static void *route_set_metric_compile(const char *arg)
metric->type = metric_absolute; metric->type = metric_absolute;
if (strmatch(arg, "+rtt") || strmatch(arg, "-rtt")) { if (strmatch(arg, "+rtt") || strmatch(arg, "-rtt")) {
flog_warn(OSPF_WARN_SET_METRIC_PLUS, flog_warn(EC_OSPF_SET_METRIC_PLUS,
"OSPF does not support 'set metric +rtt / -rtt'"); "OSPF does not support 'set metric +rtt / -rtt'");
return metric; return metric;
} }

View File

@ -860,7 +860,7 @@ static void ospf_spf_next(struct vertex *v, struct ospf *ospf,
zlog_debug("found the LSA"); zlog_debug("found the LSA");
break; break;
default: default:
flog_warn(OSPF_WARN_LSA, flog_warn(EC_OSPF_LSA,
"Invalid LSA link type %d", type); "Invalid LSA link type %d", type);
continue; continue;
} }

View File

@ -821,7 +821,7 @@ static struct sr_prefix *get_ext_prefix_sid(struct tlv_header *tlvh)
case EXT_SUBTLV_PREFIX_SID: case EXT_SUBTLV_PREFIX_SID:
psid = (struct ext_subtlv_prefix_sid *)sub_tlvh; psid = (struct ext_subtlv_prefix_sid *)sub_tlvh;
if (psid->algorithm != SR_ALGORITHM_SPF) { if (psid->algorithm != SR_ALGORITHM_SPF) {
flog_err(OSPF_ERR_INVALID_ALGORITHM, flog_err(EC_OSPF_INVALID_ALGORITHM,
"SR (%s): Unsupported Algorithm", "SR (%s): Unsupported Algorithm",
__func__); __func__);
XFREE(MTYPE_OSPF_SR_PARAMS, srp); XFREE(MTYPE_OSPF_SR_PARAMS, srp);
@ -1102,7 +1102,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
return; return;
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR DataBase", __func__); "SR (%s): Abort! no valid SR DataBase", __func__);
return; return;
} }
@ -1113,14 +1113,14 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_NODE_CREATE, flog_err(EC_OSPF_SR_NODE_CREATE,
"SR (%s): Abort! can't create SR node in hash table", "SR (%s): Abort! can't create SR node in hash table",
__func__); __func__);
return; return;
} }
if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) { if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) {
flog_err(OSPF_ERR_SR_INVALID_LSA_ID, flog_err(EC_OSPF_SR_INVALID_LSA_ID,
"SR (%s): Abort! Wrong " "SR (%s): Abort! Wrong "
"LSA ID 4.0.0.%u for SR node %s/%u", "LSA ID 4.0.0.%u for SR node %s/%u",
__func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)), __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
@ -1167,7 +1167,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
/* Check that we collect mandatory parameters */ /* Check that we collect mandatory parameters */
if (srn->algo[0] == SR_ALGORITHM_UNSET || srgb.range_size == 0 if (srn->algo[0] == SR_ALGORITHM_UNSET || srgb.range_size == 0
|| srgb.lower_bound == 0) { || srgb.lower_bound == 0) {
flog_err(OSPF_ERR_SR_NODE_CREATE, flog_err(EC_OSPF_SR_NODE_CREATE,
"SR (%s): Missing mandatory parameters. Abort!", "SR (%s): Missing mandatory parameters. Abort!",
__func__); __func__);
hash_release(OspfSR.neighbors, &(srn->adv_router)); hash_release(OspfSR.neighbors, &(srn->adv_router));
@ -1214,7 +1214,7 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR Data Base", __func__); "SR (%s): Abort! no valid SR Data Base", __func__);
return; return;
} }
@ -1224,7 +1224,7 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_NODE_CREATE, flog_err(EC_OSPF_SR_NODE_CREATE,
"SR (%s): Abort! no entry in SRDB for SR Node %s", "SR (%s): Abort! no entry in SRDB for SR Node %s",
__func__, inet_ntoa(lsah->adv_router)); __func__, inet_ntoa(lsah->adv_router));
return; return;
@ -1232,7 +1232,7 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) { if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) {
flog_err( flog_err(
OSPF_ERR_SR_INVALID_LSA_ID, EC_OSPF_SR_INVALID_LSA_ID,
"SR (%s): Abort! Wrong LSA ID 4.0.0.%u for SR node %s", "SR (%s): Abort! Wrong LSA ID 4.0.0.%u for SR node %s",
__func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)), __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
inet_ntoa(lsah->adv_router)); inet_ntoa(lsah->adv_router));
@ -1261,7 +1261,7 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR DataBase", __func__); "SR (%s): Abort! no valid SR DataBase", __func__);
return; return;
} }
@ -1273,7 +1273,7 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_NODE_CREATE, flog_err(EC_OSPF_SR_NODE_CREATE,
"SR (%s): Abort! can't create SR node in hash table", "SR (%s): Abort! can't create SR node in hash table",
__func__); __func__);
return; return;
@ -1313,7 +1313,7 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR DataBase", __func__); "SR (%s): Abort! no valid SR DataBase", __func__);
return; return;
} }
@ -1327,7 +1327,7 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
* processing Router Information LSA deletion * processing Router Information LSA deletion
*/ */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Stop! no entry in SRDB for SR Node %s", "SR (%s): Stop! no entry in SRDB for SR Node %s",
__func__, inet_ntoa(lsah->adv_router)); __func__, inet_ntoa(lsah->adv_router));
return; return;
@ -1345,7 +1345,7 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
listnode_delete(srn->ext_link, srl); listnode_delete(srn->ext_link, srl);
XFREE(MTYPE_OSPF_SR_PARAMS, srl); XFREE(MTYPE_OSPF_SR_PARAMS, srl);
} else { } else {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Didn't found corresponding SR Link 8.0.0.%u " "SR (%s): Didn't found corresponding SR Link 8.0.0.%u "
"for SR Node %s", "for SR Node %s",
__func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)), __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
@ -1372,7 +1372,7 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR DataBase", __func__); "SR (%s): Abort! no valid SR DataBase", __func__);
return; return;
} }
@ -1384,7 +1384,7 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_NODE_CREATE, flog_err(EC_OSPF_SR_NODE_CREATE,
"SR (%s): Abort! can't create SR node in hash table", "SR (%s): Abort! can't create SR node in hash table",
__func__); __func__);
return; return;
@ -1425,7 +1425,7 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */ /* Sanity check */
if (OspfSR.neighbors == NULL) { if (OspfSR.neighbors == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Abort! no valid SR DataBase", __func__); "SR (%s): Abort! no valid SR DataBase", __func__);
return; return;
} }
@ -1439,7 +1439,7 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
* processing Router Information LSA deletion * processing Router Information LSA deletion
*/ */
if (srn == NULL) { if (srn == NULL) {
flog_err(OSPF_ERR_SR_INVALID_DB, flog_err(EC_OSPF_SR_INVALID_DB,
"SR (%s): Stop! no entry in SRDB for SR Node %s", "SR (%s): Stop! no entry in SRDB for SR Node %s",
__func__, inet_ntoa(lsah->adv_router)); __func__, inet_ntoa(lsah->adv_router));
return; return;
@ -1457,7 +1457,7 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
XFREE(MTYPE_OSPF_SR_PARAMS, srp); XFREE(MTYPE_OSPF_SR_PARAMS, srp);
} else { } else {
flog_err( flog_err(
OSPF_ERR_SR_INVALID_DB, EC_OSPF_SR_INVALID_DB,
"SR (%s): Didn't found corresponding SR Prefix 7.0.0.%u for SR Node %s", "SR (%s): Didn't found corresponding SR Prefix 7.0.0.%u for SR Node %s",
__func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)), __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
inet_ntoa(lsah->adv_router)); inet_ntoa(lsah->adv_router));

View File

@ -104,7 +104,7 @@ int ospf_mpls_te_init(void)
NULL /* ospf_mpls_te_del_lsa_hook */); NULL /* ospf_mpls_te_del_lsa_hook */);
if (rc != 0) { if (rc != 0) {
flog_warn( flog_warn(
OSPF_WARN_OPAQUE_REGISTRATION, EC_OSPF_OPAQUE_REGISTRATION,
"ospf_mpls_te_init: Failed to register Traffic Engineering functions"); "ospf_mpls_te_init: Failed to register Traffic Engineering functions");
return rc; return rc;
} }
@ -142,7 +142,7 @@ static int ospf_mpls_te_register(enum inter_as_mode mode)
if (rc != 0) { if (rc != 0) {
flog_warn( flog_warn(
OSPF_WARN_OPAQUE_REGISTRATION, EC_OSPF_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register Inter-AS functions"); "ospf_router_info_init: Failed to register Inter-AS functions");
return rc; return rc;
} }
@ -820,19 +820,19 @@ static int is_mandated_params_set(struct mpls_te_link *lp)
if (ntohs(OspfMplsTE.router_addr.header.type) == 0) { if (ntohs(OspfMplsTE.router_addr.header.type) == 0) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"MPLS-TE(is_mandated_params_set) Missing Router Address"); "MPLS-TE(is_mandated_params_set) Missing Router Address");
return rc; return rc;
} }
if (ntohs(lp->link_type.header.type) == 0) { if (ntohs(lp->link_type.header.type) == 0) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(EC_OSPF_TE_UNEXPECTED,
"MPLS-TE(is_mandated_params_set) Missing Link Type"); "MPLS-TE(is_mandated_params_set) Missing Link Type");
return rc; return rc;
} }
if (!IS_INTER_AS(lp->type) && (ntohs(lp->link_id.header.type) == 0)) { if (!IS_INTER_AS(lp->type) && (ntohs(lp->link_id.header.type) == 0)) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(EC_OSPF_TE_UNEXPECTED,
"MPLS-TE(is_mandated_params_set) Missing Link ID"); "MPLS-TE(is_mandated_params_set) Missing Link ID");
return rc; return rc;
} }
@ -925,7 +925,7 @@ void ospf_mpls_te_update_if(struct interface *ifp)
/* Get Link context from interface */ /* Get Link context from interface */
if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL) { if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", "OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s",
ifp->name); ifp->name);
return; return;
@ -970,7 +970,7 @@ static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_state)
if ((lp = lookup_linkparams_by_ifp(oi->ifp)) == NULL) { if ((lp = lookup_linkparams_by_ifp(oi->ifp)) == NULL) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?", "ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?",
IF_NAME(oi)); IF_NAME(oi));
return; return;
@ -978,7 +978,7 @@ static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_state)
if (oi->area == NULL || oi->area->ospf == NULL) { if (oi->area == NULL || oi->area->ospf == NULL) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?", "ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?",
IF_NAME(oi)); IF_NAME(oi));
return; return;
@ -989,7 +989,7 @@ static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_state)
|| (lp->area != NULL && oi->area == NULL)) { || (lp->area != NULL && oi->area == NULL)) {
/* How should we consider this case? */ /* How should we consider this case? */
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs", "MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs",
IF_NAME(oi), IF_NAME(oi),
oi->area ? inet_ntoa(oi->area->area_id) : "N/A"); oi->area ? inet_ntoa(oi->area->area_id) : "N/A");
@ -1224,14 +1224,14 @@ static int ospf_mpls_te_lsa_originate1(struct ospf_area *area,
new = ospf_mpls_te_lsa_new(area->ospf, area, lp); new = ospf_mpls_te_lsa_new(area->ospf, area, lp);
if (new == NULL) { if (new == NULL) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?"); "ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?");
return rc; return rc;
} }
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(area->ospf, NULL /*oi*/, new) == NULL) { if (ospf_lsa_install(area->ospf, NULL /*oi*/, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_mpls_te_lsa_originate1: ospf_lsa_install() ?"); "ospf_mpls_te_lsa_originate1: ospf_lsa_install() ?");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return rc; return rc;
@ -1326,7 +1326,7 @@ static int ospf_mpls_te_lsa_originate2(struct ospf *top,
new = ospf_mpls_te_lsa_new(top, NULL, lp); new = ospf_mpls_te_lsa_new(top, NULL, lp);
if (new == NULL) { if (new == NULL) {
flog_warn( flog_warn(
OSPF_WARN_LSA_UNEXPECTED, EC_OSPF_LSA_UNEXPECTED,
"ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?"); "ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?");
return rc; return rc;
} }
@ -1334,7 +1334,7 @@ static int ospf_mpls_te_lsa_originate2(struct ospf *top,
/* Install this LSA into LSDB. */ /* Install this LSA into LSDB. */
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_mpls_te_lsa_originate2: ospf_lsa_install() ?"); "ospf_mpls_te_lsa_originate2: ospf_lsa_install() ?");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return rc; return rc;
@ -1390,7 +1390,7 @@ static int ospf_mpls_te_lsa_originate_as(void *arg)
if (!is_mandated_params_set(lp)) { if (!is_mandated_params_set(lp)) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.", "ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.",
lp->ifp ? lp->ifp->name : "?"); lp->ifp ? lp->ifp->name : "?");
continue; continue;
@ -1437,7 +1437,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
/* At first, resolve lsa/lp relationship. */ /* At first, resolve lsa/lp relationship. */
if ((lp = lookup_linkparams_by_instance(lsa)) == NULL) { if ((lp = lookup_linkparams_by_instance(lsa)) == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_refresh: Invalid parameter?"); "ospf_mpls_te_lsa_refresh: Invalid parameter?");
lsa->data->ls_age = lsa->data->ls_age =
htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */ htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */
@ -1448,7 +1448,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
/* Check if lp was not disable in the interval */ /* Check if lp was not disable in the interval */
if (!CHECK_FLAG(lp->flags, LPFLG_LSA_ACTIVE)) { if (!CHECK_FLAG(lp->flags, LPFLG_LSA_ACTIVE)) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_refresh: lp was disabled: Flush it!"); "ospf_mpls_te_lsa_refresh: lp was disabled: Flush it!");
lsa->data->ls_age = lsa->data->ls_age =
htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */ htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */
@ -1464,7 +1464,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
/* Create new Opaque-LSA/MPLS-TE instance. */ /* Create new Opaque-LSA/MPLS-TE instance. */
new = ospf_mpls_te_lsa_new(top, area, lp); new = ospf_mpls_te_lsa_new(top, area, lp);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_refresh: ospf_mpls_te_lsa_new() ?"); "ospf_mpls_te_lsa_refresh: ospf_mpls_te_lsa_new() ?");
return NULL; return NULL;
} }
@ -1478,7 +1478,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
top = area->ospf; top = area->ospf;
if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) { if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE, flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
"ospf_mpls_te_lsa_refresh: ospf_lsa_install() ?"); "ospf_mpls_te_lsa_refresh: ospf_lsa_install() ?");
ospf_lsa_unlock(&new); ospf_lsa_unlock(&new);
return NULL; return NULL;
@ -1534,7 +1534,7 @@ void ospf_mpls_te_lsa_schedule(struct mpls_te_link *lp, enum lsa_opcode opcode)
/* Unable to set the area context. Abort! */ /* Unable to set the area context. Abort! */
if (lp->area == NULL) { if (lp->area == NULL) {
flog_warn( flog_warn(
OSPF_WARN_TE_UNEXPECTED, EC_OSPF_TE_UNEXPECTED,
"MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !"); "MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !");
return; return;
} }
@ -1577,7 +1577,7 @@ void ospf_mpls_te_lsa_schedule(struct mpls_te_link *lp, enum lsa_opcode opcode)
ospf_opaque_lsa_flush_schedule(&lsa); ospf_opaque_lsa_flush_schedule(&lsa);
break; break;
default: default:
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(EC_OSPF_TE_UNEXPECTED,
"ospf_mpls_te_lsa_schedule: Unknown opcode (%u)", "ospf_mpls_te_lsa_schedule: Unknown opcode (%u)",
opcode); opcode);
break; break;