]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1407. [bug] lfsr incorrectly implements the shift register.
authorMark Andrews <marka@isc.org>
Thu, 5 Dec 2002 04:01:54 +0000 (04:01 +0000)
committerMark Andrews <marka@isc.org>
Thu, 5 Dec 2002 04:01:54 +0000 (04:01 +0000)
                        [RT #4617]

CHANGES
lib/isc/lfsr.c

diff --git a/CHANGES b/CHANGES
index 5ea775fe8414c72953ef0a411f8e4d7e1c7ce348..8611739afcc86e132e5f6742305f5981ee771fb8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
-1406.  [bug]           dispatch initialises one of the LSFR's with a incorrect
+1407.  [bug]           lfsr incorrectly implements the shift register.
+                       [RT #4617]
+
+1406.  [bug]           dispatch initialises one of the LFSR's with a incorrect
                        polynomial.  [RT #4617]
 
 1405.  [func]          Use arc4random() if available.
index 358520eec29c6022bad3fa91317a7f32338ae3e5..418f46c1017857cce1ae0d8e67404acec2485413 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lfsr.c,v 1.12 2001/11/27 00:56:12 gson Exp $ */
+/* $Id: lfsr.c,v 1.13 2002/12/05 04:01:54 marka Exp $ */
 
 #include <config.h>
 
@@ -74,7 +74,7 @@ lfsr_generate(isc_lfsr_t *lfsr)
        }
 
        if (lfsr->state & 0x01) {
-               lfsr->state = ((lfsr->state ^ lfsr->tap) >> 1) | highbit;
+               lfsr->state = (lfsr->state >> 1) ^ lfsr->tap;
                return (1);
        } else {
                lfsr->state >>= 1;