Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mrouted u_short cleansing (should be u_int16_t)



details:   https://anonhg.NetBSD.org/src/rev/4450a95b2028
branches:  trunk
changeset: 534657:4450a95b2028
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 01 03:40:34 2002 +0000

description:
u_short cleansing (should be u_int16_t)

diffstat:

 usr.sbin/mrouted/igmp.c |   4 ++--
 usr.sbin/mrouted/inet.c |  10 +++++-----
 usr.sbin/mrouted/snmp.c |   6 +++---
 usr.sbin/mrouted/snmp.h |   4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diffs (84 lines):

diff -r 15a8b03fff9d -r 4450a95b2028 usr.sbin/mrouted/igmp.c
--- a/usr.sbin/mrouted/igmp.c   Thu Aug 01 03:38:01 2002 +0000
+++ b/usr.sbin/mrouted/igmp.c   Thu Aug 01 03:40:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: igmp.c,v 1.7 2002/07/14 16:30:42 wiz Exp $     */
+/*     $NetBSD: igmp.c,v 1.8 2002/08/01 03:40:34 itojun Exp $  */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -316,7 +316,7 @@
     igmp->igmp_code         = code;
     igmp->igmp_group.s_addr = group;
     igmp->igmp_cksum        = 0;
-    igmp->igmp_cksum        = inet_cksum((u_short *)igmp,
+    igmp->igmp_cksum        = inet_cksum((u_int16_t *)igmp,
                                         IGMP_MINLEN + datalen);
 
     if (IN_MULTICAST(ntohl(dst))) {
diff -r 15a8b03fff9d -r 4450a95b2028 usr.sbin/mrouted/inet.c
--- a/usr.sbin/mrouted/inet.c   Thu Aug 01 03:38:01 2002 +0000
+++ b/usr.sbin/mrouted/inet.c   Thu Aug 01 03:40:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet.c,v 1.5 2002/07/14 16:30:42 wiz Exp $     */
+/*     $NetBSD: inet.c,v 1.6 2002/08/01 03:40:34 itojun Exp $  */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -185,12 +185,12 @@
  *
  */
 int
-inet_cksum(u_short *addr, u_int len)
+inet_cksum(u_int16_t *addr, u_int len)
 {
        int nleft = (int)len;
-       u_short *w = addr;
-       u_short answer = 0;
-       int sum = 0;
+       u_int16_t *w = addr;
+       u_int16_t answer = 0;
+       int32_t sum = 0;
 
        /*
         *  Our algorithm is simple, using a 32 bit accumulator (sum),
diff -r 15a8b03fff9d -r 4450a95b2028 usr.sbin/mrouted/snmp.c
--- a/usr.sbin/mrouted/snmp.c   Thu Aug 01 03:38:01 2002 +0000
+++ b/usr.sbin/mrouted/snmp.c   Thu Aug 01 03:40:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: snmp.c,v 1.6 2002/07/14 16:30:42 wiz Exp $     */
+/*     $NetBSD: snmp.c,v 1.7 2002/08/01 03:40:34 itojun Exp $  */
 
 #include "defs.h"
 #include <netinet/in_var.h>
@@ -9,7 +9,7 @@
 #define MROUTED
 #include "snmpd/snmp_vars.h"
 
-    u_short dest_port = 0;
+    in_port_t dest_port = 0;
     int sdlen = 0;
 
 struct addrCache {
@@ -27,7 +27,7 @@
  */
 int /* returns: 0 on success, true on error */
 snmp_init(dest_port)
-    u_short dest_port;
+    in_port_t dest_port;
 {
    u_long myaddr;
    int ret;
diff -r 15a8b03fff9d -r 4450a95b2028 usr.sbin/mrouted/snmp.h
--- a/usr.sbin/mrouted/snmp.h   Thu Aug 01 03:38:01 2002 +0000
+++ b/usr.sbin/mrouted/snmp.h   Thu Aug 01 03:40:34 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: snmp.h,v 1.3 1995/12/10 10:07:18 mycroft Exp $ */
+/*     $NetBSD: snmp.h,v 1.4 2002/08/01 03:40:34 itojun Exp $  */
 
 extern int portlist[32], sdlen;
-extern u_short dest_port;
+extern in_port_t dest_port;
 extern int quantum;
 
 extern int snmp_read_packet();



Home | Main Index | Thread Index | Old Index