int
get_if_flags(const char *name, bpf_u_int32 *flags, char *errbuf)
{
+ char *name_copy;
ADAPTER *adapter;
int status;
size_t len;
/*
* We need to open the adapter to get this information.
+ *
+ * XXX - PacketOpenAdapter() takes a non-const pointer
+ * as an argument, so we make a copy of the argument and
+ * pass that to it.
*/
- adapter = PacketOpenAdapter(name);
+ name_copy = strdup(name);
+ adapter = PacketOpenAdapter(name_copy);
+ free(name_copy);
if (adapter == NULL) {
/*
* Give up; if they try to open this device, it'll fail.