Permalink
Browse files

Added fix for 'ip route get'

  • Loading branch information...
1 parent dbfce28 commit 4c158493417c2168a3635b65b66bbd4d893e5c18 @saleyn committed Jul 12, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/mreceive.c
View
@@ -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) {

0 comments on commit 4c15849

Please sign in to comment.