> I saw that. I also noticed that multicast won’t work because the SIOCADDMULTI > call does nothing in the hypervisor drivers (so the multicast mac addresses > are never added to the filter tables for the interface concerned). I’m part > way through the code to use the controlq to handle that for virtio-net. I can > probably do the IFF_PROMISC flag at the same time.
So a quick update on this. I think I can do without the SO_BINDTODEVICE as the likelihood is that there is only a single interface involved. At least, I have this working without the SO_BINDTODEVICE now. I suspect if I had more than one interface, I couldn’t determine easily which interface the packet really arrived on though, and possibly would have issues sending to more than 1 interface due to the routing. However it has highlighted how different the net stack is compared to linux. There are a number of other gotchas - for instance, when receiving message from a SOCK_RAW socket, Linux gives you the raw packet as is. The OSv/BSD stack gives you the full packet but the length in the ip header is in native endian and has had the ip header length subtracted. When sending raw frames, the OSv stack overwrites the TTL field (at least for multicast frames) regardless of what you set in the raw header (even with IP_HDRINCL set). I guess we should probably note that the network stack is not 100% compatible with linux on the ABI Compatibility page - just to avoid surprises. One final thing - I wrote the code for virtio-net to handle SIOCADDMULTI and SIOCDELMULTI, but it seems that they may not be needed after all. Maybe qemu/kvm does IGMP snooping or something as I receive the multicast frames in OSv without my changes (wasted effort!). Is there any interest in the patch just for completeness? Cheers, Rick -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.