Hi, Christoph.
Thanks very much for the suggestion and patch.
Do you use github? Would you be willing to open a pull request on
OpenAoE/vblade?
(I tried replying earlier with my cell phone but failed. Sorry for the
delay.)
--
Ed
On 11/10/2017 12:58 PM, Christoph Biedl wrote:
Hello,
at the moment, vblade handles an unknown or missing interface
to bind to not that well (seen on Linux):
# /usr/sbin/vblade 12 3 ens4 /home/root/vblade.img
| bind funky: No such device
| Can't get hw addr: Bad file descriptor
| pid 1664: e12.3, 131072 sectors O_RDWR
| Can't get mtu: Bad file descriptor
| putpkt aoe id: Bad file descriptor
| read network: Bad file descriptor
Two problems here:
* (linux only) In dial, the getindx result is not checked. The following
bind call however fails for an invalid interface index. But "bind funky"
isn't quite a helpful error message.
* The main routine does not check the dial result.
Patches for both are fairly simple. The freebsd counterpart for the
first one is missing, though. I don't want to fiddle with code I don't
fully understand, and cannot test either.
Output then:
| ens4: No such device
... which I call an improvement.
Christoph
--- a/aoe.c
+++ b/aoe.c
@@ -536,6 +536,8 @@
}
ifname = argv[2];
sfd = dial(ifname, bufcnt);
+ if (sfd < 0)
+ return 1;
getea(sfd, ifname, mac);
printf("pid %ld: e%d.%d, %lld sectors %s\n",
(long) getpid(), shelf, slot, size,
--- a/linux.c
+++ b/linux.c
@@ -47,6 +47,10 @@
return -1;
}
i = getindx(s, eth);
+ if (i < 0) {
+ perror(eth);
+ return -1;
+ }
sa.sll_family = AF_PACKET;
sa.sll_protocol = htons(0x88a2);
sa.sll_ifindex = i;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Aoetools-discuss mailing list
Aoetools-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/aoetools-discuss
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Aoetools-discuss mailing list
Aoetools-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/aoetools-discuss