tech-net archive

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

Re: route_protosw.pr_input

Le 05/09/2018 à 17:10, Taylor R Campbell a écrit :
Date: Wed, 5 Sep 2018 08:21:12 +0200
From: Maxime Villard <>

In net/rtsock.c, I don't understand where we use the 'pr_input' field of
COMPATNAME(route_protosw)[]. To me it can't be used: .pr_input takes a
variadic function, but if you grep through the tree, you can see that
the variadic .pr_input functions we call always take three arguments, as
opposed to raw_input() which takes five.

Therefore raw_input() is never called via .pr_input, and we can set the
field to NULL. Then we can switch all the .pr_input functions to be static
and not variadic.

This will clear a lot of confusion, and will allow us to find problems
related to types -- like this one.

I have been sitting on a patch (joint effort by me and rtr@, mostly
rtr@, a couple years ago) to kill all the variadics in *_input and put
proto-specific types with no casts on them.  Haven't tried it in a
while but it worked at some point.  There was some objection on
tech-net at the time but I forget the details now.

I was more talking about removing the only user (that doesn't actually use) of
the pr_input field, rather than using a different structure.

Your idea is not wrong, but in the end the field is still unused, so let's set
it to NULL, this eliminates the only obstacle to removing variadic functions

Home | Main Index | Thread Index | Old Index