summaryrefslogtreecommitdiff
path: root/lib/socket
Commit message (Collapse)AuthorAgeFilesLines
* lib:socket: Fix code spellingAndreas Schneider2023-04-141-1/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* lib/socket: autodetect RSS using ETHTOOL_GRXRINGSStefan Metzmacher2020-05-071-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | This is also used as part of 'ethtool -n rdma14' and 'ethtool -x rdma14'. ;#> ethtool -n rdma14 8 RX rings available rxclass: Cannot get RX class rule count: Operation not supported RX classification rule retrieval failed ;#> ethtool -x rdma14 RX flow hash indirection table for rdma14 with 8 RX ring(s): 0: 0 1 2 3 4 5 6 7 8: 0 1 2 3 4 5 6 7 RSS hash key: Operation not supported RSS hash function: toeplitz: on xor: off crc32: off Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib/socket: let query_iface_speed_from_name() initialize memory passed to ↵Stefan Metzmacher2020-05-071-0/+2
| | | | | | | | | | syscalls I'm not sure if struct initializers would take care of padding, so I use ZERO_STRUCT(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib:socket: If returning early, set ifacesDavid Mulder2018-10-281-1/+2
| | | | | | | | | | | | | | | Prevents a segfault in load_interfaces() when total interfaces == 1. Fixes regression caused by da68a1b2f417ec82ea4ed3e7a4d867cef8ca8f93. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13665 Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Oct 28 00:35:35 CEST 2018 on sn-devel-144
* lib:socket: Return early if we have only one interfaceAndreas Schneider2018-03-201-1/+4
| | | | | | | This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add explicit dependency on samba-debug from libinterfaces and libserverrole.Zentaro Kavanagh2017-01-231-1/+1
| | | | | | | | | | | | | | | | | | | Currently these dependencies are indirect via a SAMBA_SUBSYSTEM which does not propagate private library information. This results in these 2 libraries getting generated with no RPATH information in the ELF header. Additional discussion [1]. [1] - https://lists.samba.org/archive/samba-technical/2017-January/118078.html Signed-off-by: Zentaro Kavanagh <zentaro@google.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jan 23 08:26:43 CET 2017 on sn-devel-144
* libsocket: Make sure ifr.ifr_name is null-terminatedAndreas Schneider2016-12-031-1/+1
| | | | | | | | | | Found by Coverity Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Dec 3 03:40:53 CET 2016 on sn-devel-144
* lib/socket/interfaces: Fix some uninitialied bytes.Günther Deschner2016-03-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind reports the following: ==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s) ==26599== at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so) ==26599== by 0x79D1585: query_iface_speed_from_name (interfaces.c:152) ==26599== by 0x79D1BBA: _get_interfaces (interfaces.c:277) ==26599== by 0x79D1E80: get_interfaces (interfaces.c:368) ==26599== by 0x508A7E3: load_interfaces (interface.c:612) ==26599== by 0x150B30: main (net.c:963) ==26599== Address 0xffefff0d8 is on thread 1's stack ==26599== in frame #1, created by query_iface_speed_from_name (interfaces.c:130) ==26599== ==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s) ==26599== at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so) ==26599== by 0x79D15CC: query_iface_speed_from_name (interfaces.c:164) ==26599== by 0x79D1BBA: _get_interfaces (interfaces.c:277) ==26599== by 0x79D1E80: get_interfaces (interfaces.c:368) ==26599== by 0x508A7E3: load_interfaces (interface.c:612) ==26599== by 0x150B30: main (net.c:963) ==26599== Address 0xffefff0d8 is on thread 1's stack ==26599== in frame #1, created by query_iface_speed_from_name (interfaces.c:130) Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/socket: Fix improper use of default interface speedAnoop C S2016-02-131-1/+1
| | | | | | | | | | | | | | | | | | | _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: fix CID 1350009 - illegal memory accesses (BUFFER_SIZE_WARNING)Michael Adam2016-02-131-0/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11735 Pair-Programmed-With: Guenther Deschner <gd@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* lib:socket: fix CID 1350010 - integer OVERFLOW_BEFORE_WIDENMichael Adam2016-02-041-1/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Feb 4 00:35:11 CET 2016 on sn-devel-144
* lib:socket: detect link speed with ethtool ioctl in get_interfaces (on linux)Anoop C S2016-01-261-0/+49
| | | | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* build: detect support for ethtoolMichael Adam2016-01-261-0/+7
| | | | | | | | Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:socket: set defaults for linkspeed and capability in get_interfaces()Michael Adam2016-01-261-0/+5
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:socket: get interface index from kernelMichael Adam2016-01-261-0/+6
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:socket: add linkspeed, capability and if_index to iface_structMichael Adam2016-01-261-0/+3
| | | | | | | | Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix bug # 9666 - Broken filtering of link-local addresses.Timur Bakeyev2013-02-281-13/+15
| | | | | | | | | | | This patch should address the problem with Link Local addresses on FreeBSD and Linux. Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 28 20:56:57 CET 2013 on sn-devel-104
* Start to add truncate checks on all uses of strlcpy(). Reading lwnJeremy Allison2012-03-291-2/+6
| | | | | | | has it's uses :-). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
* Fix const warnings.Jeremy Allison2011-10-141-3/+3
|
* Fix bug with Samba not recognising an 6to4 IPv6 interface.Matthieu Patou2011-10-141-0/+13
| | | | | | | | | "The 6to4 interface has the flags IFF_POINTTOPOINT interface but no ifa_dstaddr as it's not at the IPv6 level a point to point interface (at least from my understanding), as we don't have a IFF_BROADCAST flag set (I have the impression that this flag is only set on a interface that has also an IPv4 address) the first test is not valid also, which result in a skipped interface."
* lib/socket: Remove outdated commentAndrew Bartlett2011-05-081-11/+0
| | | | The autoconf and waf tests for interfaces logic are in libreplace now.
* lib/socket move interfaces code to the top levelAndrew Bartlett2011-05-083-0/+365