mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 03:29:43 +00:00
net: Early initialize winpcap library
This fixes problem when xemu is started with command-line parameters specifying pcap bridged network backend and NPF interface identifier.
This commit is contained in:
parent
5b04e4f499
commit
a8c73197da
@ -141,6 +141,13 @@ int net_init_pcap(const Netdev *netdev, const char *name, NetClientState *peer,
|
||||
const int promisc = 1;
|
||||
int status;
|
||||
|
||||
#ifdef WIN32
|
||||
if (pcap_load_library()) {
|
||||
error_setg(errp, "failed to load winpcap library");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
pcap_t *p = pcap_open_live(pcap_opts->ifname, 65536, promisc, 1, err);
|
||||
if (p == NULL) {
|
||||
error_setg(errp, "failed to open interface '%s' for capture: %s",
|
||||
|
Loading…
Reference in New Issue
Block a user