Re: [systemd-devel] [PATCH] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-09 Thread Alexander Sverdlin
Hi!

On 09/04/15 12:45, Patrik Flykt wrote:
 Hmm, in general, we really should try to create the same binaries,
  regardless if we are built on an old or new kernel. And the binaries
  should work as good as possible, regardless which kernel version they
  are running on. But with the change above the binary built on a newer
  kernel work differently from an older kernel, even though we added the
  definition to missing.h to make the distinction go away...
  
  Or in other words: we try to do runtime compat, not just compile time
  compat, so that we don't strictly have to sync kernel and userspace
  updated.
 Hmm, I was suspecting that for a moment. I need to come up with a better
 runtime solution for version 2 of the patch then.

You should construct and send netlink packet as for kernel 3.14, but be
prepared, you will get error back on 3.13, because the parameter is unknown.
So you just need to handle the error gacefully, not fail.

Alex.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-09 Thread Lennart Poettering
On Thu, 09.04.15 13:37, Patrik Flykt (patrik.fl...@linux.intel.com) wrote:

  src/libsystemd/sd-rtnl/rtnl-types.c |  2 ++
  src/network/networkd-address.c  |  5 +++-
  src/network/networkd-dhcp6.c| 55 
 +++--
  src/network/networkd-link.c |  4 +++
  src/network/networkd-link.h |  2 ++
  5 files changed, 65 insertions(+), 3 deletions(-)
 
 diff --git a/src/libsystemd/sd-rtnl/rtnl-types.c 
 b/src/libsystemd/sd-rtnl/rtnl-types.c
 index 49784bf..407b749 100644
 --- a/src/libsystemd/sd-rtnl/rtnl-types.c
 +++ b/src/libsystemd/sd-rtnl/rtnl-types.c
 @@ -360,7 +360,9 @@ static const NLType rtnl_address_types[CONST_MAX(IFA_MAX, 
 IFA_FLAGS) + 1] = {
  [IFA_ANYCAST],
  [IFA_MULTICAST],
  */
 +#if HAVE_DECL_IFA_FLAGS
  [IFA_FLAGS] = { .type = NLA_U32 },
 +#endif
  };

Hmm, in general, we really should try to create the same binaries,
regardless if we are built on an old or new kernel. And the binaries
should work as good as possible, regardless which kernel version they
are running on. But with the change above the binary built on a newer
kernel work differently from an older kernel, even though we added the
definition to missing.h to make the distinction go away...

Or in other words: we try to do runtime compat, not just compile time
compat, so that we don't strictly have to sync kernel and userspace
updated.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-09 Thread Patrik Flykt
On Thu, 2015-04-09 at 12:43 +0200, Lennart Poettering wrote:
 Hmm, in general, we really should try to create the same binaries,
 regardless if we are built on an old or new kernel. And the binaries
 should work as good as possible, regardless which kernel version they
 are running on. But with the change above the binary built on a newer
 kernel work differently from an older kernel, even though we added the
 definition to missing.h to make the distinction go away...
 
 Or in other words: we try to do runtime compat, not just compile time
 compat, so that we don't strictly have to sync kernel and userspace
 updated.

Hmm, I was suspecting that for a moment. I need to come up with a better
runtime solution for version 2 of the patch then.

Cheers,

Patrik


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel