Added this summary to the BZ:
I realized that the path without:
<parameter name='CTRL_IP_LEARNING' value='dhcp'/>
works but is totally different.
It uses pcap_open_live
So I compared our code in virNWFilterSnoopDHCPOpen with pcap_open_live.
We use different buffer sizes and don't set promisc and timeout.
But the minimal change I found that seems to make it work was:
The size for this was defined as:
/*
* libpcap 1.5 requires a 128kb buffer
* 128 kb is bigger than (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
*/
# define PCAP_BUFFERSIZE (128 * 1024)
This is from [1], does all that from a libpcap experts POV make sense?
Would it be reasonable to drop this call these days or change the size?
Added this summary to the BZ: IP_LEARNING' value='dhcp'/>
I realized that the path without:
<parameter name='CTRL_
works but is totally different.
It uses pcap_open_live
So I compared our code in virNWFilterSnoo pDHCPOpen with pcap_open_live.
We use different buffer sizes and don't set promisc and timeout.
But the minimal change I found that seems to make it work was:
--- a/src/nwfilter/ nwfilter_ dhcpsnoop. c nwfilter_ dhcpsnoop. c pDHCPOpen( const char *ifname, virMacAddr *mac,
+++ b/src/nwfilter/
@@ -1115,7 +1115,6 @@ virNWFilterSnoo
}
if (pcap_set_ snaplen( handle, PCAP_PBUFSIZE) < 0 || buffer_ size(handle, PCAP_BUFFERSIZE) < 0 ||
pcap_ activate( handle) < 0) {
virReportErro r(VIR_ERR_ INTERNAL_ ERROR,
_("setup of pcap handle failed: %s"),
- pcap_set_
The size for this was defined as:
/*
* libpcap 1.5 requires a 128kb buffer
* 128 kb is bigger than (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
*/
# define PCAP_BUFFERSIZE (128 * 1024)
This is from [1], does all that from a libpcap experts POV make sense?
Would it be reasonable to drop this call these days or change the size?
[1]: https:/ /libvirt. org/git/ ?p=libvirt. git;a=commit; h=49b59a151f60b 0a178b023b727ba c30f80bd6000