The Samba-Bugzilla – Attachment 11837 Details for
Bug 11734
speed var is not re-initialized for each interface in get_interfaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for v4-4-test, cherry-picked from master
bug-11734.v4-4-test.patch (text/plain), 1.81 KB, created by
Michael Adam
on 2016-02-15 09:33:41 UTC
(
hide
)
Description:
patch for v4-4-test, cherry-picked from master
Filename:
MIME Type:
Creator:
Michael Adam
Created:
2016-02-15 09:33:41 UTC
Size:
1.81 KB
patch
obsolete
>From 2a658ed73bcd67eaada2752d3def0b805db7c11e Mon Sep 17 00:00:00 2001 >From: Anoop C S <anoopcs@redhat.com> >Date: Thu, 11 Feb 2016 14:55:55 +0530 >Subject: [PATCH] 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 > >(cherry picked from commit 9fb98e3e056f059e2a5fcdd54a6a0d60ecdb01b7) >--- > lib/socket/interfaces.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c >index 847fa62..2cabf46 100644 >--- a/lib/socket/interfaces.c >+++ b/lib/socket/interfaces.c >@@ -189,7 +189,6 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) > int count; > int total = 0; > size_t copy_size; >- uint64_t if_speed = 1000 * 1000 * 1000; /* 1GBit */ > > if (getifaddrs(&iflist) < 0) { > return -1; >@@ -214,6 +213,7 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) > > /* Loop through interfaces, looking for given IP address */ > for (ifptr = iflist; ifptr != NULL; ifptr = ifptr->ifa_next) { >+ uint64_t if_speed = 1000 * 1000 * 1000; /* 1Gbps */ > > if (!ifptr->ifa_addr || !ifptr->ifa_netmask) { > continue; >-- >2.5.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
obnox
:
review+
metze
:
review+
Actions:
View
Attachments on
bug 11734
: 11837