]> git.ipfire.org Git - thirdparty/iproute2.git/commit
iplink_bond: fix parameter value matching
authorMichal Kubeček <mkubecek@suse.cz>
Thu, 13 Feb 2014 16:31:59 +0000 (17:31 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 17 Feb 2014 18:58:56 +0000 (10:58 -0800)
commitf7a45e09555145378bdcdb5d074472ae716803ca
tree9b837bc0e8966cc5a3027973b351c5de765b5b4a
parent4806867a6cc2950293229e66efe88061323ca0cf
iplink_bond: fix parameter value matching

Lookup function get_index() compares argument with table entries
only up to the length of the table entry so that if an entry
with lower index is a substring of a later one, earlier entry is
used even if the argument is equal to the other. For example,

  ip link set bond0 type bond xmit_hash_policy layer2+3

sets xmit_hash_policy to 0 (layer2) as this is found before
"layer2+3" can be checked.

Use strcmp() to compare whole strings instead.

v2: look for an exact match only

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
ip/iplink_bond.c