rwhod fails on point to point links
salkind%nyu at sri-unix.UUCP
salkind%nyu at sri-unix.UUCP
Wed Mar 7 07:29:24 AEST 1984
From: Lou Salkind <salkind at nyu>
Subject: rwhod fails on point to point links
Index: etc/rwhod/rwhod.c 4.2BSD
Description:
rwhod will not send datagram packets over point to point links.
Fix:
The problem is that the SIOCGIFxxx calls clobber the ifr_name field.
The easy solution is just to have rwhod.c to set this field again.
Add the following strcpy line (around line 366) in rwhod.c:
if (np->n_flags & IFF_POINTOPOINT) {
strcpy(ifreq.ifr_name, ifr->ifr_name);
if (ioctl(s, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
Another reasonable thing to do is to change the kernel so that
ifr_name doesn't get clobbered in the first place (I have done
this). To make this change, you will have to modify net/if.c:ifunit.
Replace the line
unit = *cp - '0', *cp = 0;
with
unit = *cp - '0';
More information about the Comp.unix.wizards
mailing list