问题 rtnetlink(Linux)中IFA_LOCAL和IFA_ADDRESS之间有什么区别


我尝试了解IFA_LOCAL和IFA_ADDRESS之间的区别。

这是来自男人:

IFA_ADDRESS  raw protocol address  interface address
IFA_LOCAL  raw protocol address  local address 

我不明白本地地址和接口地址之间的区别。

有人可以解释一下吗?或者在哪里可以找到答案给我建议?

谢谢。


12987
2018-01-13 09:47


起源



答案:


这个评论来自 if_addr.h 应该说清楚;

/*
 * Important comment:
 * IFA_ADDRESS is prefix address, rather than local interface address.
 * It makes no difference for normally configured broadcast interfaces,
 * but for point-to-point IFA_ADDRESS is DESTINATION address,
 * local address is supplied in IFA_LOCAL attribute.
*/

11
2018-01-13 10:00