Normalize handle limit timeval in microsecond (usec) case.
authorcheloha <cheloha@openbsd.org>
Tue, 13 Feb 2018 17:35:32 +0000 (17:35 +0000)
committercheloha <cheloha@openbsd.org>
Tue, 13 Feb 2018 17:35:32 +0000 (17:35 +0000)
Makes stuff like

limit 1500000 usec

work correctly.

ok millert@ tb@

usr.sbin/hostapd/parse.y

index eff199d..3d52549 100644 (file)
@@ -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 <reyk@openbsd.org>
@@ -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;
                }
                ;