]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/net: omit freebind from net.list() for AF_UNIX
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 9 Jan 2020 14:46:58 +0000 (15:46 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Fri, 17 Jan 2020 12:39:34 +0000 (13:39 +0100)
daemon/bindings/net.c

index b7d9341927b4a026d4a01758eaa7f1e4386b3695..de377f018eab401d3377d201142177e9fa4936a7 100644 (file)
@@ -44,9 +44,6 @@ static int net_list_add(const char *key, void *val, void *ext)
 
                lua_newtable(L);  // "transport" table
 
-               lua_pushboolean(L, ep->flags.freebind);
-               lua_setfield(L, -2, "freebind");
-
                switch (ep->family) {
                case AF_INET:
                        lua_pushliteral(L, "inet4");
@@ -73,6 +70,8 @@ static int net_list_add(const char *key, void *val, void *ext)
                if (ep->family != AF_UNIX) {
                        lua_pushinteger(L, ep->port);
                        lua_setfield(L, -2, "port");
+                       lua_pushboolean(L, ep->flags.freebind);
+                       lua_setfield(L, -2, "freebind");
                }
 
                if (ep->family == AF_UNIX) {