Commit d4bc4fa3 authored by Stefan Becker's avatar Stefan Becker

build: make prefix option accept a list of strings

The parameter for the ignored network interface prefix build option
accepts a comma-separated string now. This list will be converted to a
comma-separated list of string literals for the C code.

Disable the feature:

   ./configure ...
   ./configure --with-ignored-network-interface-prefix= ...
   meson setup -D ignored-network-interface-prefix= ...
   meson setup -D ignored-network-interface-prefix=[] ...

Ignore interfaces whose names start with "virbr":

   ./configure --with-ignored-network-interface-prefix=virbr ...
   meson setup -D ignored-network-interface-prefix=virbr ...

Ignore interfaces whose names start with "virbr" or "veth":

   ./configure --with-ignored-network-interface-prefix=virbr,veth ...
   meson setup -D ignored-network-interface-prefix=virbr,veth ...
parent 7b4b46f9
......@@ -395,16 +395,17 @@ AM_CONDITIONAL([ENABLE_GTK_DOC], false)
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([1.30.0])
dnl Ignore a specific network interface name prefix from the connection check
AC_MSG_CHECKING([whether to ignore a specific network interface name prefix])
dnl Ignore specific network interface name prefixes from the connection check
AC_MSG_CHECKING([whether to ignore specific network interface name prefixes])
AC_ARG_WITH([ignored-network-interface-prefix],
[AS_HELP_STRING([--with-ignored-network-interface-prefix=string],
[Ignore network interfaces whose name starts with "string" from the ICE connection
[AS_HELP_STRING([--with-ignored-network-interface-prefix=string@<:@,string...@:>@],
[Ignore network interfaces whose name starts with a string from this list in the ICE connection
check algorithm. For example, interfaces "virbr" in the case of the virtual bridge
handled by libvirtd, do not help in finding connectivity.])],
[interface_prefix="$withval"])
AS_IF([test -n "$interface_prefix"],
[AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix"],
[[interface_prefix_list=`echo $interface_prefix | sed 's/,/","/g'`]
AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix_list"],
[Ignore this network interface prefix from the connection check])
AC_MSG_RESULT([yes, $interface_prefix])],
[AC_MSG_RESULT([no])])
......
......@@ -232,8 +232,12 @@ nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun')
nice_deps = gio_deps + [gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs
ignored_iface_prefix = get_option('ignored-network-interface-prefix')
if ignored_iface_prefix != ''
cdata.set_quoted('IGNORED_IFACE_PREFIX', ignored_iface_prefix)
if ignored_iface_prefix != []
ignored_iface_prefix_quoted = []
foreach i : ignored_iface_prefix
ignored_iface_prefix_quoted += '"' + i + '"'
endforeach
cdata.set('IGNORED_IFACE_PREFIX', ','.join(ignored_iface_prefix_quoted))
endif
gir = find_program('g-ir-scanner', required : get_option('introspection'))
......
......@@ -2,8 +2,8 @@ option('gupnp', type: 'feature', value: 'auto',
description: 'Enable or disable GUPnP IGD support')
option('gstreamer', type: 'feature', value: 'auto',
description: 'Enable or disable build of GStreamer plugins')
option('ignored-network-interface-prefix', type: 'string', value: '',
description: 'Ignore network interfaces whose name starts with this string in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
option('ignored-network-interface-prefix', type: 'array', value: [],
description: 'Ignore network interfaces whose name starts with a string from this list in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto')
# Common feature options
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment