- int fd = open(iface, OPENFLAG_EXEC);
- int call, ping;
- if(fd == -1) {
- fprintf(stderr, "ERROR: Unable to open interface '%s'\n", iface);
- return 1;
- }
+ char *_iface = malloc( sizeof("/Devices/ip/") + strlen(iface) + 1 );
+ strcpy(_iface, "/Devices/ip/");
+ strcat(_iface, iface);
+ free(iface); // TODO: Handle when this is not heap
+ iface = _iface;
+ printf("iface = '%s'\n", iface);
+ }
+
+ fd = open(iface, OPENFLAG_EXEC);
+ if(fd == -1) {
+ fprintf(stderr, "ERROR: Unable to open interface '%s'\n", iface);
+ return 1;
+ }