Well I was able to somewhat figure this out. It looks like OP was completely on the right track - the code in that section looks correct, but in any *BSD/Linux/etc. system it's getting tripped up because the interface name is not a pure number. As a result, the atoi() function returns 0 consistently, instead of some value which differentiates the interfaces.
I made a custom patch to the package in order to output something unique. This probably isn't safe (I blindly assume we have strsep() without a macro for one), so I'm not going to send it upstream, but it worked out for me. It instead uses the individual characters of the interface name to generate a unique ~5-digit integer which can be used easily for filtering. To find out an interface's numerical representation, I just run softflowd -i <name> with no other args, which prints the info and crashes.
Hope this helps someone!
--- softflowd.c.orig 2017-04-25 22:26:07.000000000 +0000
+++ softflowd.c 2017-08-03 07:31:41.194232000 +0000
@@ -1781,17 +1781,12 @@
usage();
exit(1);
}
-#if defined(HAVE_STRSEP)
dev = strsep(&optarg, ":");
-#else /* defined(HAVE_STRSEP) */
- dev = strtok(optarg, ":");
-#endif /* defined(HAVE_STRSEP) */
- if (optarg != NULL) {
- if_index = (u_int16_t) atoi(dev);
- dev = optarg;
+ int len = strlen(dev);
+ for(i=0; i<len; i++){<br="">+ if_index = if_index * 10 + ( dev[i] - '0' );
}
- if (verbose_flag)
- fprintf(stderr, "Using %s (idx: %d)\n", dev, if_index);
+ fprintf(stderr, "Using %s (idx: %d)\n", dev, if_index);
break;
case 'r':
if (capfile != NULL || dev != NULL) {
[/i]</len;>
```</name>