Deleted Added
sdiff udiff text old ( 13573 ) new ( 13577 )
full compact
1/*
2 * hwaddr.c - routines that deal with hardware addresses.
3 * (i.e. Ethernet)
4 */
5
6#include <sys/types.h>
7#include <sys/param.h>
8#include <sys/socket.h>

--- 34 unchanged lines hidden (view full) ---

43#define bzero(p,l) memset(p,0,l)
44#define bcmp(a,b,c) memcmp(a,b,c)
45#endif
46
47#ifndef ATF_INUSE /* Not defined on some systems (i.e. Linux) */
48#define ATF_INUSE 0
49#endif
50
51#include "bptypes.h"
52#include "hwaddr.h"
53#include "report.h"
54
55extern int debug;
56
57/*
58 * Hardware address lengths (in bytes) and network name based on hardware

--- 111 unchanged lines hidden (view full) ---

170 * to add is already in the cache. (Sigh...)
171 * XXX - Should this error simply be ignored? -gwr
172 */
173 if (ioctl(s, SIOCSARP, (caddr_t) &arpreq) < 0) {
174 report(LOG_ERR, "ioctl SIOCSARP: %s", get_errmsg());
175 }
176#endif /* SVR4 */
177#else /* SIOCSARP */
178 /*
179 * Oh well, SIOCSARP is not defined. Just run arp(8).
180 * Need to delete partial entry first on some systems.
181 * XXX - Gag!
182 */
183 int status;
184 char buf[256];
185 char *a;
186 extern char *inet_ntoa();
187
188 a = inet_ntoa(*ia);
189 sprintf(buf, "arp -d %s; arp -s %s %s temp",
190 a, a, haddrtoa(haddr, halen));
191 if (debug > 2)
192 report(LOG_INFO, buf);
193 status = system(buf);
194 if (status)
195 report(LOG_ERR, "arp failed, exit code=0x%x", status);
196 return;
197#endif /* SIOCSARP */
198}
199
200
201/*
202 * Convert a hardware address to an ASCII string.
203 */
204char *

--- 135 unchanged lines hidden ---