diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-02-03 23:14:16 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-02-03 23:14:16 +0000 |
commit | e7e4b69b319449fcc2f6f12909bd04e0b86cee2e (patch) | |
tree | 78c094fa09c15f5685f5c731a10b5cb6a1df3fcb | |
parent | 64a7f4c960827c1b029a219fd7f4b3637c387258 (diff) |
Add more debugging info via -d; m4@umn.edu
-rw-r--r-- | usr.sbin/rarpd/rarpd.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index 201c8fa593e..1137f557905 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rarpd.c,v 1.23 1998/08/15 17:25:32 deraadt Exp $ */ +/* $OpenBSD: rarpd.c,v 1.24 1999/02/03 23:14:15 millert Exp $ */ /* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */ /* @@ -28,7 +28,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: rarpd.c,v 1.23 1998/08/15 17:25:32 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rarpd.c,v 1.24 1999/02/03 23:14:15 millert Exp $"; #endif @@ -592,9 +592,17 @@ rarp_process(ii, pkt) ep = (struct ether_header *) pkt; - if (ether_ntohost(ename, (struct ether_addr *)&ep->ether_shost) != 0 || - (hp = gethostbyname(ename)) == 0) + debug("ethernet address=0x%-2.2x:%-2.2x:%-2.2x:%-2.2x:%-2.2x:%-2.2x", + ep->ether_shost[0], ep->ether_shost[1], ep->ether_shost[2], + ep->ether_shost[3], ep->ether_shost[4], ep->ether_shost[5]); + if (ether_ntohost(ename, (struct ether_addr *)&ep->ether_shost) != 0) { + debug("ether_ntohost failed"); return; + } + if ((hp = gethostbyname(ename)) == 0) { + debug("gethostbyname (%s) failed", ename); + return; + } /* Choose correct address from list. */ if (hp->h_addrtype != AF_INET) { @@ -614,6 +622,7 @@ rarp_process(ii, pkt) if (rarp_bootable(htonl(target_ipaddr))) #endif rarp_reply(ii, ep, target_ipaddr, hp); + debug("reply sent"); } /* * Lookup the ethernet address of the interface attached to the BPF |