Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ipkdb Fix a few (essential!) tyops.



details:   https://anonhg.NetBSD.org/src/rev/7b802ceaa11b
branches:  trunk
changeset: 484041:7b802ceaa11b
user:      ws <ws%NetBSD.org@localhost>
date:      Thu Mar 23 20:33:37 2000 +0000

description:
Fix a few (essential!) tyops.
During initialization, don't buy any non-broadcast packet as being
from our debugger.

diffstat:

 sys/ipkdb/ipkdb_ipkdb.c |  22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diffs (57 lines):

diff -r 8e8ee31b2415 -r 7b802ceaa11b sys/ipkdb/ipkdb_ipkdb.c
--- a/sys/ipkdb/ipkdb_ipkdb.c   Thu Mar 23 19:48:29 2000 +0000
+++ b/sys/ipkdb/ipkdb_ipkdb.c   Thu Mar 23 20:33:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipkdb_ipkdb.c,v 1.9 2000/03/22 20:58:29 ws Exp $       */
+/*     $NetBSD: ipkdb_ipkdb.c,v 1.10 2000/03/23 20:33:37 ws Exp $      */
 
 /*
  * Copyright (C) 1993-2000 Wolfgang Solfrank.
@@ -563,16 +563,8 @@
                                        ifp->hisinetaddr, sizeof ifp->hisinetaddr))
                                /* It's a packet from someone else */
                                break;
-                       if (!(ifp->flags&IPKDB_HISIP)) {
-                               ifp->flags |= IPKDB_HISIP;
-                               ipkdbcopy(&ip->ip_src,
-                                         ifp->hisinetaddr, sizeof ifp->hisinetaddr);
-                       }
-                       if (!(ifp->flags&IPKDB_HISHW)) {
-                               ifp->flags |= IPKDB_HISHW;
-                               ipkdbcopy(eh->ether_shost,
-                                         ifp->hisenetaddr, sizeof ifp->hisenetaddr);
-                       }
+                       if (!(ifp->flags&IPKDB_HISIP))
+                               break;
                        return (char *)(udp + 1);
                default:
                        /* unknown type */
@@ -760,7 +752,7 @@
 /* This is the central step in the MD5 algorithm. */
 #define        ipkdb_MD5STEP(f, w, x, y, z, data, s) \
        ((w) += f(x, y, z) + (data), \
-        (w) = ((w) << (s)) | (((w) >> (32 - 2)) & 0xffffffff), \
+        (w) = ((w) << (s)) | (((w) >> (32 - s)) & 0xffffffff), \
         (w) += (x))
 
 /*
@@ -772,8 +764,8 @@
 ipkdb_MD5Transform(ctx)
        struct ipkdb_MD5Context *ctx;
 {
-       int a, b, c, d, i;
-       int in[16];
+       u_int a, b, c, d, i;
+       u_int in[16];
        
        for (i = 0; i < 16; i++)
                in[i] = getNl(ctx->in + 4 * i);
@@ -889,7 +881,7 @@
        /* Update bitcount */
        t = ctx->bits[0];
        if ((ctx->bits[0] = (t + (len << 3)) & 0xffffffff) < t)
-               ctx->bits[1]++; /* Carry form low to high */
+               ctx->bits[1]++; /* Carry from low to high */
        ctx->bits[1] += (len >> 29) & 0xffffffff;
        
        t = (t >> 3) & 0x3f;    /* Bytes already in ctx->in */



Home | Main Index | Thread Index | Old Index