Restore vzgetnetdev incompatibility with mawk

After upgrading to vzctl-3.0.24 my VEs on a Debian Lenny HN lost network
connectivity. The HN didn't reply to ARP requests for its VEs' IPs.

The logs didn't show any errors but "vzctl stop ve" reported:

	vps-net_del WARNING: Device list is empty

Debian - Lenny as well as Sid - installs mawk instead of gawk by default
(debootstrap etc.). mawk doesn't support word boundary archors recently
introduced in the interface matching regexes in vps-functions/vzgetnetdev().
Obviously vps-net_add doesn't find any interfaces.

Incompatible patch is commit 0104badd.

Maybe we could revert to the old regexes from 3.0.23 but these could fail in
the future, mistaking "SUPER" for "UP" or something as you pointed out.

This patch is a bit ugly (\< \> replaced with [^A-Z_]) but it
is more robust than 3.0.23 yet compatible.

http://bugzilla.openvz.org/show_bug.cgi?id=1506
http://bugzilla.openvz.org/show_bug.cgi?id=1588
http://bugzilla.openvz.org/show_bug.cgi?id=1602

Reported-by: Dietmar Maurer <dietmar@maurer-it.com>
Reported-by: Bernd Rothert <bro@mzv.net>
Signed-off-by: Bernd Rothert <bro@mzv.net>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed