summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-16 14:24:09 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-16 14:24:09 +0000
commitd0542c6c431178732a6b75b26b0d5dd7d34f6c0d (patch)
tree21a225c9be186dfb6a3b423a44e9e12f9eeda70c
parent6a126b30ca471d0d0cae796751519bdf6632cda9 (diff)
back up last change, it's wrong.
-rw-r--r--sys/lib/libsa/net.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/sys/lib/libsa/net.c b/sys/lib/libsa/net.c
index 5914e93dc3e..9626c47afef 100644
--- a/sys/lib/libsa/net.c
+++ b/sys/lib/libsa/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.5 1996/10/16 11:04:38 mickey Exp $ */
+/* $OpenBSD: net.c,v 1.6 1996/10/16 14:24:08 mickey Exp $ */
/* $NetBSD: net.c,v 1.12 1995/12/13 23:38:10 pk Exp $ */
/*
@@ -57,12 +57,6 @@
#include "stand.h"
#include "net.h"
-#if defined(ARP_DEBUG) || defined(NET_DEBUG) || defined(BOOTP_DEBUG) || \
- defined(ETHER_DEBUG) || defined(NETIF_DEBUG) || defined(NFS_DEBUG) || \
- defined(RPC_DEBUG)
-int net_debug = 0;
-#endif
-
/* Caller must leave room for ethernet, ip and udp headers in front!! */
ssize_t
sendudp(d, pkt, len)
@@ -78,7 +72,7 @@ sendudp(d, pkt, len)
struct ip tip;
#ifdef NET_DEBUG
- if (net_debug) {
+ if (debug) {
printf("sendudp: d=%x called.\n", (u_int)d);
if (d) {
printf("saddr: %s:%d",
@@ -150,7 +144,7 @@ readudp(d, pkt, len, tleft)
u_int16_t etype; /* host order */
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: called\n");
#endif
@@ -175,7 +169,7 @@ readudp(d, pkt, len, tleft)
if (etype != ETHERTYPE_IP) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: not IP. ether_type=%x\n", etype);
#endif
return -1;
@@ -185,7 +179,7 @@ readudp(d, pkt, len, tleft)
if (ip->ip_v != IPVERSION ||
ip->ip_p != IPPROTO_UDP) { /* half char */
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: IP version or not UDP. ip_v=%d ip_p=%d\n", ip->ip_v, ip->ip_p);
#endif
return -1;
@@ -195,7 +189,7 @@ readudp(d, pkt, len, tleft)
if (hlen < sizeof(*ip) ||
in_cksum(ip, hlen) != 0) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: short hdr or bad cksum.\n");
#endif
return -1;
@@ -203,14 +197,14 @@ readudp(d, pkt, len, tleft)
NTOHS(ip->ip_len);
if (n < ip->ip_len) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: bad length %d < %d.\n", n, ip->ip_len);
#endif
return -1;
}
if (d->myip.s_addr && ip->ip_dst.s_addr != d->myip.s_addr) {
#ifdef NET_DEBUG
- if (net_debug) {
+ if (debug) {
printf("readudp: bad saddr %s != ", inet_ntoa(d->myip));
printf("%s\n", inet_ntoa(ip->ip_dst));
}
@@ -226,7 +220,7 @@ readudp(d, pkt, len, tleft)
}
if (uh->uh_dport != d->myport) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: bad dport %d != %d\n",
d->myport, ntohs(uh->uh_dport));
#endif
@@ -247,7 +241,7 @@ readudp(d, pkt, len, tleft)
ui->ui_len = uh->uh_ulen;
if (in_cksum(ui, n) != 0) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: bad cksum\n");
#endif
*ip = tip;
@@ -260,7 +254,7 @@ readudp(d, pkt, len, tleft)
NTOHS(uh->uh_ulen);
if (uh->uh_ulen < sizeof(*uh)) {
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("readudp: bad udp len %d < %d\n",
uh->uh_ulen, sizeof(*uh));
#endif
@@ -296,7 +290,7 @@ sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
long tleft;
#ifdef NET_DEBUG
- if (net_debug)
+ if (debug)
printf("sendrecv: called\n");
#endif