Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2018 13:26:38 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        Eugene Grosbein <eugen@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r340617 - head/sys/netgraph
Message-ID:  <f3ef3476-4086-2477-9397-e0dc8f902e4f@FreeBSD.org>
In-Reply-To: <201811190727.wAJ7RpDN052165@repo.freebsd.org>
References:  <201811190727.wAJ7RpDN052165@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/18/18 11:27 PM, Eugene Grosbein wrote:
> Author: eugen
> Date: Mon Nov 19 07:27:50 2018
> New Revision: 340617
> URL: https://svnweb.freebsd.org/changeset/base/340617
> 
> Log:
>   Unbreak ng_source(4) for 64-bit platforms including amd64.
> 
> Modified:
>   head/sys/netgraph/ng_source.c
> 
> Modified: head/sys/netgraph/ng_source.c
> ==============================================================================
> --- head/sys/netgraph/ng_source.c	Mon Nov 19 06:52:20 2018	(r340616)
> +++ head/sys/netgraph/ng_source.c	Mon Nov 19 07:27:50 2018	(r340617)
> @@ -125,8 +125,13 @@ static int		ng_source_dup_mod(sc_p, struct mbuf *,
>  
>  /* Parse type for timeval */
>  static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = {
> +#ifdef __LP64__
> +	{ "tv_sec",		&ng_parse_int64_type	},
> +	{ "tv_usec",		&ng_parse_int64_type	},
> +#else
>  	{ "tv_sec",		&ng_parse_int32_type	},
>  	{ "tv_usec",		&ng_parse_int32_type	},
> +#endif
>  	{ NULL }

time_t (and thus tv_sec) is 64 bits on all but i386 now.  tv_usec is still a
long, so follows LP64 though.  If this is trying to match an actual struct
timeval then you might want something like this:

#ifdef __i386__
    { "tv_sec",         &ng_parse_int32_type },
#else
    { "tv_sec",         &ng_parse_int64_type },
#endif
#ifdef __LP64__
    { "tv_usec",        &ng_parse_int32_type },
#else
    { "tv_usec",        &ng_parse_int64_type },
#endif

-- 
John Baldwin

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f3ef3476-4086-2477-9397-e0dc8f902e4f>