svn commit: r280759 - head/sys/netinet

Hans Petter Selasky hps at selasky.org
Sun Mar 29 08:12:56 UTC 2015


On 03/28/15 20:16, Gleb Smirnoff wrote:
> +uint16_t
> +ip_newid(void)
> +{
> +
> +	counter_u64_add(V_ip_id, 1);
> +	return (htons((*(uint64_t *)zpcpu_get(V_ip_id)) & 0xffff));
> +}

Technically you would need to enter a critical section here, so that the 
current process doesn't get swapped to a different CPU between the 
counter add and the zpcpu_get.

--HPS


More information about the svn-src-head mailing list