Commit Graph

12 Commits

Author SHA1 Message Date
Michael Stapelberg a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01:00
Olivier Gayot 451ff9be0b Fix shown IP address belonging to wrong interface
The following commit:

  6a75ea9 Show IP address when address has a label

introduced a way to show the IP address of an interface when a label is
associated to the IP.

When a label is associated to an IP, the structure returned by
getifaddrs() has the label concatenated to the interface name in the
.ifa_name field as in the following example:

    struct ifaddrs ifaddr = {
       .ifa_name = "eth0:mylabel",
    };

As a consequence, using a strict comparison between the interface name
and the .ifa_name field yields a falsy result. However, checking if the
.ifa_name starts with the interface name (e.g. eth0) does not work
either because other network interfaces can have a name which starts
with eth0.

This commit solves the issue by stripping out the optional label from
the .ifa_name field before making a strict comparison with the interface
name.

Fix #283

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-11 22:06:57 +02:00
Olivier Gayot 99a6fb5e49 Simplify the algorithm used to determine the IP address
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-04 19:59:09 +02:00
Dan Robertson 6a75ea9aea
Show IP address when address has a label
If an address has been added with a label, ensure the correct address is
shown.
2018-03-29 10:46:36 +00:00
Emeric Planet 53fb9b4f18 Add IPv6 address when IPv4 isn't available (#247) 2017-12-11 11:38:31 +01:00
Michael Stapelberg d74e904bf4 clang-format-3.5 -i **/*.[ch], update modeline
From here on, we’ll use clang-format to automatically format the source.

This has worked well in i3, so we are introducing it for i3status.
2015-03-16 10:01:07 +01:00
Michael Stapelberg 296eb5e706 Error handling: Never output null as full_text (JSON), prefix messages with i3status (Thanks Artemis)
The former made i3bar crash, the latter is helpful for debugging.
2012-05-09 18:56:57 +02:00
Jasper Lievisse Adriaanse 6eac8bee58 Fix include order; fixes build on OpenBSD. 2012-04-28 10:08:37 +02:00
Michael Stapelberg 12b1bfa9b8 Properly output JSON with libyajl 2012-03-25 22:05:00 +02:00
Michael Stapelberg fac05bf4e8 Bugfix: Correctly check for interface up/down-status (Thanks docsteel) 2010-07-21 11:01:37 +02:00
Michael Stapelberg c166d2e2d3 get_ip_address: return NULL instead of down 2010-01-26 14:25:21 +01:00
Michael Stapelberg f947d0a446 Breaks configfiles! Major refactoring of i3status, see below
We finally switched to libconfuse for a configuration file format
which does not require much work for the programmer nor for the user.
Plus, it avoids the Not-Invented-Here syndrome of yet another config
file format.

Furthermore, as a consequence of providing format strings for every
"module" (ipv6, wireless, …), we directly print the output and thus
we needed to drop support for wmii. This allowed us to get rid of
quite some complexity.

Documentation about the new configuration file and options will
follow. This commit is the beginning of what will be i3status v2.0.
2009-10-11 22:14:29 +02:00