On Fri, Jun 30, 2017 at 08:18:15AM +0200, Richard Cochran wrote: > At that time, I added one extra FD into clock->pollfdp[], and the > clock then farms out the information to the ports. I really did not > to do it that way. A better way would have been to add a new per-port > FD into fd.h, something like this:
I meant to say, "I really did not want to do that way." I can't remember whether I even knew about the possibility of using ifinfomsg.ifi_index to bind to a particular interface. At the time, I either overlooked it or I might have rejected this because of lack of portability to kernels before v3.7. In any case, kernel v3.7 is getting pretty old, and so I think we can: 1. remove the rtnl socket from clock.c 2. add one rtnl socket per port. 3. use ifinfomsg on kernel 3.7+ 4. fall back to rtgenmsg on kernel 3.0 - 3.6 (only if needed). Q: What is the behavior of pre 3.7 kernels WRT ifinfomsg.ifi_index? If ifi_index is non-zero, does the kernel return EINVAL, or do you get information from all interfaces? The only drawback is that, when running on earlier kernels, ptp4l will duplicate work, handling all those per-port rtnl messages. But this is acceptable if we can improve the ptp4l code for the future. Thanks, Richard ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel