Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 fix compilation/runtime problem on alpha.



details:   https://anonhg.NetBSD.org/src/rev/99e1bd84a2db
branches:  trunk
changeset: 474563:99e1bd84a2db
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Jul 11 17:45:11 1999 +0000

description:
fix compilation/runtime problem on alpha.

PR: 7952, 7953
From: Dave Huang <khym%bga.com@localhost>

diffstat:

 sys/netinet6/in6_cksum.c |  32 ++++++++++++++++----------------
 sys/netinet6/ipsec.c     |   6 +++---
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (132 lines):

diff -r aa7d3cb3bd6a -r 99e1bd84a2db sys/netinet6/in6_cksum.c
--- a/sys/netinet6/in6_cksum.c  Sun Jul 11 17:44:08 1999 +0000
+++ b/sys/netinet6/in6_cksum.c  Sun Jul 11 17:45:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_cksum.c,v 1.4 1999/07/06 08:55:56 itojun Exp $     */
+/*     $NetBSD: in6_cksum.c,v 1.5 1999/07/11 17:45:11 itojun Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -81,11 +81,11 @@
 #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
 
 static union {
-       u_short phs[4];
+       u_int16_t phs[4];
        struct {
-               u_long  ph_len;
-               u_char  ph_zero[3];
-               u_char  ph_nxt;
+               u_int32_t       ph_len;
+               u_int8_t        ph_zero[3];
+               u_int8_t        ph_nxt;
        } ph;
 } uph;
 
@@ -102,7 +102,7 @@
        u_int8_t nxt;
        register int off, len;
 {
-       register u_short *w;
+       register u_int16_t *w;
        register int sum = 0;
        register int mlen = 0;
        int byte_swapped = 0;
@@ -112,12 +112,12 @@
        struct ip6_hdr *ip6;    
        
        union {
-               char    c[2];
-               u_short s;
+               u_int8_t        c[2];
+               u_int16_t       s;
        } s_util;
        union {
-               u_short s[2];
-               long    l;
+               u_int16_t s[2];
+               u_int32_t l;
        } l_util;
 
        /* sanity check */
@@ -140,7 +140,7 @@
                ip6->ip6_dst.s6_addr16[1] = 0;
        }
 #endif
-       w = (u_short *)&ip6->ip6_src;
+       w = (u_int16_t *)&ip6->ip6_src;
        uph.ph.ph_len = htonl(len);
        uph.ph.ph_nxt = nxt;
 
@@ -176,7 +176,7 @@
                        break;
                m = m->m_next;
        }
-       w = (u_short *)(mtod(m, u_char *) + off);
+       w = (u_int16_t *)(mtod(m, u_char *) + off);
        mlen = m->m_len - off;
        if (len < mlen)
                mlen = len;
@@ -188,7 +188,7 @@
                REDUCE;
                sum <<= 8;
                s_util.c[0] = *(u_char *)w;
-               w = (u_short *)((char *)w + 1);
+               w = (u_int16_t *)((char *)w + 1);
                mlen--;
                byte_swapped = 1;
        }
@@ -237,7 +237,7 @@
        for (;m && len; m = m->m_next) {
                if (m->m_len == 0)
                        continue;
-               w = mtod(m, u_short *);
+               w = mtod(m, u_int16_t *);
                if (mlen == -1) {
                        /*
                         * The first byte of this mbuf is the continuation
@@ -249,7 +249,7 @@
                         */
                        s_util.c[1] = *(char *)w;
                        sum += s_util.s;
-                       w = (u_short *)((char *)w + 1);
+                       w = (u_int16_t *)((char *)w + 1);
                        mlen = m->m_len - 1;
                        len--;
                } else
@@ -264,7 +264,7 @@
                        REDUCE;
                        sum <<= 8;
                        s_util.c[0] = *(u_char *)w;
-                       w = (u_short *)((char *)w + 1);
+                       w = (u_int16_t *)((char *)w + 1);
                        mlen--;
                        byte_swapped = 1;
                }
diff -r aa7d3cb3bd6a -r 99e1bd84a2db sys/netinet6/ipsec.c
--- a/sys/netinet6/ipsec.c      Sun Jul 11 17:44:08 1999 +0000
+++ b/sys/netinet6/ipsec.c      Sun Jul 11 17:45:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.6 1999/07/09 22:57:28 thorpej Exp $        */
+/*     $NetBSD: ipsec.c,v 1.7 1999/07/11 17:45:11 itojun Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1532,7 +1532,7 @@
        KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
                printf("DP ipsec4_hdrsiz call free SP:%p\n", sp));
        KEYDEBUG(KEYDEBUG_IPSEC_DATA,
-               printf("ipsec4_hdrsiz: size:%d.\n", size));
+               printf("ipsec4_hdrsiz: size:%lu.\n", (unsigned long)size));
        key_freesp(sp);
 
        return size;
@@ -1570,7 +1570,7 @@
        KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
                printf("DP ipsec6_hdrsiz call free SP:%p\n", sp));
        KEYDEBUG(KEYDEBUG_IPSEC_DATA,
-               printf("ipsec6_hdrsiz: size:%d.\n", size));
+               printf("ipsec6_hdrsiz: size:%lu.\n", (unsigned long)size));
        key_freesp(sp);
 
        return size;



Home | Main Index | Thread Index | Old Index