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 1:35 PM, Masao Uebayashi <uebayasi%gmail.com@localhost> wrote:
> Looks good to me.

Thanks!

>
> But you should test before commit. :)

Of course :) ...actually I needed to tweak if.h
to make build.sh release work (because of missing
callout_t).

So yet another question; an easy way to fix the
problem is to introduce #ifdef _KERNEL in
struct ifnet like the below patch. Is it acceptable?
Or should I make if_watchdog_ch a pointer instead?

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


Home | Main Index | Thread Index | Old Index