summaryrefslogtreecommitdiffstats
path: root/src/monitor/monitor_netlink.c
Commit message (Collapse)AuthorAgeFilesLines
* Use pattern #elif defined(identifier)Lukas Slebodnik2014-03-141-2/+2
| | | | | | | | | | | | | | We had in source code following pattern #elif HAVE_<name> It worked because undefined identifier(in some cases) was evaluated to 0. But we do not care about value of HAVE_SOMETHING. We just need to know whether identifier was defined. There is not equivalent to #ifdef (short for of #if definded) We need to use long form: #elif defined HAVE_<name> It causes also compiler warning with enabled compiler flag -Wundef. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* Update DEBUG* invocations to use new levelsNikolai Kondrashov2014-02-121-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-02-121-57/+57
| | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code: grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Convert IN_MULTICAST parameter to host orderJakub Hrozek2013-09-241-1/+1
| | | | | | | https://fedorahosted.org/sssd/ticket/2087 IN_MULTICAST accepts address in the host order, but network order was supplied.
* Fix formating of variables with type: uid_tLukas Slebodnik2013-09-111-2/+3
|
* Provide libnl3 supportOndrej Kos2013-03-271-50/+100
| | | | | | | | | | | | | | | | https://fedorahosted.org/sssd/ticket/812 Update the monitor code to be using the new libnl3 API. Changed configure option --with-libnl By default, it tries to build with libnl3, if not found, then with libnl1, if this isn't found either, build proceeds without libnl, just with warning. Specifing --with-libnl=<libnl3|libnl1|no> checks for the specific given version, if not found, configure ends with error.
* Convert read and write operations to sss_atomic_readJakub Hrozek2012-04-201-11/+9
| | | | https://fedorahosted.org/sssd/ticket/1209
* netlink integration: ensure that interface name is NULL-terminatedJakub Hrozek2012-04-091-1/+2
| | | | | | In the unlikely case that the interface name was IFNAMSIZ bytes long or longer, strncpy wouldn't NULL-terminate the buffer. Copy one byte less to ensure the buffer is NULL-terminated.
* libnl: fix the path to phy80211 subdirectoryJakub Hrozek2012-02-231-4/+20
|
* Fix wrong buffer size in has_phy_80211_subdir()Jakub Hrozek2011-09-201-2/+3
| | | | https://fedorahosted.org/sssd/ticket/1002
* Subscribe to netlink route and addr messagesJakub Hrozek2011-09-061-5/+244
| | | | | | | | https://fedorahosted.org/sssd/ticket/955 In addition to carrier up messages, also subscribe to any messages describing that an address has been added or removed or routing table changed.
* Discard carrier messages from non-ethernet devicesJakub Hrozek2011-09-061-3/+155
| | | | | | | | | IFF_LOWER_UP has no meaning for wireless interfaces, it can mean that an association has been made with an access point, but it does not mean that an addressing has been completed. This patch discards "carrier up" messages from interfaces that do not look like ethernet devices.
* Change libnl monitor callback to only signal going onlineJakub Hrozek2011-09-061-3/+1
| | | | | | This feature was not used and would probably never be used, because it is much safer to rely on online actions to time out. Moreover, it would make implementing the new features more complex.
* Remove support for pre-1.1 netlinkStephen Gallagher2011-01-171-32/+0
| | | | | | | Netlink 1.0 and older is buggy and unreliable, occasionally causing tight-loops. We're no longer going to try to support it. https://fedorahosted.org/sssd/ticket/755
* Fix a typo on setup_netlink()Sumit Bose2010-11-241-1/+1
|
* Use netlink to detect going onlineJakub Hrozek2010-07-091-0/+406
Integrates libnl to detect adding routes. When a route is added, the offline status of all back ends is reset. This patch adds no heuristics to detect whether back end went offline. Fixes: #456