Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

IPaddr2 gives a spurious warning on stop

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


anibal at sgi

Mar 4, 2007, 10:25 PM

Post #1 of 14 (1194 views)
Permalink
IPaddr2 gives a spurious warning on stop

Hello,

The following problem was reported by Russell Coker.

The below message occurs on stderr when the IPaddr2 script which is part of the
heartbeat package is stopped (IE removing a single IP address from an interface).
It seems that on start it adds /32 to the end of the address, so it needs to do
the same on stop.

2007/03/02_15:19:07 INFO: /sbin/ip -f inet addr delete 192.168.0.2 dev eth0
Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (192.168.0.2/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!

I created the following patch to fix this bug.

--- resources/OCF/IPaddr2.in~ 2007-01-12 13:57:08.000000000 +1100
+++ resources/OCF/IPaddr2.in 2007-03-05 16:29:41.797530093 +1100
@@ -380,7 +380,7 @@
ipaddr="$1"
iface="$2"

- CMD="$IP2UTIL -f inet addr delete $ipaddr dev $iface"
+ CMD="$IP2UTIL -f inet addr delete $ipaddr/32 dev $iface"

ocf_log info "$CMD"
$CMD

Aníbal
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


tis at foobar

Mar 4, 2007, 11:19 PM

Post #2 of 14 (1155 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

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

Aníbal Monsalve Salazar wrote:

> The below message occurs on stderr when the IPaddr2 script which is part of the
> heartbeat package is stopped (IE removing a single IP address from an interface).
> It seems that on start it adds /32 to the end of the address, so it needs to do
> the same on stop.

That's not always case. Netmaks on add can be anything.

> 2007/03/02_15:19:07 INFO: /sbin/ip -f inet addr delete 192.168.0.2 dev eth0
> Warning: Executing wildcard deletion to stay compatible with old scripts.
> Explicitly specify the prefix length (192.168.0.2/32) to avoid this warning.
> This special behaviour is likely to disappear in further releases,
> fix your scripts!
>
> I created the following patch to fix this bug.
>
> --- resources/OCF/IPaddr2.in~ 2007-01-12 13:57:08.000000000 +1100
> +++ resources/OCF/IPaddr2.in 2007-03-05 16:29:41.797530093 +1100
> @@ -380,7 +380,7 @@
> ipaddr="$1"
> iface="$2"
>
> - CMD="$IP2UTIL -f inet addr delete $ipaddr dev $iface"
> + CMD="$IP2UTIL -f inet addr delete $ipaddr/32 dev $iface"
>
> ocf_log info "$CMD"
> $CMD

So this patch is wrong. More changes are needed. I'll do proper patch.

- --
Tuomo Soini <tis [at] foobar>
Linux and network services
+358 40 5240030
Foobar Oy <http://foobar.fi/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFF68SQTlrZKzwul1ERAoG0AJ9c+QrZGCs3zR3MFzVr7CrbY3hsiACfZRpi
+rH3kOEnv4SplvPuY6U1YoU=
=U/Cb
-----END PGP SIGNATURE-----
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


tis at foobar

Mar 5, 2007, 12:07 AM

Post #3 of 14 (1151 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

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

Tuomo Soini wrote:
> Aníbal Monsalve Salazar wrote:
>
>> The below message occurs on stderr when the IPaddr2 script which is part of the
>> heartbeat package is stopped (IE removing a single IP address from an interface).
>> It seems that on start it adds /32 to the end of the address, so it needs to do
>> the same on stop.

> So this patch is wrong. More changes are needed. I'll do proper patch.

Proposed patch attached.

- --
Tuomo Soini <tis [at] foobar>
Linux and network services
+358 40 5240030
Foobar Oy <http://foobar.fi/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFF68/ITlrZKzwul1ERAlfJAJ9b1ekD5Ug8KRQz+fh3cxd6Uy9iewCgqjEI
WV8KCKrjBT/2OZd7nr/yRL0=
=x4v4
-----END PGP SIGNATURE-----
Attachments: heartbeat-2.0.8-OCF-IPaddr2-ifacedel.patch (0.91 KB)


lmb at suse

Mar 5, 2007, 2:01 AM

Post #4 of 14 (1153 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

On 2007-03-05T17:25:44, Aníbal Monsalve Salazar <anibal [at] sgi> wrote:

> I created the following patch to fix this bug.
>
> --- resources/OCF/IPaddr2.in~ 2007-01-12 13:57:08.000000000 +1100
> +++ resources/OCF/IPaddr2.in 2007-03-05 16:29:41.797530093 +1100
> @@ -380,7 +380,7 @@
> ipaddr="$1"
> iface="$2"
>
> - CMD="$IP2UTIL -f inet addr delete $ipaddr dev $iface"
> + CMD="$IP2UTIL -f inet addr delete $ipaddr/32 dev $iface"
>
> ocf_log info "$CMD"
> $CMD

No, it should not.

The IP might have been added with a different netmask. We want it to be
deleted regardless of the netmask.

The warning from ip should be ignored.

Alternatively, one should look up the netmask prior to deletion.


Sincerely,
Lars

--
Teamlead Kernel, SuSE Labs, Research and Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Mar 5, 2007, 12:33 PM

Post #5 of 14 (1147 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

On 2007-03-05T10:07:36, Tuomo Soini <tis [at] foobar> wrote:

> > So this patch is wrong. More changes are needed. I'll do proper patch.
>
> Proposed patch attached.

Wrong too, because it will fail if asked to stop a resource with a
different netmask.


_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


Thomas at zango

Mar 5, 2007, 1:02 PM

Post #6 of 14 (1148 views)
Permalink
RE: IPaddr2 gives a spurious warning on stop [In reply to]

> -----Original Message-----
> From: linux-ha-dev-bounces [at] lists
> [mailto:linux-ha-dev-bounces [at] lists] On Behalf Of
> Lars Marowsky-Bree
> Sent: March 5, 2007 5:02
> To: High-Availability Linux Development List
> Subject: Re: [Linux-ha-dev] IPaddr2 gives a spurious warning on stop
>
> On 2007-03-05T17:25:44, Aníbal Monsalve Salazar
> <anibal [at] sgi> wrote:
>
> > I created the following patch to fix this bug.
> >
> > --- resources/OCF/IPaddr2.in~ 2007-01-12
> 13:57:08.000000000 +1100
> > +++ resources/OCF/IPaddr2.in 2007-03-05
> 16:29:41.797530093 +1100
> > @@ -380,7 +380,7 @@
> > ipaddr="$1"
> > iface="$2"
> >
> > - CMD="$IP2UTIL -f inet addr delete $ipaddr dev $iface"
> > + CMD="$IP2UTIL -f inet addr delete $ipaddr/32 dev $iface"
> >
> > ocf_log info "$CMD"
> > $CMD
>
> No, it should not.
>
> The IP might have been added with a different netmask. We
> want it to be
> deleted regardless of the netmask.
>
> The warning from ip should be ignored.
>
> Alternatively, one should look up the netmask prior to deletion.

Hey, wait!! The netmask is usually passed from command-line. Why not just
force it? Removal should use the same netmask and there'll be no problem
this way.

I.e. on my setup I run something like: IPaddr2::1.2.3.4/24/eth0

IMHO omiting the netmask is a bad thing. It will create a /32 ip and a /32
cannot commmunicate with anything (though it might work if ppl create a 2nd
address on the same net...)

Thomas
Attachments: smime.p7s (3.00 KB)


tis at foobar

Mar 5, 2007, 2:20 PM

Post #7 of 14 (1152 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

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

Lars Marowsky-Bree wrote:

> Wrong too, because it will fail if asked to stop a resource with a
> different netmask.

I wasn't actually sure it needed fixing. I didn't apply it to my own
tree because ip should not drop support for netmaskless ip removal or
lots of different things will break. I wonder who idiot^H^H^H^H^H added
that warning into ip.

- --
Tuomo Soini <tis [at] foobar>
Linux and network services
+358 40 5240030
Foobar Oy <http://foobar.fi/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFF7JfCTlrZKzwul1ERAhzeAJwI2yCPoytNtf91eWD/LC5KIvNnBACcCn/C
oqL2Tqk6oEYTBU6YKTqSzog=
=V0mC
-----END PGP SIGNATURE-----
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


tis at foobar

Mar 5, 2007, 2:24 PM

Post #8 of 14 (1152 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

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

Thomas Guyot-Sionnest wrote:

> IMHO omiting the netmask is a bad thing. It will create a /32 ip and a /32
> cannot commmunicate with anything (though it might work if ppl create a 2nd
> address on the same net...)

That's not true. /32 is not default for other than LVS. By default
previous netmask of device is used. But I agree that netmask should be
required parameter instead of trying to guess correct one.

- --
Tuomo Soini <tis [at] foobar>
Linux and network services
+358 40 5240030
Foobar Oy <http://foobar.fi/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFF7JiNTlrZKzwul1ERApwXAJ9dqUSHjkQ+SyAvLKUtAFAhayM3fACeMZqh
RMFPio5fL54HR0uNghSvOPk=
=uYBk
-----END PGP SIGNATURE-----
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


anibal at sgi

Mar 5, 2007, 8:51 PM

Post #9 of 14 (1154 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

On Mon, Mar 05, 2007 at 11:01:52AM +0100, Lars Marowsky-Bree wrote:
>Alternatively, one should look up the netmask prior to deletion.

I've implemented the netmask look up prior to deletion. Please review the
following patch.

The context of this patch is SuSE Linux Enterprise Server 10 running RPM
packages of heartbeat-2.0.8 created using a spec file based on the SuSE
heartbeat-2.0.7 source RPM spec file.

--- resources/OCF/IPaddr2.in~ 2007-01-12 13:57:08.000000000 +1100
+++ resources/OCF/IPaddr2.in 2007-03-06 13:56:21.616190436 +1100
@@ -380,7 +380,31 @@
ipaddr="$1"
iface="$2"

- CMD="$IP2UTIL -f inet addr delete $ipaddr dev $iface"
+ #
+ # Look up the netmask prior to deletion
+ #
+ CMD="$IP2UTIL -o -f inet addr show $iface"
+
+ ocf_log info "$CMD"
+ ADDR=`$CMD`
+
+ if [ $? -ne 0 ]; then
+ return $?
+ fi
+
+ #
+ # $ADDR will have the netmask in CIDR format (e.g., 10.0.0.1/8)
+ #
+ ADDR=`echo $ADDR | grep $ipaddr | sed 's/^.*inet //;s/ brd.*$//'"`
+
+ if [ $? -ne 0 -o ! -z "$ADDR" ]; then
+ return $?
+ fi
+
+ #
+ # Delete interface
+ #
+ CMD="$IP2UTIL -f inet addr delete $ADDR dev $iface"

ocf_log info "$CMD"
$CMD

Thank you,

Aníbal
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


alanr at unix

Mar 6, 2007, 7:19 PM

Post #10 of 14 (1147 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

Tuomo Soini wrote:
> Thomas Guyot-Sionnest wrote:
>
>> IMHO omiting the netmask is a bad thing. It will create a /32 ip and a /32
>> cannot commmunicate with anything (though it might work if ppl create a 2nd
>> address on the same net...)
>
> That's not true. /32 is not default for other than LVS. By default
> previous netmask of device is used. But I agree that netmask should be
> required parameter instead of trying to guess correct one.

Lots of people have used the guessing feature to good effect -
especially to get started.

I'm currently rewriting IPaddr* and their interface to findif. Someone
really broke it in converting them to R2. Don't know why no one has
complained about them before.

Guess I should hurry up and finish them.

--
Alan Robertson <alanr [at] unix>

"Openness is the foundation and preservative of friendship... Let me
claim from you at all times your undisguised opinions." - William
Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Mar 7, 2007, 12:58 AM

Post #11 of 14 (1141 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

On 2007-03-06T20:19:54, Alan Robertson <alanr [at] unix> wrote:

> I'm currently rewriting IPaddr* and their interface to findif. Someone
> really broke it in converting them to R2. Don't know why no one has
> complained about them before.

What's broken? Any critical issues?



--
Teamlead Kernel, SuSE Labs, Research and Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


alanr at unix

Mar 7, 2007, 12:52 PM

Post #12 of 14 (1137 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

Lars Marowsky-Bree wrote:
> On 2007-03-06T20:19:54, Alan Robertson <alanr [at] unix> wrote:
>
>> I'm currently rewriting IPaddr* and their interface to findif. Someone
>> really broke it in converting them to R2. Don't know why no one has
>> complained about them before.
>
> What's broken? Any critical issues?

The parsing of options only works if you always specify the options in a
sort of undocumented hierarchy order. In R1, this might have existed,
but it was more obvious.

And, in the process of trying but failing to fix this, the parsing in
findif was made more complicated (and incorrect).

Describing exactly what the broken code will do in various circumstances
is hard - but trust me it's broken.

A simple example:
If I specify an IP address and an interface ONLY, it won't work - even
though findif is designed to work nicely in that case.


--
Alan Robertson <alanr [at] unix>

"Openness is the foundation and preservative of friendship... Let me
claim from you at all times your undisguised opinions." - William
Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


beekhof at gmail

Mar 8, 2007, 7:26 AM

Post #13 of 14 (1137 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

On 3/7/07, Alan Robertson <alanr [at] unix> wrote:
> Lars Marowsky-Bree wrote:
> > On 2007-03-06T20:19:54, Alan Robertson <alanr [at] unix> wrote:
> >
> >> I'm currently rewriting IPaddr* and their interface to findif. Someone
> >> really broke it in converting them to R2. Don't know why no one has
> >> complained about them before.
> >
> > What's broken? Any critical issues?
>
> The parsing of options only works if you always specify the options in a
> sort of undocumented hierarchy order. In R1, this might have existed,
> but it was more obvious.
>
> And, in the process of trying but failing to fix this, the parsing in
> findif was made more complicated (and incorrect).
>
> Describing exactly what the broken code will do in various circumstances
> is hard - but trust me it's broken.
>
> A simple example:
> If I specify an IP address and an interface ONLY, it won't work - even
> though findif is designed to work nicely in that case.

i saw your change (a nice improvement)... would it be a good idea to
pass those values in as options (ie. -b bcast, -m mask, -n nic)?

that way its still flexible, but also usable from the command-line...
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


alanr at unix

Mar 8, 2007, 10:14 AM

Post #14 of 14 (1138 views)
Permalink
Re: IPaddr2 gives a spurious warning on stop [In reply to]

Andrew Beekhof wrote:
> On 3/7/07, Alan Robertson <alanr [at] unix> wrote:
>> Lars Marowsky-Bree wrote:
>> > On 2007-03-06T20:19:54, Alan Robertson <alanr [at] unix> wrote:
>> >
>> >> I'm currently rewriting IPaddr* and their interface to findif.
>> Someone
>> >> really broke it in converting them to R2. Don't know why no one has
>> >> complained about them before.
>> >
>> > What's broken? Any critical issues?
>>
>> The parsing of options only works if you always specify the options in a
>> sort of undocumented hierarchy order. In R1, this might have existed,
>> but it was more obvious.
>>
>> And, in the process of trying but failing to fix this, the parsing in
>> findif was made more complicated (and incorrect).
>>
>> Describing exactly what the broken code will do in various circumstances
>> is hard - but trust me it's broken.
>>
>> A simple example:
>> If I specify an IP address and an interface ONLY, it won't work - even
>> though findif is designed to work nicely in that case.
>
> i saw your change (a nice improvement)...

Thank you! I'd thought about doing it before, but I was in the middle
of a release when I discovered it, and kind of forgot about it...

> would it be a good idea to
> pass those values in as options (ie. -b bcast, -m mask, -n nic)?
>
> that way its still flexible, but also usable from the command-line...

You can always put them on the command line -- ahead of the command
name, which is what I did to test it. I confess I wasn't sufficiently
motivated to do what you suggested - but I wouldn't be against it.

The nice thing about not putting this in some 'bin' directory somewhere
is that I don't feel obligated to make it easy for users to use, nor to
keep the interface the same :-D. Not that I'm against either - but I
have bigger fish to fry in my life...


--
Alan Robertson <alanr [at] unix>

"Openness is the foundation and preservative of friendship... Let me
claim from you at all times your undisguised opinions." - William
Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.