Thu, Jan 05, 2017 at 02:12:22PM CET, paganelb9(a)box.az wrote:
Drop these useless whitespace.
Fix problem with retrieving state item value per interface name,
when some member interface names partially match to one another.
Like `eth1` and `eth11`, or `eth1` with `eth10`
You are missing Signed-off line.
For proper patch submission, please follow "SubmittingPatches" file
which resides in libteam git repository.
>---
> teamd/teamd_state.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>--
>
>diff --git a/teamd/teamd_state.c b/teamd/teamd_state.c
>index ab64db9..b92ac17 100644
>--- a/teamd/teamd_state.c
>+++ b/teamd/teamd_state.c
>@@ -318,8 +318,9 @@ static int __find_by_item_path(struct teamd_state_val_item
**p_item,
> subpath = ifname_end + 1;
>
> teamd_for_each_tdport(cur_tdport, ctx) {
>+ size_t curname_len = strlen(cur_tdport->ifname);
> if (!strncmp(cur_tdport->ifname, ifname_start,
>- ifname_len)) {
>+ ((ifname_len>curname_len)?ifname_len:curname_len))) {
Please do it the way Marcelo suggested, and send V2.
Thanks!
> tdport = cur_tdport;
> break;
> }