Your message dated Sun, 13 Jan 2019 23:20:05 +0000
with message-id <[email protected]>
and subject line Bug#864889: fixed in ifmetric 0.3-5
has caused the Debian Bug report #864889,
regarding ifmetric: "NETLINK: Error: Invalid argument" for links that are down, 
in kernel 4.4+
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
864889: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864889
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ifmetric
Version: 0.3-4
Severity: normal
Tags: patch

Hi,

My /etc/network/interfaces includes this:

  auto eth1
  iface eth1 inet static
      address 192.168.0.2
      netmask 255.255.255.0
      metric 50

I don't have a network cable plugged in right now, so the link is
down.  When I run "ifup eth1" I get:

  NETLINK: Error: Invalid argument

And the corresponding entry in the routing table is missing.  This is
due to this new check in Linux kernel 4.7 (also part of the stable
series 4.4 at least):

  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80610229ef7b26615dbb6cb6e873709a60bacc9f

- ifmetric reads the original route, which contains RTNH_F_LINKDOWN flag
- ifmetric deletes the original route
- ifmetric modifies the metric
- ifmetric tries to create the new modified route
- the kernel rejects it because the RTNH_F_LINKDOWN flag shouldn't be set from 
userspace

The fix is to clear RTNH_F_DEAD and RTNH_F_LINKDOWN.  Patch attached.

Jim
--- ifmetric-0.3.orig/src/ifmetric.c	2017-06-16 10:50:49.934737561 -0400
+++ ifmetric-0.3/src/ifmetric.c	2017-06-16 10:52:45.934658569 -0400
@@ -97,6 +97,8 @@ struct nlmsghdr* set_route_metric(struct
     l = NLMSG_PAYLOAD(n, sizeof(struct rtmsg));
     a = RTM_RTA(r);
     
+    r->rtm_flags &= ~(RTNH_F_DEAD | RTNH_F_LINKDOWN);
+
     while(RTA_OK(a, l)) {
         switch(a->rta_type) {
             case RTA_PRIORITY:

--- End Message ---
--- Begin Message ---
Source: ifmetric
Source-Version: 0.3-5

We believe that the bug you reported is fixed in the latest version of
ifmetric, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Shuler <[email protected]> (supplier of updated ifmetric package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 10 Jan 2019 13:17:26 -0600
Source: ifmetric
Binary: ifmetric
Architecture: source
Version: 0.3-5
Distribution: unstable
Urgency: medium
Maintainer: Michael Shuler <[email protected]>
Changed-By: Michael Shuler <[email protected]>
Description:
 ifmetric   - Set routing metrics for a network interface
Closes: 864889
Changes:
 ifmetric (0.3-5) unstable; urgency=medium
 .
   * debian/{compat,control,copyright}:
     Update to debhelper-compat (= 12) build dependency; drop d/compat
     Update to standards version 4.3.0.1
     Update to salsa Vcs-Browser/Vcs-Git URLs
     Update to priority optional
     Update to https copyright format URL
   * Fix "NETLINK: Error: Invalid argument" for links that are down in kernel
     4.4+. Thanks for the patch, Jim Paris. Closes: #864889
Checksums-Sha1:
 8b8711c376d939a152af6d1fdf60a1e92e2d9b62 1854 ifmetric_0.3-5.dsc
 04a885345251bdb1b52566eb68fbb02d73c1eae9 3832 ifmetric_0.3-5.debian.tar.xz
 f8afe9fabce8d6dfc19f2ceb7e4af43e2c52bb90 5312 ifmetric_0.3-5_source.buildinfo
Checksums-Sha256:
 5b86ba9491e778fa38b6aa5358a5eeaac7241106becfaf66e6e1ea2cc13cafcb 1854 
ifmetric_0.3-5.dsc
 5aa7b4df05e88edfd3704e3255c588da0b74ab984b2abaca4d1a14c0a65aa4e7 3832 
ifmetric_0.3-5.debian.tar.xz
 988ffd5f84cf78fef09f1c6c1a8415cb016cf412031f3990e8901d7983cb543e 5312 
ifmetric_0.3-5_source.buildinfo
Files:
 4362dea084ddf854abbc091316c913d3 1854 net optional ifmetric_0.3-5.dsc
 aac573462ed53a9891229e61364562ec 3832 net optional ifmetric_0.3-5.debian.tar.xz
 c24a1d30fdb18fd6bd93c50bbfafb460 5312 net optional 
ifmetric_0.3-5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEkjZVexcMh/iCHArDweDZLphvfH4FAlw7xGsACgkQweDZLphv
fH7cog//fVVgSCtEy7GdbD88qPF0iLHnedEaUQJ0gGz5qalWLWFaUeWtA/ftD0Zb
vCv93amLdd0BhIJQZrjpiMk4t48m33Z8vyM3Ym60B/55vCODiLC19PpUauqHdhdz
6FWNLzbPmgeQM9py8QlM0EMQ2JDpj4HTXV38if2qDbCflUmsIgGTsIr4AelOylYD
PepmL16H4tsSSAav/WXCz2xgyQfoeTkjQzyO0/8ZC2UNdbo19ZAQJpfgpfG4pqHY
3SU7fq6/Jrk8EmduzT5LayqyznJRO2YivUDC1E+7KF9ToYq96bn/yWf9PCkak8q4
ITjiOdonZXjSa5iE/E19kC7L7xyIxx652koPt9eVVEqj6b1jueUa1Ds1zLvCiMoY
AdeNpCngRIertA+B+FQ4vpKQ6mQd62l9V6MrSiHbJDqoilNAO5HzE37+GJXd4ose
oL6CH930xe58mAn0cLC6m7vT7SUAz0H9RgV/KmQY7Daspwn2K4x0vnVNlT9Scn1s
/Vee/1J5wp1oEWjdmlJSxLsZYYtCscsicSUURFwAK5Nc0yHh9jPdilQoscOPiNh6
yAIWdv6Y1O1oS+KK4L4chOYDn0xJYTWgfJWoUcjXVN8jEyOVZV8+sqTM66w8FW/2
5upoRAX3zNUw/PjytZXeBTifa+zrwfdJo/jCExjc28bHByb/oZM=
=Q+pt
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to