]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: replace geneve/vxlan port parsing with generic config_parse_ip_port
authorSusant Sahani <susant@redhat.com>
Thu, 27 Apr 2017 05:14:22 +0000 (10:44 +0530)
committerSusant Sahani <susant@redhat.com>
Sat, 29 Apr 2017 17:03:50 +0000 (22:33 +0530)
src/network/netdev/geneve.c
src/network/netdev/geneve.h
src/network/netdev/netdev-gperf.gperf
src/network/netdev/vxlan.c
src/network/netdev/vxlan.h

index 07c69f4711a7aeb1285d1c22639c710db40682f8..e71ea58a10492b5bb484eb767d99b5dc821002ea 100644 (file)
@@ -238,36 +238,6 @@ int config_parse_geneve_address(const char *unit,
         return 0;
 }
 
-int config_parse_geneve_destination_port(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) {
-        Geneve *v = userdata;
-        uint16_t port;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        r = parse_ip_port(rvalue, &port);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse Geneve destination port '%s'.", rvalue);
-                return 0;
-        }
-
-        v->dest_port = port;
-
-        return 0;
-}
-
 int config_parse_geneve_flow_label(const char *unit,
                                    const char *filename,
                                    unsigned line,
index f93b550b061c0a4873a04384c0fe988ae35cf5ea..bde28bac55dec3f416aaf77aab5fad8d01af143f 100644 (file)
@@ -73,17 +73,6 @@ int config_parse_geneve_address(const char *unit,
                                void *data,
                                void *userdata);
 
-int config_parse_geneve_destination_port(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_geneve_flow_label(const char *unit,
                                    const char *filename,
                                    unsigned line,
index 6016b99b543d9655cd93fd69586ee16db31b881d..ed943789d731568ce1144a69a44b9c15d5b72486 100644 (file)
@@ -79,7 +79,7 @@ VXLAN.FDBAgeingSec,          config_parse_sec,                     0,
 VXLAN.GroupPolicyExtension,  config_parse_bool,                    0,                             offsetof(VxLan, group_policy)
 VXLAN.MaximumFDBEntries,     config_parse_unsigned,                0,                             offsetof(VxLan, max_fdb)
 VXLAN.PortRange,             config_parse_port_range,              0,                             0
-VXLAN.DestinationPort,       config_parse_destination_port,        0,                             offsetof(VxLan, dest_port)
+VXLAN.DestinationPort,       config_parse_ip_port,                 0,                             offsetof(VxLan, dest_port)
 VXLAN.FlowLabel,             config_parse_flow_label,              0,                             0
 GENEVE.Id,                   config_parse_geneve_vni,              0,                             offsetof(Geneve, id)
 GENEVE.Remote,               config_parse_geneve_address,          0,                             offsetof(Geneve, remote)
@@ -88,7 +88,7 @@ GENEVE.TTL,                  config_parse_uint8,                   0,
 GENEVE.UDPChecksum,          config_parse_bool,                    0,                             offsetof(Geneve, udpcsum)
 GENEVE.UDP6ZeroCheckSumRx,   config_parse_bool,                    0,                             offsetof(Geneve, udp6zerocsumrx)
 GENEVE.UDP6ZeroCheckSumTx,   config_parse_bool,                    0,                             offsetof(Geneve, udp6zerocsumtx)
-GENEVE.DestinationPort,      config_parse_geneve_destination_port, 0,                             offsetof(Geneve, dest_port)
+GENEVE.DestinationPort,      config_parse_ip_port,                 0,                             offsetof(Geneve, dest_port)
 GENEVE.FlowLabel,            config_parse_geneve_flow_label,       0,                             0
 Tun.OneQueue,                config_parse_bool,                    0,                             offsetof(TunTap, one_queue)
 Tun.MultiQueue,              config_parse_bool,                    0,                             offsetof(TunTap, multi_queue)
index 7f20e6cdfe53929472d5da5d22462e08b414f03c..b5b7aec2c07af4e3af5cca6bfed51cf3bf0f2a16 100644 (file)
@@ -271,36 +271,6 @@ int config_parse_port_range(const char *unit,
         return 0;
 }
 
-int config_parse_destination_port(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) {
-        VxLan *v = userdata;
-        uint16_t port;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        r = parse_ip_port(rvalue, &port);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse VXLAN destination port '%s'.", rvalue);
-                return 0;
-        }
-
-        v->dest_port = port;
-
-        return 0;
-}
-
 int config_parse_flow_label(const char *unit,
                             const char *filename,
                             unsigned line,
index 7f97a9edc471b48829febc043451314b15556df1..1eeda022a2043882bbd133a46f2a991cfca8b817 100644 (file)
@@ -86,17 +86,6 @@ int config_parse_port_range(const char *unit,
                             void *data,
                             void *userdata);
 
-int config_parse_destination_port(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_flow_label(const char *unit,
                             const char *filename,
                             unsigned line,