dpdk: ips output cleanups

pull/8304/head
Victor Julien 4 years ago
parent 62a451a9ab
commit b08e3e7460

@ -631,11 +631,6 @@ static int ConfigSetCopyIfaceSettings(DPDKIfaceConfig *iconf, const char *iface,
SCReturnInt(-EINVAL); SCReturnInt(-EINVAL);
} }
if (iconf->copy_mode == DPDK_COPY_MODE_IPS)
SCLogInfo("DPDK IPS mode activated between %s and %s", iconf->iface, iconf->out_iface);
else if (iconf->copy_mode == DPDK_COPY_MODE_TAP)
SCLogInfo("DPDK IPS mode activated between %s and %s", iconf->iface, iconf->out_iface);
SCReturnInt(0); SCReturnInt(0);
} }
@ -744,14 +739,20 @@ static int ConfigLoad(DPDKIfaceConfig *iconf, const char *iface)
if (retval < 0) if (retval < 0)
SCReturnInt(retval); SCReturnInt(retval);
retval = retval = ConfGetChildValueWithDefault(if_root, if_default, dpdk_yaml.copy_mode, &copy_mode_str);
ConfGetChildValueWithDefault(if_root, if_default, dpdk_yaml.copy_mode, &copy_mode_str) | if (retval != 1)
ConfGetChildValueWithDefault( SCReturnInt(-ENOENT);
if_root, if_default, dpdk_yaml.copy_iface, &copy_iface_str); if (retval < 0)
// if one of copy interface settings fail to load then the default values are set SCReturnInt(retval);
retval = retval != 1 ? ConfigSetCopyIfaceSettings(iconf, DPDK_CONFIG_DEFAULT_COPY_INTERFACE,
DPDK_CONFIG_DEFAULT_COPY_MODE) retval = ConfGetChildValueWithDefault(
: ConfigSetCopyIfaceSettings(iconf, copy_iface_str, copy_mode_str); if_root, if_default, dpdk_yaml.copy_iface, &copy_iface_str);
if (retval != 1)
SCReturnInt(-ENOENT);
if (retval < 0)
SCReturnInt(retval);
retval = ConfigSetCopyIfaceSettings(iconf, copy_iface_str, copy_mode_str);
if (retval < 0) if (retval < 0)
SCReturnInt(retval); SCReturnInt(retval);
@ -1174,6 +1175,13 @@ static int DeviceConfigureIPS(DPDKIfaceConfig *iconf)
// Error will be written out by the validation function // Error will be written out by the validation function
SCReturnInt(retval); SCReturnInt(retval);
} }
if (iconf->copy_mode == DPDK_COPY_MODE_IPS)
SCLogInfo("%s: DPDK IPS mode activated: %s->%s", iconf->iface, iconf->iface,
iconf->out_iface);
else if (iconf->copy_mode == DPDK_COPY_MODE_TAP)
SCLogInfo("%s: DPDK TAP mode activated: %s->%s", iconf->iface, iconf->iface,
iconf->out_iface);
} }
SCReturnInt(0); SCReturnInt(0);
} }

Loading…
Cancel
Save