]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #1459 from ssahani/bridge1
authorTom Gundersen <teg@jklm.no>
Mon, 5 Oct 2015 20:44:38 +0000 (22:44 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 5 Oct 2015 20:44:38 +0000 (22:44 +0200)
networkd: add bridge properties

NEWS
man/systemd.network.xml
src/network/networkd-network-gperf.gperf
src/network/networkd-route.c
src/network/networkd-route.h

diff --git a/NEWS b/NEWS
index 249c5f6a6493dd9470757dd204d89bf6d59b4abb..80c347860907f4c531651cbae6896ea0395be20a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -138,7 +138,7 @@ CHANGES WITH 227:
           only intermittendly, and even restores state if the previous
           system shutdown was abrupt rather than clean.
 
-        * Galician, Turkish and Korean translations were added.
+        * Galician, Serbian, Turkish and Korean translations were added.
 
         Contributions from:
 
index 629088ea8166bb5fedcc794cbe7fe1518653792f..e505fbe30fb2402af2ce83e0d0e939e58e493d60 100644 (file)
             <literal>global</literal>.</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><varname>PreferredSource=</varname></term>
+          <listitem>
+            <para>The preferred source address of the route. The address
+            must be in the format described in
+            <citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
+          </listitem>
+        </varlistentry>
       </variablelist>
   </refsect1>
 
index 8257ab45da7279d0e904e38d43e6df692a782163..b6f70e191dee7056f0d475f1ada4a7928c587160 100644 (file)
@@ -61,6 +61,7 @@ Route.Destination,                      config_parse_destination,
 Route.Source,                           config_parse_destination,                       0,                             0
 Route.Metric,                           config_parse_route_priority,                    0,                             0
 Route.Scope,                            config_parse_route_scope,                       0,                             0
+Route.PreferredSource,                  config_parse_preferred_src,                     0,                             0
 DHCP.ClientIdentifier,                  config_parse_dhcp_client_identifier,            0,                             offsetof(Network, dhcp_client_identifier)
 DHCP.UseDNS,                            config_parse_bool,                              0,                             offsetof(Network, dhcp_dns)
 DHCP.UseNTP,                            config_parse_bool,                              0,                             offsetof(Network, dhcp_ntp)
index 1f09d95674f3fd38b79ef0b9b5844b9615468186..ee1ddd81fe84c6983986e2a1ed94a9dce688199f 100644 (file)
@@ -305,6 +305,46 @@ int config_parse_gateway(const char *unit,
         return 0;
 }
 
+int config_parse_preferred_src(const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        Network *network = userdata;
+        _cleanup_route_free_ Route *n = NULL;
+        union in_addr_union buffer;
+        int r, f;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = route_new_static(network, section_line, &n);
+        if (r < 0)
+                return r;
+
+        r = in_addr_from_string_auto(rvalue, &f, &buffer);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+                           "Preferred source is invalid, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        n->family = f;
+        n->prefsrc_addr = buffer;
+        n = NULL;
+
+        return 0;
+}
+
 int config_parse_destination(const char *unit,
                 const char *filename,
                 unsigned line,
index d090b9c91ec1aa5d775f8de70c971eecfd732f14..11e94d44fbf1fcf69ad8cb48d23bc7ab91532d4a 100644 (file)
@@ -55,6 +55,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
 #define _cleanup_route_free_ _cleanup_(route_freep)
 
 int config_parse_gateway(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_preferred_src(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_destination(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_route_priority(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_route_scope(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);