tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch make struct protosw pr_input non-variadic



   Date: Wed, 11 Jan 2017 12:55:26 -0800
   From: Matt Thomas <matt%3am-software.com@localhost>

   Why not replace void (*pr_input)(struct mbuf *, ...); in protosw
   with a union?  The first member of the union can be that and then
   include the (mbuf *, int, int) as a secondary member.  

We did that for struct encapsw.  It doesn't provide the same type
checking, however.  It would fail to detect the specific mistake that
I saw Nakahara-san make during the encap work, of initializing one
union member and then using another.

The change that rtr and I proposed would detect exactly that by
causing inet6sw, by which the various xyz6_input routines are called,
to have a different structure type altogether.


Home | Main Index | Thread Index | Old Index