summaryrefslogtreecommitdiff
path: root/lib/socket
AgeCommit message (Collapse)AuthorFilesLines
2024-04-23lib/socket: rearrange iface_comp() to use NUMERIC_CMPDouglas Bagnall1-11/+11
We rearrange rather than just replacing the subtraction, because that would call ntohl() more than necessary, and I think the flow is a bit clearer this way. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-16lib-interface: Add extra parameter 'options' to interface definitionVinit Agnihotri1-0/+1
Signed-off-by: Vinit Agnihotri<vagnihotri@ddn.com> Reviewed-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-08lib:socket: Add missing newlines to logging messagesJoseph Sutton1-4/+4
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-04-14lib:socket: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2020-05-07lib/socket: autodetect RSS using ETHTOOL_GRXRINGSStefan Metzmacher1-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>
2020-05-07lib/socket: let query_iface_speed_from_name() initialize memory passed to ↵Stefan Metzmacher1-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>
2018-10-28lib:socket: If returning early, set ifacesDavid Mulder1-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
2018-03-20lib:socket: Return early if we have only one interfaceAndreas Schneider1-1/+4
This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-01-23Add explicit dependency on samba-debug from libinterfaces and libserverrole.Zentaro Kavanagh1-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
2016-12-03libsocket: Make sure ifr.ifr_name is null-terminatedAndreas Schneider1-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
2016-03-12lib/socket/interfaces: Fix some uninitialied bytes.Günther Deschner1-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>
2016-02-13lib/socket: Fix improper use of default interface speedAnoop C S1-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
2016-02-13lib:socket: fix CID 1350009 - illegal memory accesses (BUFFER_SIZE_WARNING)Michael Adam1-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>
2016-02-04lib:socket: fix CID 1350010 - integer OVERFLOW_BEFORE_WIDENMichael Adam1-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
2016-01-26lib:socket: detect link speed with ethtool ioctl in get_interfaces (on linux)Anoop C S1-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>
2016-01-26build: detect support for ethtoolMichael Adam1-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>
2016-01-26lib:socket: set defaults for linkspeed and capability in get_interfaces()Michael Adam1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26lib:socket: get interface index from kernelMichael Adam1-0/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26lib:socket: add linkspeed, capability and if_index to iface_structMichael Adam1-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>
2013-02-28Fix bug # 9666 - Broken filtering of link-local addresses.Timur Bakeyev1-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
2012-03-29Start to add truncate checks on all uses of strlcpy(). Reading lwnJeremy Allison1-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
2011-10-14Fix const warnings.Jeremy Allison1-3/+3
2011-10-14Fix bug with Samba not recognising an 6to4 IPv6 interface.Matthieu Patou1-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."
2011-05-08lib/socket: Remove outdated commentAndrew Bartlett1-11/+0
The autoconf and waf tests for interfaces logic are in libreplace now.
2011-05-08lib/socket move interfaces code to the top levelAndrew Bartlett3-0/+365