- 论坛徽章:
- 1
|
本帖最后由 jiufei19 于 2015-05-15 09:13 编辑
回复 2# nswcfd
感谢nswcfd的解答,但是似乎你并没有针对我的问题进行解释。
请看如下说明,该说明是我摘抄自《understanding linux network Internal》一书的相关章节内容 :
527 * Most routing cache entries are bound to the ARP cache entry of the
528 * route's next hop. This means that a routing cache entry requires
529 * either an existing ARP cache entry or a successful ARP lookup for
530 * the same next hop. In particular, the binding is done for output
531 * routes used to route locally generated packets (identified by a
532 * NULL ingress device identifier), and for unicast forwarding routes.
533 * In both cases, ARP is asked to resolve the next hop's L2 address.
534 * Forwarding to broadcast addresses, multicast addresses, and local
535 * host addresses does not require an ARP resolution because the addresses
536 * are resolved using other means.
这段文字很明确说明了为啥可以回收广播和组播路由缓存条目。因此你说没有看出来和arp有什么关系,是不正确的,的确这段代码和arp没有直接关系,但是我之前给出了和arp相关的代码,在那里是和arp有关的,因此最终也是和arp发生了关联,所以才有上面的原文说明
另外,我的问题是并不是不知道组播和广播被优先回收的原因,而是对后面两个&&的条件感到有点困惑,我知道肯定是我对路由的某些机制概念不清造成了这个问题,希望能有人继续解答我的疑问。
|
|