mcr/libpcap — pull request #22 by PherricOxide (2013-03-20 00:13:58+00:00)
Title: Fix a valgrind warning about jumping on uninitialized value

Valgrind doesn't have a wrapper for the SIOCETHTOOL ioctl call yet. This is causing every program that uses libpcap and valgrind to produce some false warnings because it thinks eval.data was never initialized,

Conditional jump or move depends on uninitialised value(s)
==14028== at 0x5904B37: ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==14028== by 0x5908B77: pcap_activate (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
...

A harmless fix is to just set eval.data to 0 instead of leaving it unitialized before the SIOCETHTOOL ioctl call sets it. Although this isn't strictly needed, it would be greatly appreciated due to the prevalence of projects that run valgrind as part of their validation process, and because of the complicated nature of SIOECTHTOOL valgrind doesn't look like they're going to have a fix for it anytime in the near future (https://bugs.kde.org/show_bug.cgi?id=303536).