<font size=2 face="sans-serif">I opened a redhat 7.3 bug when mc_cmds01
testcase was failing. It seems that netstat only allows 10 characters
for the interface.</font><br><a href="https://bugzilla.linux.ibm.com/show_bug.cgi?id=147530"><font size=3 color=blue><b><u>Bug 147530</u></b></font></a><font size=3>- ISST-LTE:pVM:tuliplp3 RHEL 7.3 RC 1 mc_cmds01 testcase failing </font><br><br><br><tt><font size=3>[root@tuliplp3 faillogs]# vi mc_cmds.1476283713.22063<br>Getting ALL enabled interfaces which are configured !<br>Testing ifconfig and netstat<br>: doing ./mc_cmds01.<br>: doing ./mc_cmds01.<br>Test Failed: all-host-group for enP1p112s0f0 not joined<br>print $4}'<br>+ INTERFACE=10.33.22.161<br>+ COUNT=1<br>+ '[' 1 -le 20 ']'<br>+ echo 'Testing ifconfig and netstat'<br>+ ifconfig enP1p112s0f0<br>+ grep -q MULTICAST<br>+ '[' 0 '!=' 0 ']'<br>+ netstat -gn<br>+ grep -q 224.0.0.1<br>+ grep enP1p112s0f0<br>+ '[' 1 = 0 ']'<br>+ end_testcase 'all-host-group for enP1p112s0f0 not joined'<br>+ set -x<br>+ echo ': doing ./mc_cmds01.'<br>+ '[' ON = ON ']'<br>+ do_cleanup<br>+ set -x<br>+ echo ': doing ./mc_cmds01.'<br>+ rm -rf /tmp/mc_cmds_out.1476283713.22063<br>+ '[' 1 = 0 ']'<br>+ echo 'Test Failed: all-host-group for enP1p112s0f0 not joined'<br>+ exit 1</font></tt><br><br><tt><font size=3><b>The developer showed this in the netstat.c program:</b></font></tt><br><tt><font size=3>The problem, I believe is in netstat.c - in igmp_do_one()<br><br> if (igmp6_flag) { /* IPV6 */<br>#if HAVE_AFINET6<br> num = sscanf( line, "%d %15s %64[0-9A-Fa-f]
%d", &idx, device, mcast_addr, &refcnt );<br> ...<br> printf("%-15s %-6d %s\n", device,
refcnt, mcast_addr)<br> } else { /* IPV4 */<br> .... <br> if ((num = sscanf( line, "%d\t%10c",
&idx, device)) < 2) {<br>
OR<br> if ( (num = sscanf( line, "%10c",
device )) < 1 ) {<br> ...<br> printf("%-15s %-6d %s\n", device,
refcnt, mcast_addr );<br>}<br><br>So in the IPv6 case the format width is 15 - so in our instances (tuliplp3/tuliplp4),
the total width of the interface names fit in that and are printed fully.<br><br>However, for the IPv4 case, we see that the format specifier is limited
to only 10 characters. In the case of tuliplp4, the interface names happen
to be exactly 10 characters long (enp128s0f0, for example) and hence are
printed properly.<br><br>But on tuliplp3, the interface names are longer than 10 characters. Hence
it prints only 10 characters (enP1p112 four times instead of enP1p112f0,
enP1p112f1, etc.)<br></font></tt><br><font size=2 face="sans-serif"><b>and also showed that using netstat
is obsolete:</b></font><br><tt><font size=3>This is actually covered in the netstat(8) man page:<br><br>===<br>NOTES<br> This program is obsolete. Replacement for netstat
is ss. Replacement<br> for netstat -r is ip route. Replacement
for netstat -i is ip -s link.<br> Replacement for netstat -g is ip maddr.<br>===<br><br>Have you tested with "ip maddr" instead? For example, in
your script,<br><br> netstat -gn | grep $IFNAME | grep -q 224.0.0.1<br><br>would become:<br><br> ip maddr show dev $IFNAME | grep -q 224.0.0.1<br><br>The extra benefit here is one less subshell and grep command to look for
the target multicast group.</font></tt><br><font size=2 face="sans-serif"><br>Thanks,<br>A.P. Pundt<br>sametime:apundt@us.ibm.com<br>office:512-286-8093<br>office: 45/3A-97<br>IBM-Austin, Texas</font><BR>