<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - systemd-networkd nonsense"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82721">82721</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>systemd-networkd nonsense
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mustrumr97@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In src/network/networkd-link.c link_save():

--
  1365                            fprintf(f, "%s%s", *address,
  1366                                    (address + 1 ? " " : ""));
--
  1380                            fprintf(f, "%s%s", *address,
  1381                                    (address + 1 ? " " : ""));
--
  1395                            fprintf(f, "%s%s", *domain,
  1396                                    (domain + 1 ? " " : ""));

THIS DOES NOT MAKE SENSE!

address and domain will almost never equal ((char*)NULL)-1 because they are
pointers to allocated storage and (usually) the higher half of the address
space is reserved for the kernel.

You probably meant *(address+1) and *(domain+1). That would make sense however
it would break DHCP (you append an address/domain and then append " ").
Therefore the behavior should be preserved and spaces should always be
appended.

I know your love for patches submitted through bugzilla. I will never send the
following patch to the mailing list:

--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1727,8 +1727,7 @@
                 fputs("DNS=", f);

                 STRV_FOREACH(address, link->network->dns)
-                        fprintf(f, "%s%s", *address,
-                                (address + 1 ? " " : ""));
+                        fprintf(f, "%s ", *address);

                 if (link->network->dhcp_dns &&
                     link->dhcp_lease) {
@@ -1747,8 +1746,7 @@
                 fprintf(f, "NTP=");

                 STRV_FOREACH(address, link->network->ntp)
-                        fprintf(f, "%s%s", *address,
-                                (address + 1 ? " " : ""));
+                        fprintf(f, "%s ", *address);

                 if (link->network->dhcp_ntp &&
                     link->dhcp_lease) {
@@ -1767,8 +1765,7 @@
                 fprintf(f, "DOMAINS=");

                 STRV_FOREACH(domain, link->network->domains)
-                        fprintf(f, "%s%s", *domain,
-                                (domain + 1 ? " " : ""));
+                        fprintf(f, "%s ", *domain);

                 if (link->network->dhcp_domains &&
                     link->dhcp_lease) {


P.S.: Thanks for implementing domains.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>