r23779: Change from v2 or later to v3 or later.
[gd/samba/.git] / source3 / libsmb / namequery.c
index 0826bc52181debb327244406bb71bd5b1497b001..a0aad79c64b210df0ce68b8d40a543d9702bc45c 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -145,15 +145,11 @@ char *saf_fetch( const char *domain )
 
 static int generate_trn_id(void)
 {
-       static int trn_id;
+       uint16 id;
 
-       if (trn_id == 0) {
-               sys_srandom(sys_getpid());
-       }
-
-       trn_id = sys_random();
+       generate_random_buffer((uint8 *)&id, sizeof(id));
 
-       return trn_id % (unsigned)0x7FFF;
+       return id % (unsigned)0x7FFF;
 }
 
 /****************************************************************************