On Sun, Apr 23, 2023 at 11:33:57PM +0000, Klemens Nanni wrote:
> > > I can't think of a scenario where returning EPERM (this diff) instead of
> > > whatever errno the currently earlier sanity checks yield would break.

It would surprise me if some userland would rely on the error code
when the ioctl is called unpriviledged.  The only way to find out,
is to commit this diff.

> @@ -199,9 +199,8 @@ in_sa2sin(struct sockaddr *sa, struct so
>  int
>  in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
>  {
> -     int privileged;
> +     int privileged = 0;
>  
> -     privileged = 0;
>       if ((so->so_state & SS_PRIV) != 0)
>               privileged++;
>  

This is just style change.  I don't know which style is better.
Please do not change it.

> @@ -196,9 +196,8 @@ in6_sa2sin6(struct sockaddr *sa, struct 
>  int
>  in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
>  {
> -     int privileged;
> +     int privileged = 0;
>  
> -     privileged = 0;
>       if ((so->so_state & SS_PRIV) != 0)
>               privileged++;
>  

You do not even touch this function.  Such changes make digging
history harder.

otherwise OK bluhm@

Reply via email to