[ovs-dev] [PATCH 2/3] rtbsd: support RTM_IFANNOUNCE messages

Ben Pfaff blp at nicira.com
Tue Jul 28 17:52:34 UTC 2015


On Tue, Jul 28, 2015 at 02:43:52PM -0300, Thadeu Lima de Souza Cascardo wrote:
> On Tue, Jul 28, 2015 at 10:22:47AM -0700, Ben Pfaff wrote:
> > On Tue, Jul 28, 2015 at 09:48:56AM -0300, Thadeu Lima de Souza Cascardo wrote:
> > > On Mon, Jul 27, 2015 at 03:46:28PM -0700, Ben Pfaff wrote:
> > > > On Mon, Jul 27, 2015 at 02:24:19PM -0300, Thadeu Lima de Souza Cascardo wrote:
> > > > > When devices are created, they are announced using RTM_IFANNOUNCE messages using
> > > > > PF_ROUTE.
> > > > > 
> > > > > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
> > > > 
> > > > Do you know anyone who might be qualified to properly review this?  It
> > > > seems reasonable but I don't know this part of BSD at all.
> > > 
> > > Maybe one of the guys who contributed some of the specific BSD code:
> > > 
> > > Ed Maste <emaste at freebsd.org> contributed lib/route-table-bsd.c, and
> > > Giuseppe Lettieri <g.lettieri at iet.unipi.it> contributed lib/rtbsd.c.
> > > 
> > > I am cc'ing them on this message, and bouncing the patch to them as well.
> > > 
> > > What about the style? Is it OK to read using struct if_msghdr, then cast to
> > > struct if_announcemsghdr? From my tests, this works fine, the RAW socket seems
> > > to work like a DGRAM socket in this particular case.
> > 
> > Doesn't the compiler complain about that without a cast?
> 
> Good point. I thought there was a cast already there. Fixed. I was pointing out
> to the assumption that one message is larger than the other. I don't think this
> is a problem in this particular case. if_msghdr has a struct at the end, which
> stores a lot of stats, and all the other earlier members of both if_msghdr and
> if_announcemsghdr are of types that don't have different sizes on different
> supported architectures, AFAIK. I know almost nothing about *BSD.

This is a kind of undefined behavior that one can normally get away
with.

Let's give Ed and Giuseppe a day or two to take a look, and if we don't
hear back from them then I'll consider this good enough.



More information about the dev mailing list