- priority: 5 --> 3
When compiling the mangler using the version of libpcap that comes with Ubuntu Feisty Fawn, I get a compiler error on the call to open_live from libcap because the device name (our code) is const char but the function (their code) accepts it as a non-constant char. The error is essentially "can't cast a const char* to a non-constant".
The problem is on their side - clearly libpcap has no business modifying the parameter; it should be const and must have been in the other version or we would not have been able to compile it on Fedora 6.
However, it is a simple patch to make it so that the mangler compiles on all versions of libpcap. Here's the change I made so that it would compile on my machine:
In NetworkDevice.cpp, in function get_pcap_dev(), line 441, I changed the call to open live to read like this:
pd = pcap_open_live(const_cast<char*>(device_name), 65535, 1, 1000, ebuf);
The const_cast strips the const modifier off the variable so that it can be passed to the function as non-const without causing the compiler error. This is a kludge but I think it's a fairly benign one.