[rygel] server: Better check for localhost
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] server: Better check for localhost
- Date: Mon, 14 Jan 2019 13:09:09 +0000 (UTC)
commit 6bd892bc5a43fb5f526979cdd818ce12b8368bae
Author: Jens Georg <mail jensge org>
Date: Mon Jan 14 13:41:29 2019 +0100
server: Better check for localhost
Delegate the checking of being local to GInetAddress.
This should also catch more addresses in the 127/8 range, IPv6's ::1 and
systems where the loopback device isn't lo (e.g. BSD with lo0)
src/librygel-server/rygel-http-server.vala | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/librygel-server/rygel-http-server.vala b/src/librygel-server/rygel-http-server.vala
index b0990e89..20e3eeb2 100644
--- a/src/librygel-server/rygel-http-server.vala
+++ b/src/librygel-server/rygel-http-server.vala
@@ -64,9 +64,7 @@ public class Rygel.HTTPServer : GLib.Object, Rygel.StateMachine {
this.requests = new ArrayList<HTTPRequest> ();
this.cancellable = content_dir.cancellable;
- // FIXME: Needs adaptation for IPv6
- this.locally_hosted = this.context.interface == "lo" ||
- this.context.host_ip == "127.0.0.1";
+ this.locally_hosted = this.context.get_address ().get_is_loopback ();
this.path_root = "/" + name;
this.replacements = new HashTable <string, string> (str_hash, str_equal);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]