Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added fix for 'ip route get'

  • Loading branch information...
commit 4c158493417c2168a3635b65b66bbd4d893e5c18 1 parent dbfce28
@saleyn authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/mreceive.c
View
8 src/mreceive.c
@@ -587,9 +587,11 @@ void main(int argc, char *argv[])
fclose(file);
if (verbose > 2)
printf("Executed: '%s' ->\n %s\n", buf, obuf);
- if (sscanf(obuf, "multicast %16s via %16s dev %16s src %16s ",
- mc, via, addrs[i].iface_name, src) != 4) {
- fprintf(stderr, "Couldn't parse output of 'ip route get'\n");
+ if ((sscanf(obuf, "multicast %16s via %16s dev %16s src %16s ",
+ mc, via, addrs[i].iface_name, src) != 4) &&
+ (sscanf(obuf, "multicast %16s dev %16s src %16s ",
+ mc, addrs[i].iface_name, src) != 4)) {
+ fprintf(stderr, "Couldn't parse output of 'ip route get: %s'\n", obuf);
exit(2);
}
if (inet_aton(src, (struct in_addr*)&addrs[i].iface) == 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.