From: Stephen Hemminger <stephen@networkplumber.org>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: Adam Nielsen <a.nielsen@shikadi.net>, netdev@vger.kernel.org
Subject: Re: Is the manpage wrong for "ip address delete"?
Date: Thu, 25 Jul 2024 11:20:43 -0700 [thread overview]
Message-ID: <20240725112043.5077ef9b@hermes.local> (raw)
In-Reply-To: <m2sewezypi.fsf@gmail.com>
On Fri, 12 Jul 2024 11:33:45 +0100
Donald Hunter <donald.hunter@gmail.com> wrote:
> Adam Nielsen <a.nielsen@shikadi.net> writes:
>
> > Hi all,
> >
> > I'm trying to remove an IP address from an interface, without having to
> > specify it, but the behaviour doesn't seem to match the manpage.
> >
> > In the manpage for ip-address it states:
> >
> > ip address delete - delete protocol address
> > Arguments: coincide with the arguments of ip addr add. The
> > device name is a required argument. The rest are optional. If no
> > arguments are given, the first address is deleted.
That part is just wrong. Went back and looked at really old system
running 2.4 kernel and it failed there as well. Probably something
that got changed long long ago, and no one cared or noticed.
> >
> > I can't work out how to trigger the "if no arguments are given" part:
> >
> > $ ip address delete dev eth0
> > RTNETLINK answers: Operation not supported
> >
> > $ ip address delete "" dev eth0
> > Error: any valid prefix is expected rather than "".
> >
> > $ ip address dev eth0 delete
> > Command "dev" is unknown, try "ip address help".
> >
> > In the end I worked out that "ip address flush dev eth0" did what I
> > wanted, but I'm just wondering whether the manpage needs to be updated
> > to reflect the current behaviour?
>
> Yes, that paragraph of the manpage appears to be wrong. It does not
> match the manpage synopsis, nor the usage from "ip address help" which
> both say:
>
> ip address del IFADDR dev IFNAME [ mngtmpaddr ]
ip address allows address before or after device name.
Both are the same:
# ip address delete 1.1.1.1/24 dev eth0
# ip address delete dev eth0 1.1.1.1/24
>
> The description does match the kernel behaviour for a given address
> family, which you can see by using ynl:
Kernel ynl is new and different.
prev parent reply other threads:[~2024-07-25 18:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 14:52 Is the manpage wrong for "ip address delete"? Adam Nielsen
2024-07-12 10:33 ` Donald Hunter
2024-07-14 5:31 ` Stephen Hemminger
2024-07-15 10:32 ` Donald Hunter
2024-07-25 18:20 ` Stephen Hemminger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240725112043.5077ef9b@hermes.local \
--to=stephen@networkplumber.org \
--cc=a.nielsen@shikadi.net \
--cc=donald.hunter@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).