net_device.uc_promisc 字段的用途是什么?
为什么struct net_device
有一个字段uc_promisc
?这个字段怎么用呢?
谢谢大家!
why struct net_device
has a field uc_promisc
? How this field is used?
Thank you all!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当不支持单播过滤的设备必须侦听多个单播地址时,根据
dev->uc_count
和dev->uc_promisc
,它会进入混杂模式。代码>.检查__dev_set_rx_mode()
函数。许多设备实现
ndo_set_rx_mode()
,并通过ndo_set_rx_mode()
设置其单播(和多播)过滤器。对于未实现该功能的设备,Linux 将设备设置为混杂模式,并使用dev->uc_promisc
跟踪该事实。因此,混杂模式有几个标志:
dev->flags & IFF_PROMISC
表示设备处于混杂模式。dev->gflags & IFF_PROMISC
表示用户已请求混杂模式。dev->uc_promisc
表示混杂模式已启用(实际上,其引用计数已增加),因为需要在未实现ndo_set_rx_mode 的设备中监听其他单播地址()
。When a device that doesn't support unicast filtering has to listen to several unicast addresses, it is put on promiscous mode, according to
dev->uc_count
anddev->uc_promisc
. Check the__dev_set_rx_mode()
function.Many devices implement
ndo_set_rx_mode()
, and set their unicast (and multicast) filters viando_set_rx_mode()
. For devices that don't implement that, Linux sets the device to promiscuous mode, and keeps track of that fact withdev->uc_promisc
.So there are several flags for promiscuous mode:
dev->flags & IFF_PROMISC
means the device is in promiscuous mode.dev->gflags & IFF_PROMISC
means the user has requested promiscuous mode.dev->uc_promisc
means promiscuous mode has been enabled (actually, its reference count has been incremented) due to the need to listen to additional unicast address in a device that doesn't implementndo_set_rx_mode()
.听起来这可能是一种启用(或跟踪启用/禁用状态)混杂模式 在设备上。
It sounds like it could be a way of enabling (or tracking the enabled/disabled status of) promiscuous mode on the device.