[host] app: do not try to use deprecated interfaces automatically

This commit is contained in:
Geoffrey McRae 2024-03-11 12:46:02 +11:00
parent 989fe2bb0b
commit 90398bc04f
2 changed files with 14 additions and 2 deletions

View File

@ -112,6 +112,8 @@ typedef struct CaptureInterface
{
const char * shortName;
const bool asyncCapture;
const bool deprecated;
const char * (*getName )(void);
void (*initOptions )(void);

View File

@ -894,8 +894,18 @@ int app_main(int argc, char * argv[])
CaptureInterface * iface = NULL;
for(int i = 0; CaptureInterfaces[i]; ++i)
{
if (*ifaceName && strcasecmp(ifaceName, CaptureInterfaces[i]->shortName))
if (*ifaceName)
{
if (strcasecmp(ifaceName, CaptureInterfaces[i]->shortName) != 0)
continue;
}
else
{
/* do not try to init deprecated interfaces unless they are explicity
selected in the host configuration */
if (CaptureInterfaces[i]->deprecated)
continue;
}
iface = CaptureInterfaces[i];
DEBUG_INFO("Trying : %s", iface->getName());