[PATCH 3/3] iphlpapi: Implement CancelIPChangeNotify.

Hans Leidekker hans at codeweavers.com
Fri May 10 09:27:51 CDT 2013


On Fri, 2013-05-10 at 08:00 -0600, Erich E. Hoover wrote:
> On Fri, May 10, 2013 at 3:48 AM, Hans Leidekker <hans at codeweavers.com> wrote:
> >
> > On Wed, 2013-05-08 at 15:34 -0600, Erich E. Hoover wrote:
> > > ...
> > > +#ifdef NLMSG_OK
> > > +# define WINE_LINKMON_FAMILY         PF_NETLINK
> > > +# define WINE_LINKMON_TYPE           SOCK_RAW
> > > +# define WINE_LINKMON_PROTO          NETLINK_ROUTE
> > > +# define WINE_LINKMON_ADDRCHANGE(b)  (NLMSG_OK((struct nlmsghdr*)b, len) \
> > > +             && (((struct nlmsghdr*)b)->nlmsg_type == RTM_NEWADDR \
> > > +                 || ((struct nlmsghdr*)b)->nlmsg_type == RTM_DELADDR))
> > > +#endif
> >
> > I don't see the need for these defines. WINE_LINKMON_ADDRCHANGE could be turned
> > into a function.
> >
> 
> For the reason you noted below, on Mac it would make sense to set
> these defines to be PF_SYSTEM, SOCK_RAW, and SYSPROTO_EVENT
> (respectively).  I wasn't sure whether the address change would be
> better as a define or a function so I made it a define to fit with the
> others, but I'd be happy to change it if you think it'd be better as a
> function.  It also seems that on Mac one uses an ioctl() request
> instead of bind() to finish setting up the socket, but I figured that
> having that as another define (or function) would be a little bit much
> for this patch.

I think it would be nicer to push the platform specifics to helper functions
(e.g. setting up the socket or checking for an address change) and use the usual
header defines (HAVE_LINUX_NETLINK_H and/or HAVE_SYS_KERN_EVENT_H) for anything
that needs to be compiled conditionally.





More information about the wine-devel mailing list