ValveSoftware / voglperf

Benchmarking tool for Linux OpenGL games. Spews frame information, logs frametimes.
Other
201 stars 31 forks source link

Fix crash on systems with tuntap interfaces #11

Closed gotschelm closed 10 years ago

gotschelm commented 10 years ago

In voglutils.cpp: getifaddrs() returns a linked list of network interfaces of type 'struct ifAddrStruct'. This may include tuntap interfaces of which the ifa->addr is NULL To replicate this behaviour one can add a tuntap interface like this: $ sudo ip tuntap add tun99 mode tun To remove the previously created tuntap interface: $ sudo ip tuntap del tun99 mode tun These tuntap devices may be created by VPN software such as OpenVPN.

To work around this, we simply check whether ifa->addr is not NULL before proceeding.