int snaplen = default_packet_size;
if (snaplen == 0) {
- snaplen = GetIfaceMaxPacketSize(ptv->iface);
+ snaplen = GetIfaceMaxPacketSize(ptv->livedev);
if (snaplen <= 0) {
SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
snaplen = 1514;
int snaplen = default_packet_size;
if (snaplen == 0) {
- snaplen = GetIfaceMaxPacketSize(ptv->iface);
+ snaplen = GetIfaceMaxPacketSize(ptv->livedev);
if (snaplen <= 0) {
SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
snaplen = 1514;
if (pcapconfig->snaplen == 0) {
/* We set snaplen if we can get the MTU */
- ptv->pcap_snaplen = GetIfaceMaxPacketSize(pcapconfig->iface);
+ ptv->pcap_snaplen = GetIfaceMaxPacketSize(ptv->livedev);
} else {
ptv->pcap_snaplen = pcapconfig->snaplen;
}
dev[len-1] = '\0';
}
}
- unsigned int iface_max_packet_size = GetIfaceMaxPacketSize(dev);
+ LiveDevice *ld = LiveGetDevice(dev);
+ unsigned int iface_max_packet_size = GetIfaceMaxPacketSize(ld);
if (iface_max_packet_size > default_packet_size)
default_packet_size = iface_max_packet_size;
}
* for the link. In case of uncertainty, it will output a
* majorant to be sure avoid the cost of dynamic allocation.
*
- * \param Name of a network interface
+ * \param LiveDevice object
* \retval 0 in case of error
*/
-int GetIfaceMaxPacketSize(const char *dev)
+int GetIfaceMaxPacketSize(LiveDevice *ld)
{
+ if (ld == NULL)
+ return 0;
+
+ const char *dev = ld->dev;
if ((dev == NULL) || strlen(dev) == 0)
return 0;
#include "util-device.h"
int GetIfaceMTU(const char *pcap_dev);
-int GetIfaceMaxPacketSize(const char *pcap_dev);
+int GetIfaceMaxPacketSize(LiveDevice *ld);
int GetIfaceOffloading(const char *dev, int csum, int other);
int GetIfaceRSSQueuesNum(const char *pcap_dev);
#ifdef SIOCGIFFLAGS