Discover camera in DHCP mode

Aravis does not see devices configured with a wrong subnet with respect to the NIC it is connected to because aravis binds its listening socket to the NIC address.

A possible solution would be to bind the socket to INADDR_ANY and use SO_BINDTODEVICE socket option. This would allow aravis to receive any discovery acknowledge packets on any interface. Something like that in arv_gv_interface.c:

                any_address = g_inet_address_new_any (G_SOCKET_FAMILY_IPV4);
                any_socket_address = g_inet_socket_address_new (any_address, 0);
		g_socket_bind (discover_socket->socket, any_socket_address, FALSE, &error);
                g_object_unref (any_socket_address);
                g_object_unref (any_address);

                interface_name = arv_network_interface_get_name (iface_iter->data);
                socket_fd = g_socket_get_fd(discover_socket->socket);
                setsockopt (socket_fd, SOL_SOCKET, SO_BINDTODEVICE, interface_name, strlen (interface_name));

Using the same logic in arv_gv_device.c and arv_gv_stream.c, I think it should be possible to control and stream from an incorrectly configured device.

I don’t if this work with Windows though.

Emmanuel.