svn commit: r340617 - head/sys/netgraph

John Baldwin jhb at FreeBSD.org
Mon Nov 26 21:26:43 UTC 2018


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

                                                                            


More information about the svn-src-all mailing list