On Wed, Feb 12, 2014 at 10:10:36AM -0800, Loganaden Velvindron wrote:
> Hi All,
> 
> based on a similar change from FreeBSD:
> 
> Change the return error from EACCES to EPERM as it is not a file.

According to errno(2) EACCES is for file access permissions, so
EPERM seems more apporiate.

A grep for EACCES and EPERM in netinet and netinet6 shows that both
are used often.  Do we want to move towards EPERM for networking?

I think ip6_mrouter_set() and ip6_mrouter_get() should stay in sync,
so please make the diff for both functions.

bluhm

> 
> Index: src/sys/netinet6/ip6_mroute.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet6/ip6_mroute.c,v
> retrieving revision 1.67
> diff -u -p -u -p -r1.67 ip6_mroute.c
> --- src/sys/netinet6/ip6_mroute.c       11 Nov 2013 09:15:35 -0000      1.67
> +++ src/sys/netinet6/ip6_mroute.c       12 Feb 2014 18:04:44 -0000
> @@ -247,7 +247,7 @@ int
>  ip6_mrouter_set(int cmd, struct socket *so, struct mbuf *m)
>  {
>         if (cmd != MRT6_INIT && so != ip6_mrouter)
> -               return (EACCES);
> +               return (EPERM);
>  
>         switch (cmd) {
>         case MRT6_INIT:

Reply via email to