lib/socket: Fix improper use of default interface speed
commit9fb98e3e056f059e2a5fcdd54a6a0d60ecdb01b7
authorAnoop C S <anoopcs@redhat.com>
Thu, 11 Feb 2016 09:25:55 +0000 (11 14:55 +0530)
committerMichael Adam <obnox@samba.org>
Sat, 13 Feb 2016 15:22:22 +0000 (13 16:22 +0100)
treefdf81f757f3227775b87f0899d3b2537e9def831
parent8b36428b195f6e1d1063f1abccb718f2665d271f
lib/socket: Fix improper use of default interface speed

_get_interfaces() function from interfaces.c uses if_speed
variable to store interface speed and is initialized with a
default value at start. But if_speed populated via one
iteration for a specific IP address will be treated as the
default value for next iteration which is wrong. Therefore
change is to move the initialization cum declaration of
if_speed inside iteration of IP addresses loop.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11734

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Feb 13 16:22:22 CET 2016 on sn-devel-144
lib/socket/interfaces.c