mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
+2
-2
@@ -269,10 +269,10 @@ void db_init(void)
|
||||
dbversion = db_get_FTL_property(DB_VERSION);
|
||||
}
|
||||
|
||||
//Update to version 4 if lower
|
||||
// Update to version 4 if lower
|
||||
if(dbversion < 4)
|
||||
{
|
||||
// Update to version 3: Create network table
|
||||
// Update to version 4: Unify clients in network table
|
||||
logg("Updating long-term database to version 4");
|
||||
unify_hwaddr(db);
|
||||
// Get updated version
|
||||
|
||||
+2
-2
@@ -88,7 +88,7 @@ void parse_arp_cache(void)
|
||||
continue;
|
||||
|
||||
// Get ID of this device in our network database. If it cannot be
|
||||
// found, then this is a new device We only use the hardware address
|
||||
// found, then this is a new device. We only use the hardware address
|
||||
// to uniquely identify clients and only use the first returned ID.
|
||||
//
|
||||
// Same MAC, two IPs: Non-deterministic (sequential) DHCP server, we
|
||||
@@ -283,7 +283,7 @@ bool unify_hwaddr(sqlite3 *db)
|
||||
// See https://www.sqlite.org/lang_createtable.html#constraints:
|
||||
// >>> In most cases, UNIQUE and PRIMARY KEY constraints are
|
||||
// >>> implemented by creating a unique index in the database.
|
||||
dbquery("CREATE UNIQUE INDEX hwaddr_idx ON network(hwaddr)");
|
||||
dbquery("CREATE UNIQUE INDEX network_hwaddr_idx ON network(hwaddr)");
|
||||
|
||||
// Update database version to 4
|
||||
if(!db_set_FTL_property(DB_VERSION, 4))
|
||||
|
||||
Reference in New Issue
Block a user