From 081c88af79cba3cf093744f4391d1abb93b3ad79 Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 13 Feb 2018 17:35:32 +0000 Subject: [PATCH] Normalize handle limit timeval in microsecond (usec) case. Makes stuff like limit 1500000 usec work correctly. ok millert@ tb@ --- usr.sbin/hostapd/parse.y | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y index eff199d93a1..3d5254907de 100644 --- a/usr.sbin/hostapd/parse.y +++ b/usr.sbin/hostapd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.53 2017/01/05 13:53:09 krw Exp $ */ +/* $OpenBSD: parse.y,v 1.54 2018/02/13 17:35:32 cheloha Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Reyk Floeter @@ -500,7 +500,8 @@ limit : /* empty */ yyerror("limit out of range: %lld usec", $2); YYERROR; } - frame.f_limit.tv_usec = $2; + frame.f_limit.tv_sec = $2 / 1000000; + frame.f_limit.tv_usec = $2 % 1000000; } ; -- 2.20.1