Created
October 8, 2020 15:29
-
-
Save dminuoso/0932484d82167ffad98baaf3348f5126 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/freyja-server/src/Freyja/InetService/Db.hs b/freyja-server/src/Freyja/InetService/Db.hs | |
index d1cb278..2dfc523 100644 | |
--- a/freyja-server/src/Freyja/InetService/Db.hs | |
+++ b/freyja-server/src/Freyja/InetService/Db.hs | |
@@ -495,17 +495,15 @@ searchSessionV4 q = do | |
, limit | |
, offset) | |
where | |
- limit = sqPage q | |
+ limit = sqPer q | |
offset = sqPer q * sqPage q | |
- macFrom_ = fromMaybe (Mac.fromOctets 0x00 0x00 0x00 0x00 0x00 0x00) (sqMacFrom q) | |
- macTo_ = fromMaybe (Mac.fromOctets 0xff 0xff 0xff 0xff 0xff 0xff) (sqMacFrom q) | |
+ macFrom_ = fromMaybe [mac| 00:00:00:00:00:00 |] (sqMacFrom q) | |
+ macTo_ = fromMaybe [mac| ff:ff:ff:ff:ff:ff |] (sqMacFrom q) | |
bng_ = fromMaybe "%" (sqPatBng q) | |
cid_ = fromMaybe "%" (sqPatCircuitId q) | |
qry = [sql| SELECT * | |
FROM v4_sessions | |
- WHERE accountName = (?) | |
- ORDER BY started DESC | |
WHERE ( circuitId LIKE ? | |
AND macAddress >= ? | |
AND macAddress <= ? | |
diff --git a/freyja-server/test/InetSpec.hs b/freyja-server/test/InetSpec.hs | |
index 41cd49a..c30ef53 100644 | |
--- a/freyja-server/test/InetSpec.hs | |
+++ b/freyja-server/test/InetSpec.hs | |
@@ -450,9 +450,8 @@ histAggrSpec ce = do | |
expected = SesHistAggr { shaSessionsPerDay = [ SessionCounter (adjustedDay 1) 2 | |
, SessionCounter (adjustedDay 2) 1 | |
, SessionCounter (adjustedDay 3) 0 | |
- , SessionCounter (adjustedDay 4) 3 | |
- ] | |
- , shaDistinctMacAddrs = [ Mac.fromOctets 0x11 0x12 0x13 0x14 0x15 0x16 ] | |
+ , SessionCounter (adjustedDay 4) 3 ] | |
+ , shaDistinctMacAddrs = [ [mac| 11:12:13:14:15:16 |] ] | |
, shaDistinctCircuitIds = ["TAKN0123:s01:p01"] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment