All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] systemd-networkd: cherry picking route handling patch
@ 2015-01-08  8:43 Maciej Borzecki
  2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-08  8:43 UTC (permalink / raw)
  To: openembedded-core, Chen Qi, Otavio Salvador, Ross Burton, Peter A. Bigot
  Cc: Maciek Borzecki

There is a problem in systemd-networkd version used in OE-core (216 as
of now) that prevents a successful communication in a configuration
that uses a static or IPv4 LL address alongside a dynamically obtained
one. The setup is rather not uncommon as is makes sense to always have
a static well known address that a technician or a support engineer
can access while in the field.

The current code in systed-networkd uses a clever trick to add a
static route to the gateway, to workaround a misconfigured DHCP server
that would assign an address from network pool that the gateway is not
a part of. The trick was missing a source IP address specification in
the static route, thus normally the first assigned IP address would be
used for outgoing IP packets. In this particular case the address
would the static one, hence the packet would most probably be dropped
by the router. Also, it is quite common in smaller networks that the
DHCP server, gateway router and even a DNS server are colocated. In
these setups the current code will effectively render any
communication to or past the router impossible.


Maciej Borzecki (1):
  systemd: cherry-pick patch fixing networkd gateway route handling

 ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
 meta/recipes-core/systemd/systemd_216.bb           |   1 +
 2 files changed, 110 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch

-- 
1.9.3



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08  8:43 [PATCH] systemd-networkd: cherry picking route handling patch Maciej Borzecki
@ 2015-01-08  8:43 ` Maciej Borzecki
  2015-01-08 14:14   ` Otavio Salvador
  2015-01-08 19:59   ` Maciej Borzecki
  2015-01-08 14:13 ` [PATCH] systemd-networkd: cherry picking route handling patch Otavio Salvador
  2015-01-08 22:35 ` akuster808
  2 siblings, 2 replies; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-08  8:43 UTC (permalink / raw)
  To: openembedded-core, Chen Qi, Otavio Salvador, Ross Burton, Peter A. Bigot
  Cc: Maciek Borzecki

Cherry-picking a patch that fixes gateway route handling in
systemd-networkd. The patch adds a source IP to the automatically added gateway
static route, this thus allowing for proper communication in case a static or
IPv4 LL address is used alongside a dynamically obtained one.

(From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
---
 ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
 meta/recipes-core/systemd/systemd_216.bb           |   1 +
 2 files changed, 110 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch

diff --git a/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
new file mode 100644
index 0000000..1a9e8ee
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
@@ -0,0 +1,109 @@
+From 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Fri, 5 Sep 2014 11:56:02 +0200
+Subject: [PATCH] networkd: add preferred source to dhcp4 gateway route
+
+This makes DHCPv4 and IPv4LL coexist peacefully.
+
+[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
+separate variable to indicate when prefsrc should be applied]
+---
+ src/network/networkd-dhcp4.c | 11 +++++++++++
+ src/network/networkd-route.c | 22 ++++++++++++++++++++++
+ src/network/networkd.h       |  1 +
+ 3 files changed, 34 insertions(+)
+
+diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
+index 5e4ff2b80b796ea33de24b9c80076f408f6db63d..b87fa730826daba3650477c430495523ab09054d 100644
+--- a/src/network/networkd-dhcp4.c
++++ b/src/network/networkd-dhcp4.c
+@@ -67,9 +67,18 @@ static int link_set_dhcp_routes(Link *link) {
+                 return r;
+         }
+         if (r >= 0) {
++                struct in_addr address;
+                 _cleanup_route_free_ Route *route = NULL;
+                 _cleanup_route_free_ Route *route_gw = NULL;
+ 
++                r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
++                if (r < 0) {
++                        log_warning_link(link,
++                                         "DHCP error: could not get address: %s",
++                                         strerror(-r));
++                        return r;
++                }
++
+                 r = route_new_dynamic(&route, RTPROT_DHCP);
+                 if (r < 0) {
+                         log_error_link(link,
+@@ -92,6 +101,7 @@ static int link_set_dhcp_routes(Link *link) {
+                 route_gw->family = AF_INET;
+                 route_gw->dst_addr.in = gateway;
+                 route_gw->dst_prefixlen = 32;
++                route_gw->prefsrc_addr.in = address;
+                 route_gw->scope = RT_SCOPE_LINK;
+                 route_gw->metrics = DHCP_ROUTE_METRIC;
+ 
+@@ -107,6 +117,7 @@ static int link_set_dhcp_routes(Link *link) {
+ 
+                 route->family = AF_INET;
+                 route->in_addr.in = gateway;
++                route->prefsrc_addr.in = address;
+                 route->metrics = DHCP_ROUTE_METRIC;
+ 
+                 r = route_configure(route, link, &dhcp4_route_handler);
+diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
+index aead4fbb9e8d47df66c2c892132d9c78e5650a68..10d8cd902a8c16147eb52bb4aa0d01781054ed1b 100644
+--- a/src/network/networkd-route.c
++++ b/src/network/networkd-route.c
+@@ -144,6 +144,17 @@ int route_drop(Route *route, Link *link,
+                 }
+         }
+ 
++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
++                if (route->family == AF_INET)
++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
++                else if (route->family == AF_INET6)
++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
++                if (r < 0) {
++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
++                        return r;
++                }
++        }
++
+         r = sd_rtnl_message_route_set_scope(req, route->scope);
+         if (r < 0) {
+                 log_error("Could not set scope: %s", strerror(-r));
+@@ -218,6 +229,17 @@ int route_configure(Route *route, Link *link,
+                 }
+         }
+ 
++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
++                if (route->family == AF_INET)
++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
++                else if (route->family == AF_INET6)
++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
++                if (r < 0) {
++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
++                        return r;
++                }
++        }
++
+         r = sd_rtnl_message_route_set_scope(req, route->scope);
+         if (r < 0) {
+                 log_error("Could not set scope: %s", strerror(-r));
+diff --git a/src/network/networkd.h b/src/network/networkd.h
+index ab5df1aa3c57952dc9549f2da85332dd966771f4..c6e6b22c383e04413fffed24031410c2695dc190 100644
+--- a/src/network/networkd.h
++++ b/src/network/networkd.h
+@@ -150,6 +150,7 @@ struct Route {
+ 
+         union in_addr_union in_addr;
+         union in_addr_union dst_addr;
++        union in_addr_union prefsrc_addr;
+ 
+         LIST_FIELDS(Route, routes);
+ };
+-- 
+1.9.3
+
diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 536b7be..d82fd7c 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -34,6 +34,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
            file://0001-Make-root-s-home-directory-configurable.patch \
            file://0001-systemd-user-avoid-using-system-auth.patch \
+           file://0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd-networkd: cherry picking route handling patch
  2015-01-08  8:43 [PATCH] systemd-networkd: cherry picking route handling patch Maciej Borzecki
  2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
@ 2015-01-08 14:13 ` Otavio Salvador
  2015-01-08 19:44   ` Maciej Borzecki
  2015-01-08 22:35 ` akuster808
  2 siblings, 1 reply; 14+ messages in thread
From: Otavio Salvador @ 2015-01-08 14:13 UTC (permalink / raw)
  To: Maciej Borzecki
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
<maciej.borzecki@open-rnd.pl> wrote:
> There is a problem in systemd-networkd version used in OE-core (216 as
> of now) that prevents a successful communication in a configuration
> that uses a static or IPv4 LL address alongside a dynamically obtained
> one. The setup is rather not uncommon as is makes sense to always have
> a static well known address that a technician or a support engineer
> can access while in the field.
>
> The current code in systed-networkd uses a clever trick to add a

typo: systemd-networkd

> static route to the gateway, to workaround a misconfigured DHCP server
> that would assign an address from network pool that the gateway is not
> a part of. The trick was missing a source IP address specification in
> the static route, thus normally the first assigned IP address would be
> used for outgoing IP packets. In this particular case the address
> would the static one, hence the packet would most probably be dropped
> by the router. Also, it is quite common in smaller networks that the
> DHCP server, gateway router and even a DNS server are colocated. In

collocated?

> these setups the current code will effectively render any
> communication to or past the router impossible.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
@ 2015-01-08 14:14   ` Otavio Salvador
  2015-01-08 15:46     ` Maciej Borzecki
  2015-01-08 19:59   ` Maciej Borzecki
  1 sibling, 1 reply; 14+ messages in thread
From: Otavio Salvador @ 2015-01-08 14:14 UTC (permalink / raw)
  To: Maciej Borzecki
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
<maciej.borzecki@open-rnd.pl> wrote:
> Cherry-picking a patch that fixes gateway route handling in
> systemd-networkd. The patch adds a source IP to the automatically added gateway
> static route, this thus allowing for proper communication in case a static or
> IPv4 LL address is used alongside a dynamically obtained one.
>
> (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
>
> Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
> ---
>  ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
>  meta/recipes-core/systemd/systemd_216.bb           |   1 +
>  2 files changed, 110 insertions(+)
>  create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
>
> diff --git a/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
> new file mode 100644
> index 0000000..1a9e8ee
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
> @@ -0,0 +1,109 @@
> +From 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 Mon Sep 17 00:00:00 2001
> +From: Emil Renner Berthing <systemd@esmil.dk>
> +Date: Fri, 5 Sep 2014 11:56:02 +0200
> +Subject: [PATCH] networkd: add preferred source to dhcp4 gateway route
> +
> +This makes DHCPv4 and IPv4LL coexist peacefully.
> +
> +[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
> +separate variable to indicate when prefsrc should be applied]

Missing Upstream-Status field.

> +---
> + src/network/networkd-dhcp4.c | 11 +++++++++++
> + src/network/networkd-route.c | 22 ++++++++++++++++++++++
> + src/network/networkd.h       |  1 +
> + 3 files changed, 34 insertions(+)
> +
> +diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
> +index 5e4ff2b80b796ea33de24b9c80076f408f6db63d..b87fa730826daba3650477c430495523ab09054d 100644
> +--- a/src/network/networkd-dhcp4.c
> ++++ b/src/network/networkd-dhcp4.c
> +@@ -67,9 +67,18 @@ static int link_set_dhcp_routes(Link *link) {
> +                 return r;
> +         }
> +         if (r >= 0) {
> ++                struct in_addr address;
> +                 _cleanup_route_free_ Route *route = NULL;
> +                 _cleanup_route_free_ Route *route_gw = NULL;
> +
> ++                r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
> ++                if (r < 0) {
> ++                        log_warning_link(link,
> ++                                         "DHCP error: could not get address: %s",
> ++                                         strerror(-r));
> ++                        return r;
> ++                }
> ++
> +                 r = route_new_dynamic(&route, RTPROT_DHCP);
> +                 if (r < 0) {
> +                         log_error_link(link,
> +@@ -92,6 +101,7 @@ static int link_set_dhcp_routes(Link *link) {
> +                 route_gw->family = AF_INET;
> +                 route_gw->dst_addr.in = gateway;
> +                 route_gw->dst_prefixlen = 32;
> ++                route_gw->prefsrc_addr.in = address;
> +                 route_gw->scope = RT_SCOPE_LINK;
> +                 route_gw->metrics = DHCP_ROUTE_METRIC;
> +
> +@@ -107,6 +117,7 @@ static int link_set_dhcp_routes(Link *link) {
> +
> +                 route->family = AF_INET;
> +                 route->in_addr.in = gateway;
> ++                route->prefsrc_addr.in = address;
> +                 route->metrics = DHCP_ROUTE_METRIC;
> +
> +                 r = route_configure(route, link, &dhcp4_route_handler);
> +diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
> +index aead4fbb9e8d47df66c2c892132d9c78e5650a68..10d8cd902a8c16147eb52bb4aa0d01781054ed1b 100644
> +--- a/src/network/networkd-route.c
> ++++ b/src/network/networkd-route.c
> +@@ -144,6 +144,17 @@ int route_drop(Route *route, Link *link,
> +                 }
> +         }
> +
> ++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
> ++                if (route->family == AF_INET)
> ++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
> ++                else if (route->family == AF_INET6)
> ++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
> ++                if (r < 0) {
> ++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
> ++                        return r;
> ++                }
> ++        }
> ++
> +         r = sd_rtnl_message_route_set_scope(req, route->scope);
> +         if (r < 0) {
> +                 log_error("Could not set scope: %s", strerror(-r));
> +@@ -218,6 +229,17 @@ int route_configure(Route *route, Link *link,
> +                 }
> +         }
> +
> ++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
> ++                if (route->family == AF_INET)
> ++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
> ++                else if (route->family == AF_INET6)
> ++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
> ++                if (r < 0) {
> ++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
> ++                        return r;
> ++                }
> ++        }
> ++
> +         r = sd_rtnl_message_route_set_scope(req, route->scope);
> +         if (r < 0) {
> +                 log_error("Could not set scope: %s", strerror(-r));
> +diff --git a/src/network/networkd.h b/src/network/networkd.h
> +index ab5df1aa3c57952dc9549f2da85332dd966771f4..c6e6b22c383e04413fffed24031410c2695dc190 100644
> +--- a/src/network/networkd.h
> ++++ b/src/network/networkd.h
> +@@ -150,6 +150,7 @@ struct Route {
> +
> +         union in_addr_union in_addr;
> +         union in_addr_union dst_addr;
> ++        union in_addr_union prefsrc_addr;
> +
> +         LIST_FIELDS(Route, routes);
> + };
> +--
> +1.9.3
> +
> diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
> index 536b7be..d82fd7c 100644
> --- a/meta/recipes-core/systemd/systemd_216.bb
> +++ b/meta/recipes-core/systemd/systemd_216.bb
> @@ -34,6 +34,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
>             file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
>             file://0001-Make-root-s-home-directory-configurable.patch \
>             file://0001-systemd-user-avoid-using-system-auth.patch \
> +           file://0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch \
>             file://touchscreen.rules \
>             file://00-create-volatile.conf \
>             file://init \
> --
> 1.9.3
>



-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08 14:14   ` Otavio Salvador
@ 2015-01-08 15:46     ` Maciej Borzecki
  2015-01-08 16:04       ` Otavio Salvador
  0 siblings, 1 reply; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-08 15:46 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On 01/08 12:14, Otavio Salvador wrote:
> On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
> <maciej.borzecki@open-rnd.pl> wrote:
> > Cherry-picking a patch that fixes gateway route handling in
> > systemd-networkd. The patch adds a source IP to the automatically added gateway
> > static route, this thus allowing for proper communication in case a static or
> > IPv4 LL address is used alongside a dynamically obtained one.
> >
> > (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
> >
> > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
> > ---
> >  ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
> >  meta/recipes-core/systemd/systemd_216.bb           |   1 +
> >  2 files changed, 110 insertions(+)
> >  create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
> >
> > diff --git a/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
> > new file mode 100644
> > index 0000000..1a9e8ee
> > --- /dev/null
> > +++ b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
> > @@ -0,0 +1,109 @@
> > +From 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 Mon Sep 17 00:00:00 2001
> > +From: Emil Renner Berthing <systemd@esmil.dk>
> > +Date: Fri, 5 Sep 2014 11:56:02 +0200
> > +Subject: [PATCH] networkd: add preferred source to dhcp4 gateway route
> > +
> > +This makes DHCPv4 and IPv4LL coexist peacefully.
> > +
> > +[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
> > +separate variable to indicate when prefsrc should be applied]
>
> Missing Upstream-Status field.

I'm guessing

Upstream-Status: backport

is the correct stanza?

>
> > +---
> > + src/network/networkd-dhcp4.c | 11 +++++++++++
> > + src/network/networkd-route.c | 22 ++++++++++++++++++++++
> > + src/network/networkd.h       |  1 +
> > + 3 files changed, 34 insertions(+)
> > +
> > +diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
> > +index 5e4ff2b80b796ea33de24b9c80076f408f6db63d..b87fa730826daba3650477c430495523ab09054d 100644
> > +--- a/src/network/networkd-dhcp4.c
> > ++++ b/src/network/networkd-dhcp4.c
> > +@@ -67,9 +67,18 @@ static int link_set_dhcp_routes(Link *link) {
> > +                 return r;
> > +         }
> > +         if (r >= 0) {
> > ++                struct in_addr address;
> > +                 _cleanup_route_free_ Route *route = NULL;
> > +                 _cleanup_route_free_ Route *route_gw = NULL;
> > +
> > ++                r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
> > ++                if (r < 0) {
> > ++                        log_warning_link(link,
> > ++                                         "DHCP error: could not get address: %s",
> > ++                                         strerror(-r));
> > ++                        return r;
> > ++                }
> > ++
> > +                 r = route_new_dynamic(&route, RTPROT_DHCP);
> > +                 if (r < 0) {
> > +                         log_error_link(link,
> > +@@ -92,6 +101,7 @@ static int link_set_dhcp_routes(Link *link) {
> > +                 route_gw->family = AF_INET;
> > +                 route_gw->dst_addr.in = gateway;
> > +                 route_gw->dst_prefixlen = 32;
> > ++                route_gw->prefsrc_addr.in = address;
> > +                 route_gw->scope = RT_SCOPE_LINK;
> > +                 route_gw->metrics = DHCP_ROUTE_METRIC;
> > +
> > +@@ -107,6 +117,7 @@ static int link_set_dhcp_routes(Link *link) {
> > +
> > +                 route->family = AF_INET;
> > +                 route->in_addr.in = gateway;
> > ++                route->prefsrc_addr.in = address;
> > +                 route->metrics = DHCP_ROUTE_METRIC;
> > +
> > +                 r = route_configure(route, link, &dhcp4_route_handler);
> > +diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
> > +index aead4fbb9e8d47df66c2c892132d9c78e5650a68..10d8cd902a8c16147eb52bb4aa0d01781054ed1b 100644
> > +--- a/src/network/networkd-route.c
> > ++++ b/src/network/networkd-route.c
> > +@@ -144,6 +144,17 @@ int route_drop(Route *route, Link *link,
> > +                 }
> > +         }
> > +
> > ++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
> > ++                if (route->family == AF_INET)
> > ++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
> > ++                else if (route->family == AF_INET6)
> > ++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
> > ++                if (r < 0) {
> > ++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
> > ++                        return r;
> > ++                }
> > ++        }
> > ++
> > +         r = sd_rtnl_message_route_set_scope(req, route->scope);
> > +         if (r < 0) {
> > +                 log_error("Could not set scope: %s", strerror(-r));
> > +@@ -218,6 +229,17 @@ int route_configure(Route *route, Link *link,
> > +                 }
> > +         }
> > +
> > ++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
> > ++                if (route->family == AF_INET)
> > ++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
> > ++                else if (route->family == AF_INET6)
> > ++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
> > ++                if (r < 0) {
> > ++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
> > ++                        return r;
> > ++                }
> > ++        }
> > ++
> > +         r = sd_rtnl_message_route_set_scope(req, route->scope);
> > +         if (r < 0) {
> > +                 log_error("Could not set scope: %s", strerror(-r));
> > +diff --git a/src/network/networkd.h b/src/network/networkd.h
> > +index ab5df1aa3c57952dc9549f2da85332dd966771f4..c6e6b22c383e04413fffed24031410c2695dc190 100644
> > +--- a/src/network/networkd.h
> > ++++ b/src/network/networkd.h
> > +@@ -150,6 +150,7 @@ struct Route {
> > +
> > +         union in_addr_union in_addr;
> > +         union in_addr_union dst_addr;
> > ++        union in_addr_union prefsrc_addr;
> > +
> > +         LIST_FIELDS(Route, routes);
> > + };
> > +--
> > +1.9.3
> > +
> > diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
> > index 536b7be..d82fd7c 100644
> > --- a/meta/recipes-core/systemd/systemd_216.bb
> > +++ b/meta/recipes-core/systemd/systemd_216.bb
> > @@ -34,6 +34,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
> >             file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
> >             file://0001-Make-root-s-home-directory-configurable.patch \
> >             file://0001-systemd-user-avoid-using-system-auth.patch \
> > +           file://0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch \
> >             file://touchscreen.rules \
> >             file://00-create-volatile.conf \
> >             file://init \
> > --
> > 1.9.3
> >
>
>
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

--
Maciej Borzęcki
Senior Software Developer at Open-RnD Sp. z o.o., Poland
www.open-rnd.pl
mobile: +48 889 117 365, fax: +48 42 657 9079


Niniejsza wiadomość wraz z załącznikami może
zawierać chronione prawem lub poufne informacje i została
wysłana wyłącznie do wiadomości i użytku osób, do których
została zaadresowana. Jeśli wiadomość została otrzymana
przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
trzecich. W takim przypadku uprasza się o natychmiastowe
zniszczenie wiadomości oraz poinformowanie nadawcy o
zaistniałej sytuacji za pomocą wiadomości zwrotnej.
Dziękujemy.

This message, including any attachments hereto,
may contain privileged or confidential information and is sent
solely for the attention and use of the intended addressee(s).
If you are not an intended addressee, you may neither use this
message nor copy or deliver it to anyone. In such case, you
should immediately destroy this message and kindly notify the
sender by reply email. Thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08 15:46     ` Maciej Borzecki
@ 2015-01-08 16:04       ` Otavio Salvador
  0 siblings, 0 replies; 14+ messages in thread
From: Otavio Salvador @ 2015-01-08 16:04 UTC (permalink / raw)
  To: Maciej Borzecki
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On Thu, Jan 8, 2015 at 1:46 PM, Maciej Borzecki
<maciej.borzecki@open-rnd.pl> wrote:
> On 01/08 12:14, Otavio Salvador wrote:
>> On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
>> <maciej.borzecki@open-rnd.pl> wrote:
>> > Cherry-picking a patch that fixes gateway route handling in
>> > systemd-networkd. The patch adds a source IP to the automatically added gateway
>> > static route, this thus allowing for proper communication in case a static or
>> > IPv4 LL address is used alongside a dynamically obtained one.
>> >
>> > (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
>> >
>> > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
>> > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
>> > ---
>> >  ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
>> >  meta/recipes-core/systemd/systemd_216.bb           |   1 +
>> >  2 files changed, 110 insertions(+)
>> >  create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
>> >
>> > diff --git a/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
>> > new file mode 100644
>> > index 0000000..1a9e8ee
>> > --- /dev/null
>> > +++ b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
>> > @@ -0,0 +1,109 @@
>> > +From 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 Mon Sep 17 00:00:00 2001
>> > +From: Emil Renner Berthing <systemd@esmil.dk>
>> > +Date: Fri, 5 Sep 2014 11:56:02 +0200
>> > +Subject: [PATCH] networkd: add preferred source to dhcp4 gateway route
>> > +
>> > +This makes DHCPv4 and IPv4LL coexist peacefully.
>> > +
>> > +[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
>> > +separate variable to indicate when prefsrc should be applied]
>>
>> Missing Upstream-Status field.
>
> I'm guessing
>
> Upstream-Status: backport
>
> is the correct stanza?

Yes, and [<version>] so we know the referenced version when updating it.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd-networkd: cherry picking route handling patch
  2015-01-08 14:13 ` [PATCH] systemd-networkd: cherry picking route handling patch Otavio Salvador
@ 2015-01-08 19:44   ` Maciej Borzecki
  2015-01-08 19:54     ` Peter A. Bigot
  0 siblings, 1 reply; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-08 19:44 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On 01/08 12:13, Otavio Salvador wrote:
> On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
> <maciej.borzecki@open-rnd.pl> wrote:
> > There is a problem in systemd-networkd version used in OE-core (216 as
> > of now) that prevents a successful communication in a configuration
> > that uses a static or IPv4 LL address alongside a dynamically obtained
> > one. The setup is rather not uncommon as is makes sense to always have
> > a static well known address that a technician or a support engineer
> > can access while in the field.
> >
> > The current code in systed-networkd uses a clever trick to add a
>
> typo: systemd-networkd
>
> > static route to the gateway, to workaround a misconfigured DHCP server
> > that would assign an address from network pool that the gateway is not
> > a part of. The trick was missing a source IP address specification in
> > the static route, thus normally the first assigned IP address would be
> > used for outgoing IP packets. In this particular case the address
> > would the static one, hence the packet would most probably be dropped
> > by the router. Also, it is quite common in smaller networks that the
> > DHCP server, gateway router and even a DNS server are colocated. In
>
> collocated?

Yes, obviously collocated. I'm not sure why, but somehow I missed
[PATCH 0/1] for this cover letter when sending a 1-patch series. If
that's ok, I won't resend the cover letter with typos fixed. It was to
give some background as the backported patch, as it's not that intuitive.

>
> > these setups the current code will effectively render any
> > communication to or past the router impossible.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

--
Maciej Borzęcki
Senior Software Developer at Open-RnD Sp. z o.o., Poland
www.open-rnd.pl
mobile: +48 889 117 365, fax: +48 42 657 9079


Niniejsza wiadomość wraz z załącznikami może
zawierać chronione prawem lub poufne informacje i została
wysłana wyłącznie do wiadomości i użytku osób, do których
została zaadresowana. Jeśli wiadomość została otrzymana
przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
trzecich. W takim przypadku uprasza się o natychmiastowe
zniszczenie wiadomości oraz poinformowanie nadawcy o
zaistniałej sytuacji za pomocą wiadomości zwrotnej.
Dziękujemy.

This message, including any attachments hereto,
may contain privileged or confidential information and is sent
solely for the attention and use of the intended addressee(s).
If you are not an intended addressee, you may neither use this
message nor copy or deliver it to anyone. In such case, you
should immediately destroy this message and kindly notify the
sender by reply email. Thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd-networkd: cherry picking route handling patch
  2015-01-08 19:44   ` Maciej Borzecki
@ 2015-01-08 19:54     ` Peter A. Bigot
  0 siblings, 0 replies; 14+ messages in thread
From: Peter A. Bigot @ 2015-01-08 19:54 UTC (permalink / raw)
  To: Maciej Borzecki, Otavio Salvador
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On 01/08/2015 01:44 PM, Maciej Borzecki wrote:
> On 01/08 12:13, Otavio Salvador wrote:
>> On Thu, Jan 8, 2015 at 6:43 AM, Maciej Borzecki
>> <maciej.borzecki@open-rnd.pl> wrote:
>>> static route to the gateway, to workaround a misconfigured DHCP server
>>> that would assign an address from network pool that the gateway is not
>>> a part of. The trick was missing a source IP address specification in
>>> the static route, thus normally the first assigned IP address would be
>>> used for outgoing IP packets. In this particular case the address
>>> would the static one, hence the packet would most probably be dropped
>>> by the router. Also, it is quite common in smaller networks that the
>>> DHCP server, gateway router and even a DNS server are colocated. In
>> collocated?
> Yes, obviously collocated.

Or preferably "co-located", as collocate is a technical term in 
linguistics that is pronounced differently than the term intended here.

http://www.grammarphobia.com/blog/2013/08/collocation-colocation-co-location.html

Peter


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
  2015-01-08 14:14   ` Otavio Salvador
@ 2015-01-08 19:59   ` Maciej Borzecki
  2015-01-08 20:36     ` Otavio Salvador
  1 sibling, 1 reply; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-08 19:59 UTC (permalink / raw)
  To: openembedded-core, Chen Qi, Otavio Salvador, Ross Burton, Peter A. Bigot
  Cc: Maciek Borzecki

Cherry-picking a patch that fixes gateway route handling in systemd-networkd.
The patch adds a source IP to the automatically added gateway static route,
thus allowing for proper IP communication in a scenario when a static or
IPv4-LL address is used alongside a dynamically obtained one.

(From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
---
 ...d-preferred-source-to-dhcp4-gateway-route.patch | 114 +++++++++++++++++++++
 meta/recipes-core/systemd/systemd_216.bb           |   1 +
 2 files changed, 115 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch

diff --git a/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
new file mode 100644
index 0000000..9d1802f
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
@@ -0,0 +1,114 @@
+From 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Fri, 5 Sep 2014 11:56:02 +0200
+Subject: [PATCH] networkd: add preferred source to dhcp4 gateway route
+
+This makes DHCPv4 and IPv4LL coexist peacefully.
+
+[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
+separate variable to indicate when prefsrc should be applied]
+
+[MB: there was no Author SOB]
+Upstream-Status: Backport [ v216-190-g46b0c76 ]
+Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
+Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
+---
+ src/network/networkd-dhcp4.c | 11 +++++++++++
+ src/network/networkd-route.c | 22 ++++++++++++++++++++++
+ src/network/networkd.h       |  1 +
+ 3 files changed, 34 insertions(+)
+
+diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
+index 5e4ff2b80b796ea33de24b9c80076f408f6db63d..b87fa730826daba3650477c430495523ab09054d 100644
+--- a/src/network/networkd-dhcp4.c
++++ b/src/network/networkd-dhcp4.c
+@@ -67,9 +67,18 @@ static int link_set_dhcp_routes(Link *link) {
+                 return r;
+         }
+         if (r >= 0) {
++                struct in_addr address;
+                 _cleanup_route_free_ Route *route = NULL;
+                 _cleanup_route_free_ Route *route_gw = NULL;
+ 
++                r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
++                if (r < 0) {
++                        log_warning_link(link,
++                                         "DHCP error: could not get address: %s",
++                                         strerror(-r));
++                        return r;
++                }
++
+                 r = route_new_dynamic(&route, RTPROT_DHCP);
+                 if (r < 0) {
+                         log_error_link(link,
+@@ -92,6 +101,7 @@ static int link_set_dhcp_routes(Link *link) {
+                 route_gw->family = AF_INET;
+                 route_gw->dst_addr.in = gateway;
+                 route_gw->dst_prefixlen = 32;
++                route_gw->prefsrc_addr.in = address;
+                 route_gw->scope = RT_SCOPE_LINK;
+                 route_gw->metrics = DHCP_ROUTE_METRIC;
+ 
+@@ -107,6 +117,7 @@ static int link_set_dhcp_routes(Link *link) {
+ 
+                 route->family = AF_INET;
+                 route->in_addr.in = gateway;
++                route->prefsrc_addr.in = address;
+                 route->metrics = DHCP_ROUTE_METRIC;
+ 
+                 r = route_configure(route, link, &dhcp4_route_handler);
+diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
+index aead4fbb9e8d47df66c2c892132d9c78e5650a68..10d8cd902a8c16147eb52bb4aa0d01781054ed1b 100644
+--- a/src/network/networkd-route.c
++++ b/src/network/networkd-route.c
+@@ -144,6 +144,17 @@ int route_drop(Route *route, Link *link,
+                 }
+         }
+ 
++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
++                if (route->family == AF_INET)
++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
++                else if (route->family == AF_INET6)
++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
++                if (r < 0) {
++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
++                        return r;
++                }
++        }
++
+         r = sd_rtnl_message_route_set_scope(req, route->scope);
+         if (r < 0) {
+                 log_error("Could not set scope: %s", strerror(-r));
+@@ -218,6 +229,17 @@ int route_configure(Route *route, Link *link,
+                 }
+         }
+ 
++        if (!in_addr_is_null(route->family, &route->prefsrc_addr)) {
++                if (route->family == AF_INET)
++                        r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in);
++                else if (route->family == AF_INET6)
++                        r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6);
++                if (r < 0) {
++                        log_error("Could not append RTA_PREFSRC attribute: %s", strerror(-r));
++                        return r;
++                }
++        }
++
+         r = sd_rtnl_message_route_set_scope(req, route->scope);
+         if (r < 0) {
+                 log_error("Could not set scope: %s", strerror(-r));
+diff --git a/src/network/networkd.h b/src/network/networkd.h
+index ab5df1aa3c57952dc9549f2da85332dd966771f4..c6e6b22c383e04413fffed24031410c2695dc190 100644
+--- a/src/network/networkd.h
++++ b/src/network/networkd.h
+@@ -150,6 +150,7 @@ struct Route {
+ 
+         union in_addr_union in_addr;
+         union in_addr_union dst_addr;
++        union in_addr_union prefsrc_addr;
+ 
+         LIST_FIELDS(Route, routes);
+ };
+-- 
+1.9.3
+
diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 536b7be..d82fd7c 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -34,6 +34,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
            file://0001-Make-root-s-home-directory-configurable.patch \
            file://0001-systemd-user-avoid-using-system-auth.patch \
+           file://0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08 19:59   ` Maciej Borzecki
@ 2015-01-08 20:36     ` Otavio Salvador
  2015-02-02  7:36       ` Maciej Borzecki
  0 siblings, 1 reply; 14+ messages in thread
From: Otavio Salvador @ 2015-01-08 20:36 UTC (permalink / raw)
  To: Maciej Borzecki
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On Thu, Jan 8, 2015 at 5:59 PM, Maciej Borzecki
<maciej.borzecki@open-rnd.pl> wrote:
> Cherry-picking a patch that fixes gateway route handling in systemd-networkd.
> The patch adds a source IP to the automatically added gateway static route,
> thus allowing for proper IP communication in a scenario when a static or
> IPv4-LL address is used alongside a dynamically obtained one.
>
> (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
>
> Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd-networkd: cherry picking route handling patch
  2015-01-08  8:43 [PATCH] systemd-networkd: cherry picking route handling patch Maciej Borzecki
  2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
  2015-01-08 14:13 ` [PATCH] systemd-networkd: cherry picking route handling patch Otavio Salvador
@ 2015-01-08 22:35 ` akuster808
  2015-01-09  8:12   ` Maciej Borzecki
  2 siblings, 1 reply; 14+ messages in thread
From: akuster808 @ 2015-01-08 22:35 UTC (permalink / raw)
  To: Maciej Borzecki, openembedded-core, Chen Qi, Otavio Salvador,
	Ross Burton, Peter A. Bigot
  Cc: Maciek Borzecki

Does this affect Dizzy?

- armin

On 01/08/2015 12:43 AM, Maciej Borzecki wrote:
> There is a problem in systemd-networkd version used in OE-core (216 as
> of now) that prevents a successful communication in a configuration
> that uses a static or IPv4 LL address alongside a dynamically obtained
> one. The setup is rather not uncommon as is makes sense to always have
> a static well known address that a technician or a support engineer
> can access while in the field.
>
> The current code in systed-networkd uses a clever trick to add a
> static route to the gateway, to workaround a misconfigured DHCP server
> that would assign an address from network pool that the gateway is not
> a part of. The trick was missing a source IP address specification in
> the static route, thus normally the first assigned IP address would be
> used for outgoing IP packets. In this particular case the address
> would the static one, hence the packet would most probably be dropped
> by the router. Also, it is quite common in smaller networks that the
> DHCP server, gateway router and even a DNS server are colocated. In
> these setups the current code will effectively render any
> communication to or past the router impossible.
>
>
> Maciej Borzecki (1):
>    systemd: cherry-pick patch fixing networkd gateway route handling
>
>   ...d-preferred-source-to-dhcp4-gateway-route.patch | 109 +++++++++++++++++++++
>   meta/recipes-core/systemd/systemd_216.bb           |   1 +
>   2 files changed, 110 insertions(+)
>   create mode 100644 meta/recipes-core/systemd/systemd/0001-networkd-add-preferred-source-to-dhcp4-gateway-route.patch
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd-networkd: cherry picking route handling patch
  2015-01-08 22:35 ` akuster808
@ 2015-01-09  8:12   ` Maciej Borzecki
  0 siblings, 0 replies; 14+ messages in thread
From: Maciej Borzecki @ 2015-01-09  8:12 UTC (permalink / raw)
  To: akuster808; +Cc: Otavio Salvador, openembedded-core, Maciek Borzecki

On 01/08 14:35, akuster808 wrote:
> Does this affect Dizzy?

Yes, Dizzy uses the same revision of systemd
(5d0ae62c665262c4c55536457e84e278c252cc0b tagged as v216) as master.

--
Maciej Borzęcki
Senior Software Developer at Open-RnD Sp. z o.o., Poland
www.open-rnd.pl
mobile: +48 889 117 365, fax: +48 42 657 9079


Niniejsza wiadomość wraz z załącznikami może
zawierać chronione prawem lub poufne informacje i została
wysłana wyłącznie do wiadomości i użytku osób, do których
została zaadresowana. Jeśli wiadomość została otrzymana
przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
trzecich. W takim przypadku uprasza się o natychmiastowe
zniszczenie wiadomości oraz poinformowanie nadawcy o
zaistniałej sytuacji za pomocą wiadomości zwrotnej.
Dziękujemy.

This message, including any attachments hereto,
may contain privileged or confidential information and is sent
solely for the attention and use of the intended addressee(s).
If you are not an intended addressee, you may neither use this
message nor copy or deliver it to anyone. In such case, you
should immediately destroy this message and kindly notify the
sender by reply email. Thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-01-08 20:36     ` Otavio Salvador
@ 2015-02-02  7:36       ` Maciej Borzecki
  2015-02-02  7:52         ` Maciej Borzecki
  0 siblings, 1 reply; 14+ messages in thread
From: Maciej Borzecki @ 2015-02-02  7:36 UTC (permalink / raw)
  To: Otavio Salvador, Ross Burton, Saul Wold
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On 01/08 18:36, Otavio Salvador wrote:
> On Thu, Jan 8, 2015 at 5:59 PM, Maciej Borzecki
> <maciej.borzecki@open-rnd.pl> wrote:
> > Cherry-picking a patch that fixes gateway route handling in systemd-networkd.
> > The patch adds a source IP to the automatically added gateway static route,
> > thus allowing for proper IP communication in a scenario when a static or
> > IPv4-LL address is used alongside a dynamically obtained one.
> >
> > (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
> >
> > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
>
> Acked-by: Otavio Salvador <otavio@ossystems.com.br>
>

Can we pick that up for master?

--
Maciej Borzęcki
Senior Software Developer at Open-RnD Sp. z o.o., Poland
www.open-rnd.pl
mobile: +48 889 117 365, fax: +48 42 657 9079


Niniejsza wiadomość wraz z załącznikami może
zawierać chronione prawem lub poufne informacje i została
wysłana wyłącznie do wiadomości i użytku osób, do których
została zaadresowana. Jeśli wiadomość została otrzymana
przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
trzecich. W takim przypadku uprasza się o natychmiastowe
zniszczenie wiadomości oraz poinformowanie nadawcy o
zaistniałej sytuacji za pomocą wiadomości zwrotnej.
Dziękujemy.

This message, including any attachments hereto,
may contain privileged or confidential information and is sent
solely for the attention and use of the intended addressee(s).
If you are not an intended addressee, you may neither use this
message nor copy or deliver it to anyone. In such case, you
should immediately destroy this message and kindly notify the
sender by reply email. Thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling
  2015-02-02  7:36       ` Maciej Borzecki
@ 2015-02-02  7:52         ` Maciej Borzecki
  0 siblings, 0 replies; 14+ messages in thread
From: Maciej Borzecki @ 2015-02-02  7:52 UTC (permalink / raw)
  To: Otavio Salvador, Ross Burton, Saul Wold, akuster808
  Cc: Maciek Borzecki, Patches and discussions about the oe-core layer

On 02/02 08:36, Maciej Borzecki wrote:
> On 01/08 18:36, Otavio Salvador wrote:
> > On Thu, Jan 8, 2015 at 5:59 PM, Maciej Borzecki
> > <maciej.borzecki@open-rnd.pl> wrote:
> > > Cherry-picking a patch that fixes gateway route handling in systemd-networkd.
> > > The patch adds a source IP to the automatically added gateway static route,
> > > thus allowing for proper IP communication in a scenario when a static or
> > > IPv4-LL address is used alongside a dynamically obtained one.
> > >
> > > (From systemd rev: 46b0c76e2c355c0d0cc4792abb98cde07b28bc5)
> > >
> > > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> > > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
> >
> > Acked-by: Otavio Salvador <otavio@ossystems.com.br>
> >
>
> Can we pick that up for master?

Just spotted a patch from Khem that updates systemd to 218. Once Khem's
patch is in, we can just drop this one.

A backport to Dizzy still makes sense though.

--
Maciej Borzęcki
Senior Software Developer at Open-RnD Sp. z o.o., Poland
www.open-rnd.pl
mobile: +48 889 117 365, fax: +48 42 657 9079


Niniejsza wiadomość wraz z załącznikami może
zawierać chronione prawem lub poufne informacje i została
wysłana wyłącznie do wiadomości i użytku osób, do których
została zaadresowana. Jeśli wiadomość została otrzymana
przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
trzecich. W takim przypadku uprasza się o natychmiastowe
zniszczenie wiadomości oraz poinformowanie nadawcy o
zaistniałej sytuacji za pomocą wiadomości zwrotnej.
Dziękujemy.

This message, including any attachments hereto,
may contain privileged or confidential information and is sent
solely for the attention and use of the intended addressee(s).
If you are not an intended addressee, you may neither use this
message nor copy or deliver it to anyone. In such case, you
should immediately destroy this message and kindly notify the
sender by reply email. Thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-02-02  7:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08  8:43 [PATCH] systemd-networkd: cherry picking route handling patch Maciej Borzecki
2015-01-08  8:43 ` [PATCH] systemd: cherry-pick patch fixing networkd gateway route handling Maciej Borzecki
2015-01-08 14:14   ` Otavio Salvador
2015-01-08 15:46     ` Maciej Borzecki
2015-01-08 16:04       ` Otavio Salvador
2015-01-08 19:59   ` Maciej Borzecki
2015-01-08 20:36     ` Otavio Salvador
2015-02-02  7:36       ` Maciej Borzecki
2015-02-02  7:52         ` Maciej Borzecki
2015-01-08 14:13 ` [PATCH] systemd-networkd: cherry picking route handling patch Otavio Salvador
2015-01-08 19:44   ` Maciej Borzecki
2015-01-08 19:54     ` Peter A. Bigot
2015-01-08 22:35 ` akuster808
2015-01-09  8:12   ` Maciej Borzecki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.