[systemd-commits] 7 commits - src/journal src/resolve

Lennart Poettering lennart at kemper.freedesktop.org
Mon Aug 4 19:19:33 PDT 2014


 src/journal/journald-native.c          |   10 ++++------
 src/resolve/resolved-dns-transaction.c |    5 +++++
 src/resolve/resolved-dns-zone.c        |    7 ++++---
 src/resolve/resolved-link.c            |    8 ++++----
 4 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 7b85d72f824cdf34554b349712b6b8e39095dbd4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:18:23 2014 +0200

    resolved: don't consider tentative addresses relevant

diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 3b2c02a..53b1e3c 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -519,7 +519,7 @@ int link_address_update_rtnl(LinkAddress *a, sd_rtnl_message *m) {
 bool link_address_relevant(LinkAddress *a) {
         assert(a);
 
-        if (a->flags & IFA_F_DEPRECATED)
+        if (a->flags & (IFA_F_DEPRECATED|IFA_F_TENTATIVE))
                 return false;
 
         if (IN_SET(a->scope, RT_SCOPE_HOST, RT_SCOPE_NOWHERE))

commit cc7844e78751916acb639443c119763cafe2c684
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:18:01 2014 +0200

    resolved: fix a message typo

diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index e1cdd60..3b2c02a 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -133,7 +133,7 @@ int link_update_rtnl(Link *l, sd_rtnl_message *m) {
         sd_rtnl_message_read_u32(m, IFLA_MTU, &l->mtu);
 
         if (sd_rtnl_message_read_string(m, IFLA_IFNAME, &n) >= 0) {
-                strncpy(l->name, n, sizeof(l->name));
+                strncpy(l->name, n, sizeof(l->name)-1);
                 char_array_0(l->name);
         }
 
@@ -416,11 +416,11 @@ void link_address_add_rrs(LinkAddress *a, bool force_remove) {
 
                         r = dns_zone_put(&a->link->llmnr_ipv4_scope->zone, a->link->llmnr_ipv4_scope, a->llmnr_address_rr, true);
                         if (r < 0)
-                                log_warning("Failed tp add A record to LLMNR zone: %s", strerror(-r));
+                                log_warning("Failed to add A record to LLMNR zone: %s", strerror(-r));
 
                         r = dns_zone_put(&a->link->llmnr_ipv4_scope->zone, a->link->llmnr_ipv4_scope, a->llmnr_ptr_rr, false);
                         if (r < 0)
-                                log_warning("Failed tp add IPv6 PTR record to LLMNR zone: %s", strerror(-r));
+                                log_warning("Failed to add IPv6 PTR record to LLMNR zone: %s", strerror(-r));
                 } else {
                         if (a->llmnr_address_rr) {
                                 if (a->link->llmnr_ipv4_scope)

commit d84b686f06a7f724c12dcace0ab5cb82d01885f9
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:17:45 2014 +0200

    resolved: stop the prober when we detect a conflict in LLMNR

diff --git a/src/resolve/resolved-dns-zone.c b/src/resolve/resolved-dns-zone.c
index 04a4674..72321d0 100644
--- a/src/resolve/resolved-dns-zone.c
+++ b/src/resolve/resolved-dns-zone.c
@@ -496,6 +496,8 @@ void dns_zone_item_conflict(DnsZoneItem *i) {
         dns_resource_record_to_string(i->rr, &pretty);
         log_info("Detected conflict on %s", strna(pretty));
 
+        dns_zone_item_probe_stop(i);
+
         /* Withdraw the conflict item */
         i->state = DNS_ZONE_ITEM_WITHDRAWN;
 
@@ -522,7 +524,6 @@ void dns_zone_item_ready(DnsZoneItem *i) {
 
                 dns_zone_item_probe_stop(i);
                 i->state = DNS_ZONE_ITEM_ESTABLISHED;
-
         } else
                 dns_zone_item_conflict(i);
 }

commit 60eb3f7cf1b9c183559ce5c9a21cf2cfd6e6da05
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:16:26 2014 +0200

    resolved: don't override zone item state after starting the probe
    
    After all, the probe might be finished immeidately (due to resources,
    ...), and we shouldn't then set the state back to probing.

diff --git a/src/resolve/resolved-dns-zone.c b/src/resolve/resolved-dns-zone.c
index 649cc5c..04a4674 100644
--- a/src/resolve/resolved-dns-zone.c
+++ b/src/resolve/resolved-dns-zone.c
@@ -279,14 +279,14 @@ int dns_zone_put(DnsZone *z, DnsScope *s, DnsResourceRecord *rr, bool probe) {
                 if (established)
                         i->state = DNS_ZONE_ITEM_ESTABLISHED;
                 else {
+                        i->state = DNS_ZONE_ITEM_PROBING;
+
                         r = dns_zone_item_probe_start(i);
                         if (r < 0) {
                                 dns_zone_item_remove_and_free(z, i);
                                 i = NULL;
                                 return r;
                         }
-
-                        i->state = DNS_ZONE_ITEM_PROBING;
                 }
         } else
                 i->state = DNS_ZONE_ITEM_ESTABLISHED;

commit 13b551acb68695716cb4029531b5dec0759efa53
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:15:45 2014 +0200

    resolved: when sending fails, don't try connecting to the next DNS server if we actually use LLMNR as protocol

diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index 83933c6..ad1b277 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -523,6 +523,11 @@ int dns_transaction_go(DnsTransaction *t) {
                 return 0;
         }
         if (r < 0) {
+                if (t->scope->protocol != DNS_PROTOCOL_DNS) {
+                        dns_transaction_complete(t, DNS_TRANSACTION_RESOURCES);
+                        return 0;
+                }
+
                 /* Couldn't send? Try immediately again, with a new server */
                 dns_scope_next_dns_server(t->scope);
 

commit 8c0b803b97bb0ee6603d9be85fb6b69cd6081eaf
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 04:13:37 2014 +0200

    journald: remove redundant newlines

diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index aded998..ac2d0ba 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -108,8 +108,7 @@ void server_process_native_message(
                         /* Entry separator */
 
                         if (entry_size + n + 1 > ENTRY_SIZE_MAX) { /* data + separators + trailer */
-                                log_debug("Entry is too big with %u properties and %zu bytes, ignoring.",
-                                          n, entry_size);
+                                log_debug("Entry is too big with %u properties and %zu bytes, ignoring.", n, entry_size);
                                 continue;
                         }
 
@@ -134,8 +133,7 @@ void server_process_native_message(
                 /* A property follows */
 
                 /* n received properties, +1 for _TRANSPORT */
-                if (!GREEDY_REALLOC(iovec, m, n + 1 + N_IOVEC_META_FIELDS +
-                                              !!object_pid * N_IOVEC_OBJECT_FIELDS)) {
+                if (!GREEDY_REALLOC(iovec, m, n + 1 + N_IOVEC_META_FIELDS + !!object_pid * N_IOVEC_OBJECT_FIELDS)) {
                         log_oom();
                         break;
                 }

commit a174f94d529c7ae9be589867308b669ec9b4dcc0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 5 03:37:56 2014 +0200

    journald: properly sum up entry size counter
    
    We should read the entry size before moving to the next iovec, not
    after.

diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 6bc5df7..aded998 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -153,8 +153,8 @@ void server_process_native_message(
                                  * field */
                                 iovec[n].iov_base = (char*) p;
                                 iovec[n].iov_len = l;
-                                n++;
                                 entry_size += iovec[n].iov_len;
+                                n++;
 
                                 /* We need to determine the priority
                                  * of this entry for the rate limiting
@@ -246,8 +246,8 @@ void server_process_native_message(
                         if (valid_user_field(p, e - p, false)) {
                                 iovec[n].iov_base = k;
                                 iovec[n].iov_len = (e - p) + 1 + l;
-                                n++;
                                 entry_size += iovec[n].iov_len;
+                                n++;
                         } else
                                 free(k);
 



More information about the systemd-commits mailing list