On Wed, May 02, 2018 at 01:58:06AM +0200, Theo Buehler wrote:
> Similarly to what we did for ifioctl() a few months back, we can factor
> out the handling of reading ioctls into a new function, in_ioctl_get().
> Treat these cases before grabbing the NET_LOCK() in in_ioctl().
> 
> I only moved and copied a few pieces of code around and did not try to
> make any simplifications to keep the idea of the refactoring clearly
> visible.  This results in a bit of code duplication, but it is not too
> bad.
> 
> We can think about further simplifications and introducing a helper
> function or two in a later step.
> 
> Index: sys/netinet/in.c
> ===================================================================
> RCS file: /var/cvs/src/sys/netinet/in.c,v
> retrieving revision 1.150
> diff -u -p -r1.150 in.c
> --- sys/netinet/in.c  30 Apr 2018 19:07:44 -0000      1.150
> +++ sys/netinet/in.c  1 May 2018 23:02:04 -0000
> @@ -84,6 +84,7 @@
>  
>  void in_socktrim(struct sockaddr_in *);
>  
> +int in_ioctl_get(u_long cmd, caddr_t data, struct ifnet *ifp);

Bad habit from LibreSSL work... I will remove the variable names in the
prototype before committing.

Reply via email to