Commit 86cdbae6 authored by Jes Sorensen's avatar Jes Sorensen

don't try to delete public ARP entries if already succeeded in deleting a private one - gives such

silly error messages
parent 77f09fe6
......@@ -100,6 +100,7 @@ arp_del(char **args)
struct arpreq req;
struct sockaddr sa;
int flags=0;
int err;
memset((char *) &req, 0, sizeof(req));
......@@ -192,10 +193,12 @@ arp_del(char **args)
strcpy(req.arp_dev,device);
err = -1;
/* Call the kernel. */
if (flags & 2) {
if (opt_v) fprintf(stderr,"arp: SIOCDARP(nopub)\n");
if (ioctl(sockfd, SIOCDARP, &req) < 0) {
if ((err = ioctl(sockfd, SIOCDARP, &req) < 0)) {
if (errno == ENXIO) {
if (flags & 1)
goto nopub;
......@@ -207,7 +210,7 @@ arp_del(char **args)
return(-1);
}
}
if (flags & 1) {
if ((flags & 1) && (err)) {
nopub:
req.arp_flags |= ATF_PUBL;
if (opt_v) fprintf(stderr,"arp: SIOCDARP(pub)\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment