Debian Bug report logs - #605723
freebsd-net-tools: /sbin/route wrapper does not support IPv6

version graph

Package: freebsd-net-tools; Maintainer for freebsd-net-tools is GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>; Source for freebsd-net-tools is src:freebsd-utils.

Reported by: Axel Beckert <abe@debian.org>

Date: Thu, 2 Dec 2010 18:42:01 UTC

Severity: important

Tags: ipv6

Found in version freebsd-utils/8.1-2

Fixed in version freebsd-utils/8.2-1

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, abe@debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#605723; Package freebsd-net-tools. (Thu, 02 Dec 2010 18:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Axel Beckert <abe@debian.org>:
New Bug report received and forwarded. Copy sent to abe@debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Thu, 02 Dec 2010 18:42:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Axel Beckert <abe@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: freebsd-net-tools: /sbin/route wrapper does not support IPv6
Date: Thu, 02 Dec 2010 19:38:47 +0100
Package: freebsd-net-tools
Version: 8.1-2+b1
Severity: important
Tags: ipv6
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Mats Erik Andersson <mats.andersson@gisladisker.se> wrote on the
debian-bsd mailing list:
> The script /sbin/route is really a tie-down for GNU/kFreeBSD.
> It is completely tied to IPv4 and to exactly handle ifup/ifdown.
> Nothing else.

Full text, an initial but incomplete patch and the following discussion
at http://lists.debian.org/debian-bsd/2010/12/msg00007.html

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (110, 'experimental')
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 8.1-1-686-smp
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages freebsd-net-tools depends on:
ii  libbsd0                  0.2.0-1         utility functions from BSD systems
ii  libc0.1                  2.11.2-7        Embedded GNU C Library: Shared lib
ii  libedit2                 2.11-20080614-2 BSD editline and history libraries
ii  libipx2                  8.1-5           FreeBSD IPX address conversion sup
ii  libkvm0                  8.1-5           FreeBSD kvm (kernel memory interfa
ii  libmemstat3              8.1-5           FreeBSD memstat (kernel interface)
ii  libncurses5              5.7+20100313-4  shared libraries for terminal hand
ii  libnetgraph4             8.1-5           FreeBSD memstat (kernel interface)

freebsd-net-tools recommends no packages.

freebsd-net-tools suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#605723; Package freebsd-net-tools. (Fri, 03 Dec 2010 19:27:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mats Erik Andersson <mats.andersson@gisladisker.se>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Fri, 03 Dec 2010 19:27:06 GMT) Full text and rfc822 format available.

Message #10 received at 605723@bugs.debian.org (full text, mbox):

From: Mats Erik Andersson <mats.andersson@gisladisker.se>
To: 605723@bugs.debian.org
Subject: New approach to wrapper.
Date: Fri, 3 Dec 2010 20:23:44 +0100
[Message part 1 (text/plain, inline)]
After staring at the output of $(strings /sbin/ifup | grep route),
I was able to make two observation that in turn lead me to a fully
new approach to the wrapper script. The outcome should be superior
to the previous patch by the order of a magnitude.

The new script is attached in its entirety with this message,
so I will discuss the ideas behind this rewrite. The main idea
is a simple intention:

  1. Do not modify command line arguments. Pass almost everything
     to /lib/freebsd/route.

The strings in "ifup" lead to two initial observations:

  2. We need to support a single Debian native option: "-A inet6".
     This must go between "route" and the command "add".

By the way, only commands "add" and "del" are generated from
ifupdown, all other command calls can be passed verbatim.

  3. When ifup/ifdown passes a non-elementary route, there
     is a GNU/Linux native keyword "gw" present.

If either of these markers is missing, then the string from ifupdown
could equally well pass for a FreeBSD-versioned command.


So, what happens with the keyword "gw" present?

   4. The keyword "gw" must not be passed to /lib/freebsd/route.

One issue creeps up: What if a host or a network is named "gw"?
The present script disregards this possibility. A TODO for later!

A command call from ifup/ifdown containing "gw" can thus be used
as a state in a finite machine. It entails two further principles:

   5. In gw-state, any use of "metric $num" must be discarded.
      No immediate counterpart present in FreeBSD.

   6. Ifup/ifdown appends an interface name at the end, which
      affects gw-state. Since the meaning of "dev $name" in
      GNU/Linux and "-interface $name" do not carry identical
      connotations, the appended name must be dropped.

That is it. My wrapper proposal implements these six observations.

It works like a charm on my machine. Although a single homed
system, it is fun to use "route get" for viewing routes, teasing
with options and the like.

I suggest dropping all tests of the initial patch, instead commencing
the evaluation of the wrapper proposal.


Best regards,

Mats E A
[sbin_route (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information stored :
Bug#605723; Package freebsd-net-tools. (Fri, 03 Dec 2010 20:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and filed, but not forwarded. (Fri, 03 Dec 2010 20:45:05 GMT) Full text and rfc822 format available.

Message #15 received at 605723-quiet@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Mats Erik Andersson <mats.andersson@gisladisker.se>, 605723-quiet@bugs.debian.org
Subject: Re: Bug#605723: New approach to wrapper.
Date: Fri, 3 Dec 2010 21:44:41 +0100 (CET)
> The new script is attached in its entirety with this message,

Works also for me.

Thanks

	Petr




Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#605723; Package freebsd-net-tools. (Tue, 07 Dec 2010 18:03:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mats Erik Andersson <mats.andersson@gisladisker.se>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Tue, 07 Dec 2010 18:03:05 GMT) Full text and rfc822 format available.

Message #20 received at 605723@bugs.debian.org (full text, mbox):

From: Mats Erik Andersson <mats.andersson@gisladisker.se>
To: 605723@bugs.debian.org
Subject: Re: New approach to wrapper
Date: Tue, 7 Dec 2010 18:58:55 +0100
[Message part 1 (text/plain, inline)]
(Resending since original never reached its goal.)

I have a refinement to the proposed wrapper, and also
a new wrapper for "ifconfig".

The binary /sbin/ifconfig is pushed to /lib/freebsd/ifconfig.
Taken together, the two wrappers are able to boot my single
homed system from only /etc/network/interfaces, containing
one static IPv4 and one static IPv6 assignement. Immediately
at first login, I am able to successfully execute

   $ ping -c1 www.google.com

   $ ping6 -c1 ipv6.google.com

The changes to my previous script /sbin/route is a more
restrictive detection of "gw-state", thus hopefully letting
administrators use "gw" as host name!

Best regards,

Mats E A


---------------------------------------------
#!/bin/sh
#
# /sbin/ifconfig
#
# Experimental wrapper for /lib/freebsd/ifconfig.
#
# The invocation of "ifconfig" from "ifup/ifdown"
# needs corrections in GNU/kFreeBSD.

set -e

# Is this call intended to set an IPv6 address
# without using "-inet6"?
if [ $# -eq 3 -a "$2" = "add" ] ; then
  echo $3 | egrep -q '.*:.*/[0-9]+'
  if [ $? -eq 0 ] ; then
    # "add" is is to be deleted, and "inet6" must be augmented.
    # TODO: Should "alias" be appended?
    exec /lib/freebsd/ifconfig $1 inet6 $3
  fi
fi

# The general case, pass everything.
exec /lib/freebsd/ifconfig $@

----------------------------------------------------------

--- /sbin/route.orig
+++ /sbin/route
@@ -74,7 +74,7 @@
   while [ $# -gt 0 ]; do
     if [ -n "$HAVE_SEEN_GW" ] ; then
       if [ $# -eq 1 ] ; then
-        # We have reach the end. An interface name
+        # We have reached the end. An interface name
         # appears as last argument, since we are in
         # a state caused by a call from ifupdown.
         # We simply discard the interface name.
@@ -87,7 +87,9 @@
         args="${args} $1"
       fi
     else
-      if [ "$1" = "gw" ] ; then
+      # Ifup and ifdown use "gw" only in two forms.
+      if [ "$1" = "gw" -a \( $# -eq 3 -o \( $# -eq 5 -a "$3" = "metric" \) \) ]
+      then
         # Change state and discard "gw",
         # hoping that no administrator ever
         # names a host or a network as "gw".
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#605723; Package freebsd-net-tools. (Mon, 10 Jan 2011 13:45:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mats Erik Andersson <mats.andersson@gisladisker.se>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Mon, 10 Jan 2011 13:45:08 GMT) Full text and rfc822 format available.

Message #25 received at 605723@bugs.debian.org (full text, mbox):

From: Mats Erik Andersson <mats.andersson@gisladisker.se>
To: 605723@bugs.debian.org
Subject: Updated route wrapper suggestion
Date: Mon, 10 Jan 2011 14:42:42 +0100
[Message part 1 (text/plain, inline)]
In order to react properly on incomplete calls like

    $ route -h
    $ route -n

two cases of protection on 'shift' are needed:

    -shift
    +test $# -gt 0  &&  shift

Without these Dash aborts with an error.


Best regards,
Mats Erik Andersson, DM
[sbin_route (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Sun, 29 May 2011 20:09:03 GMT) Full text and rfc822 format available.

Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. (Tue, 07 Jun 2011 06:36:11 GMT) Full text and rfc822 format available.

Notification sent to Axel Beckert <abe@debian.org>:
Bug acknowledged by developer. (Tue, 07 Jun 2011 06:36:11 GMT) Full text and rfc822 format available.

Message #32 received at 605723-close@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 605723-close@bugs.debian.org
Subject: Bug#605723: fixed in freebsd-utils 8.2-1
Date: Tue, 07 Jun 2011 06:33:01 +0000
Source: freebsd-utils
Source-Version: 8.2-1

We believe that the bug you reported is fixed in the latest version of
freebsd-utils, which is due to be installed in the Debian FTP archive:

freebsd-net-tools-udeb_8.2-1_kfreebsd-amd64.udeb
  to main/f/freebsd-utils/freebsd-net-tools-udeb_8.2-1_kfreebsd-amd64.udeb
freebsd-net-tools_8.2-1_kfreebsd-amd64.deb
  to main/f/freebsd-utils/freebsd-net-tools_8.2-1_kfreebsd-amd64.deb
freebsd-utils-udeb_8.2-1_kfreebsd-amd64.udeb
  to main/f/freebsd-utils/freebsd-utils-udeb_8.2-1_kfreebsd-amd64.udeb
freebsd-utils_8.2-1.debian.tar.gz
  to main/f/freebsd-utils/freebsd-utils_8.2-1.debian.tar.gz
freebsd-utils_8.2-1.dsc
  to main/f/freebsd-utils/freebsd-utils_8.2-1.dsc
freebsd-utils_8.2-1_kfreebsd-amd64.deb
  to main/f/freebsd-utils/freebsd-utils_8.2-1_kfreebsd-amd64.deb
freebsd-utils_8.2.orig.tar.gz
  to main/f/freebsd-utils/freebsd-utils_8.2.orig.tar.gz
kbdcontrol_8.2-1_kfreebsd-amd64.deb
  to main/f/freebsd-utils/kbdcontrol_8.2-1_kfreebsd-amd64.deb
kldutils-udeb_8.2-1_kfreebsd-amd64.udeb
  to main/f/freebsd-utils/kldutils-udeb_8.2-1_kfreebsd-amd64.udeb
kldutils_8.2-1_kfreebsd-amd64.deb
  to main/f/freebsd-utils/kldutils_8.2-1_kfreebsd-amd64.deb
vidcontrol_8.2-1_kfreebsd-amd64.deb
  to main/f/freebsd-utils/vidcontrol_8.2-1_kfreebsd-amd64.deb



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 605723@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated freebsd-utils 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 ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 07 Jun 2011 08:00:15 +0200
Source: freebsd-utils
Binary: freebsd-utils freebsd-utils-udeb kldutils kldutils-udeb kbdcontrol vidcontrol freebsd-net-tools freebsd-net-tools-udeb
Architecture: source kfreebsd-amd64
Version: 8.2-1
Distribution: unstable
Urgency: low
Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 freebsd-net-tools - FreeBSD networking tools
 freebsd-net-tools-udeb - FreeBSD networking tools (udeb)
 freebsd-utils - FreeBSD utilities needed for GNU/kFreeBSD
 freebsd-utils-udeb - FreeBSD utilities needed for GNU/kFreeBSD (udeb)
 kbdcontrol - command-line tool to change keyboard layout on GNU/kFreeBSD
 kldutils   - tools for managing kFreeBSD modules
 kldutils-udeb - tools for managing kFreeBSD modules (udeb)
 vidcontrol - command-line tool to control the system console on GNU/kFreeBSD
Closes: 595040 605723 609574 627129
Changes: 
 freebsd-utils (8.2-1) unstable; urgency=low
 .
   [ Petr Salinger ]
   * Based on FreeBSD 8.2.
 .
   [ Mats Erik Andersson ]
   * Add IPv6 support into route wrapper. Closes: #605723.
   * Update mount wrapper for remount requests. Closes: #609574.
 .
   [ Robert Millan ]
   * Require kfreebsd-kernel-headers >= 0.54.
   * Add mkuzip.
   * Set freebsd-net-tools-udeb to kfreebsd-any.
   * Remove dependency on ufsutils. (Closes: #595040)
 .
   [ Tuco Xyz ]
   * Add dumpon and savecore.
 .
   [ Guillem Jover ]
   * Translate mount -f (--fake) to -d in the wrapper.
   * Now using Standards-Version 3.9.2 (no changes needed).
   * Move local headers to debian/local/include/.
   * Move local scripts and devfs.d directories to debian/local/.
   * Switch to source format “3.0 (quilt)”.
     - Remove quilt from Build-Depends.
     - Remove patch target in debian/rules.
     - Remove now unneeded README.source.
     - Refresh all patches.
   * Link camcontrol, mdconfig and dmesg directly to libbsd. Closes: #627129
   * Refactor source and tar name into SOURCE and TARNAME in debian/rules.
   * Line-wrap PMAKE variable in debian/rules.
   * Intersperse Build-Depends description comments between the actual
     dependencies.
   * Remove skeleton comment from init scripts.
Checksums-Sha1: 
 bf7e06373e24f5334be8a76beb06f4d27d37cb00 1674 freebsd-utils_8.2-1.dsc
 4284551c3f303a55f5b774b35b3bc9eaf9837365 1539945 freebsd-utils_8.2.orig.tar.gz
 e888a832f900e66cb3ca3b9f924a8ba872415d26 75935 freebsd-utils_8.2-1.debian.tar.gz
 dbb7afa7553e600880b3be0e2de2df278830608a 286946 freebsd-utils_8.2-1_kfreebsd-amd64.deb
 e9a4114d0a4d59fc4d55999eef07db7042d8f73d 39992 freebsd-utils-udeb_8.2-1_kfreebsd-amd64.udeb
 b2d63dcbc2ad95291e59ce5ecc1a2005375508be 35994 kldutils_8.2-1_kfreebsd-amd64.deb
 bb62a095e07e53e1885e43a54804471d11fa5928 7432 kldutils-udeb_8.2-1_kfreebsd-amd64.udeb
 8b5f467ba7022b2043f506471fe788bf794f5843 108740 kbdcontrol_8.2-1_kfreebsd-amd64.deb
 c4459331daa2d48874697315939b89e3ecd9105b 99972 vidcontrol_8.2-1_kfreebsd-amd64.deb
 a89f0fd88d168bb51cdeeb649016fc6107ee3635 347824 freebsd-net-tools_8.2-1_kfreebsd-amd64.deb
 73a44e7506be7e9e2dc5a6a78ad2f468f6f8e3d5 41458 freebsd-net-tools-udeb_8.2-1_kfreebsd-amd64.udeb
Checksums-Sha256: 
 60d6e34a3cfd2a3828a295b7d06a8aba4cb234d9d395c077ee7c636c94c4c8a7 1674 freebsd-utils_8.2-1.dsc
 ff006ea9b9387c647d0e92b87515fb5fe660b7fa63954a47642c7e4e45183b2a 1539945 freebsd-utils_8.2.orig.tar.gz
 d663ea931bd2d34bb188a3b22525d0ec3f6d6ca7664766b775eb78d087632e7d 75935 freebsd-utils_8.2-1.debian.tar.gz
 f5309120dcb8cac5c9535c38f05dc3bf16d7c4f4405f696afdecbb5a569f3fe2 286946 freebsd-utils_8.2-1_kfreebsd-amd64.deb
 ed5d848bc5c98e01b6694677b7145c1e144da07908146d60e2dbab3713acfe8a 39992 freebsd-utils-udeb_8.2-1_kfreebsd-amd64.udeb
 33cb9d8aa7023a470cfc3cc2fe6e8da40f8079c20d66b2d228259d06f420489c 35994 kldutils_8.2-1_kfreebsd-amd64.deb
 6e98fe6854c87a249484fa0485be9adca65e6b128a1314102a213723db2693d6 7432 kldutils-udeb_8.2-1_kfreebsd-amd64.udeb
 5e7c758b339239f1b224204a846f82f451a7971893d5b273af2243a146e3a5ad 108740 kbdcontrol_8.2-1_kfreebsd-amd64.deb
 0f8fa66bdef6ca4289023b7cafc958757c7a7727fe9c1460afd603fd40656e43 99972 vidcontrol_8.2-1_kfreebsd-amd64.deb
 8d5cf98d49bce92bb458520cde3a0ab2714ab7c848e94c08c041aa2641d5774f 347824 freebsd-net-tools_8.2-1_kfreebsd-amd64.deb
 53c0165eef25d3a9d82ae2db3c5fbb69957989fe96c941419be0175b3a20813c 41458 freebsd-net-tools-udeb_8.2-1_kfreebsd-amd64.udeb
Files: 
 f09d74442ba10c4b85bdd66d7d20e9fe 1674 utils important freebsd-utils_8.2-1.dsc
 74dd231ec18ec2f535c4b16fde4ea034 1539945 utils important freebsd-utils_8.2.orig.tar.gz
 4e6a622610684fb9982f7da60c2520b1 75935 utils important freebsd-utils_8.2-1.debian.tar.gz
 5796f8fc3fe22e7a8403d4254856fdc0 286946 utils required freebsd-utils_8.2-1_kfreebsd-amd64.deb
 a5fe207122647f66be9eb0e8daaaec90 39992 debian-installer optional freebsd-utils-udeb_8.2-1_kfreebsd-amd64.udeb
 430ed7bf21c5acfc62ab100c4c705684 35994 utils important kldutils_8.2-1_kfreebsd-amd64.deb
 a57d072c009d59673d9ed0b1168c6ae3 7432 debian-installer optional kldutils-udeb_8.2-1_kfreebsd-amd64.udeb
 e56ded55aa2d9c2ee6f31bb2148b9334 108740 utils important kbdcontrol_8.2-1_kfreebsd-amd64.deb
 82e781e68e03182e084a928f56e0a1b0 99972 utils important vidcontrol_8.2-1_kfreebsd-amd64.deb
 b74e54a6373ba4234bc6d3917cf4042c 347824 net important freebsd-net-tools_8.2-1_kfreebsd-amd64.deb
 ed08e35962b672556814c266ec91b465 41458 debian-installer important freebsd-net-tools-udeb_8.2-1_kfreebsd-amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3twKwACgkQuW9ciZ2SjJuU6gCfe+9+AuK6c1C5XQPcBitaoZUT
4pkAoPBNSriA0duTr9kRjM48D5FrdNSC
=jBHO
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 21 Jul 2011 07:32:58 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 07:14:48 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.