tech-net archive

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

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]



On Thu, Nov 20, 2014 at 6:16 PM, Ryota Ozaki <ozaki-r%netbsd.org@localhost> wrote:
> BTW, moving #include <sys/callout.h> out of #ifdef _KERNEL
> doesn't work because struct callout of callout.h conflicts
> with that of external/bsd/am-utils. (Fixing this conflict
> is an option though...)
>
> Thanks,
>   ozaki-r
>
> diff --git a/sys/net/if.h b/sys/net/if.h
> index f6d2d23..2b2a2ae 100644
> --- a/sys/net/if.h
> +++ b/sys/net/if.h
> @@ -342,7 +342,9 @@ typedef struct ifnet {
>             const struct sockaddr *);
>         int (*if_setflags)(struct ifnet *, const short);
>         struct ifnet_lock *if_ioctl_lock;
> +#ifdef _KERNEL
>         callout_t if_watchdog_ch;
> +#endif
>  } ifnet_t;
>
>  #define        if_mtu          if_data.ifi_mtu

I don't think userland really needs to look into callout_t.  But also
I'm not sure the influence of changing struct size for kvm(3) users.
How about this:

#ifdef _KERNEL
        callout_t if_watchdog_ch;
#else
        void *if_watchdog_ch[10]; /* sys/callout.h */
#endif


Home | Main Index | Thread Index | Old Index