]> git.proxmox.com Git - pve-manager.git/commit
bridgevlanport: replace sed pipe with substitution
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 10 Aug 2015 09:48:52 +0000 (11:48 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 11 Aug 2015 08:26:35 +0000 (10:26 +0200)
commitc182eb589124804bcaab9abc930986481b73f860
treee89f2f858a78dc464396e56bffad9771335b38d5
parenteafe236e8abea65c7f53e1aadf5fd650024d5525
bridgevlanport: replace sed pipe with substitution

The previous code stripped *all* combinations of zero or
more letters and digits followed by a dot of an interface
name to retrieve the VLANID. At the same time the supposedly
opposite code for IF_VLAN_RAW_DEVICE only actually extracts
the part up to the *first* dot. Thus an interface named
'a.b.0' would have a VLANID of 0 and a raw device name of
just 'a'.
I also don't see a reason to limit the removed portions to
alphanumeric characters. I.e. an interface named tap-test.0
would result in a VLANID of 'tap-0' and an
IF_VLAN_RAW_DEVICE of 'test'.

A simple shell substitution seems to do a much better job
and is more efficient than forking out two processes with a
pipe.
bridgevlanport