Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet remove ifdefs to skip htons() on some big-endian...
details: https://anonhg.NetBSD.org/src/rev/316f2d873a18
branches: trunk
changeset: 485011:316f2d873a18
user: chs <chs%NetBSD.org@localhost>
date: Sun Apr 16 20:58:52 2000 +0000
description:
remove ifdefs to skip htons() on some big-endian platforms.
diffstat:
sys/netinet/ip_auth.c | 8 ++++----
sys/netinet/ip_fil.c | 10 ++--------
sys/netinet/ip_nat.c | 12 ++----------
3 files changed, 8 insertions(+), 22 deletions(-)
diffs (136 lines):
diff -r 775348cf4938 -r 316f2d873a18 sys/netinet/ip_auth.c
--- a/sys/netinet/ip_auth.c Sun Apr 16 20:52:29 2000 +0000
+++ b/sys/netinet/ip_auth.c Sun Apr 16 20:58:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_auth.c,v 1.14 2000/03/30 13:24:57 augustss Exp $ */
+/* $NetBSD: ip_auth.c,v 1.15 2000/04/16 20:58:52 chs Exp $ */
/*
* Copyright (C) 1998 by Darren Reed & Guido van Rooij.
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
#if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_auth.c,v 1.14 2000/03/30 13:24:57 augustss Exp $";
+static const char rcsid[] = "$NetBSD: ip_auth.c,v 1.15 2000/04/16 20:58:52 chs Exp $";
#else
static const char rcsid[] = "@(#)Id: ip_auth.c,v 2.1.2.2 2000/01/16 10:12:14 darrenr Exp";
#endif
@@ -238,7 +238,7 @@
fr_auth[i].fra_pass = 0;
fr_auth[i].fra_age = fr_defaultauthage;
bcopy((char *)fin, (char *)&fr_auth[i].fra_info, sizeof(*fin));
-#if !defined(sparc) && !defined(m68k)
+
/*
* No need to copyback here as we want to undo the changes, not keep
* them.
@@ -258,7 +258,7 @@
bo = ip->ip_off;
ip->ip_off = htons(bo);
}
-#endif
+
#if SOLARIS && defined(_KERNEL)
m->b_rptr -= qif->qf_off;
fr_authpkts[i] = *(mblk_t **)fin->fin_mp;
diff -r 775348cf4938 -r 316f2d873a18 sys/netinet/ip_fil.c
--- a/sys/netinet/ip_fil.c Sun Apr 16 20:52:29 2000 +0000
+++ b/sys/netinet/ip_fil.c Sun Apr 16 20:58:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_fil.c,v 1.47 2000/03/30 13:24:57 augustss Exp $ */
+/* $NetBSD: ip_fil.c,v 1.48 2000/04/16 20:58:53 chs Exp $ */
/*
* Copyright (C) 1993-1998 by Darren Reed.
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
#if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.47 2000/03/30 13:24:57 augustss Exp $";
+static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.48 2000/04/16 20:58:53 chs Exp $";
#else
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.4.2.16 2000/01/16 10:12:42 darrenr Exp";
@@ -1035,7 +1035,6 @@
bcopy((char *)oip, (char *)&icmp->icmp_ip, sizeof(*oip));
bcopy((char *)oip + (oip->ip_hl << 2),
(char *)&icmp->icmp_ip + sizeof(*oip), 8); /* 64 bits */
-# ifndef sparc
{
u_short __iplen, __ipoff;
ip_t *ip = &icmp->icmp_ip;
@@ -1045,7 +1044,6 @@
ip->ip_len = htons(__iplen);
ip->ip_off = htons(__ipoff);
}
-# endif
icmp->icmp_cksum = ipf_cksum((u_short *)icmp, sizeof(*icmp) + 8);
return send_ip(m, nip);
}
@@ -1174,13 +1172,11 @@
* If small enough for interface, can just send directly.
*/
if (ip->ip_len <= ifp->if_mtu) {
-# ifndef sparc
# ifndef __NetBSD__
ip->ip_id = htons(ip->ip_id);
# endif
ip->ip_len = htons(ip->ip_len);
ip->ip_off = htons(ip->ip_off);
-# endif
if (!ip->ip_sum)
ip->ip_sum = in_cksum(m, hlen);
# if BSD >= 199306
@@ -1262,9 +1258,7 @@
m->m_pkthdr.len = mhlen + len;
m->m_pkthdr.rcvif = NULL;
# endif
-# ifndef sparc
mhip->ip_off = htons((u_short)mhip->ip_off);
-# endif
mhip->ip_sum = 0;
mhip->ip_sum = in_cksum(m, mhlen);
*mnext = m;
diff -r 775348cf4938 -r 316f2d873a18 sys/netinet/ip_nat.c
--- a/sys/netinet/ip_nat.c Sun Apr 16 20:52:29 2000 +0000
+++ b/sys/netinet/ip_nat.c Sun Apr 16 20:58:52 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_nat.c,v 1.29 2000/03/30 13:25:01 augustss Exp $ */
+/* $NetBSD: ip_nat.c,v 1.30 2000/04/16 20:58:53 chs Exp $ */
/*
* Copyright (C) 1995-1998 by Darren Reed.
@@ -11,7 +11,7 @@
*/
#if !defined(lint)
#if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.29 2000/03/30 13:25:01 augustss Exp $";
+static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.30 2000/04/16 20:58:53 chs Exp $";
#else
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.2.2.12 2000/01/24 12:43:40 darrenr Exp";
@@ -242,11 +242,7 @@
return;
}
#endif
-#ifdef sparc
- sum1 = (~(*sp)) & 0xffff;
-#else
sum1 = (~ntohs(*sp)) & 0xffff;
-#endif
sum1 += ~(n) & 0xffff;
sum1 = (sum1 >> 16) + (sum1 & 0xffff);
/* Again */
@@ -740,11 +736,7 @@
np->in_outip)
in.s_addr = 0;
else
-#ifndef sparc
in.s_addr = ntohl(in.s_addr);
-#else
- ;
-#endif
}
}
Home |
Main Index |
Thread Index |
Old Index