--- libteam/ifinfo.c | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 484ac1b..0ad24b4 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c @@ -333,23 +333,46 @@ int get_ifinfo_list(struct team_handle *th) }; int ret;
- ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP, - &rt_hdr, sizeof(rt_hdr)); - if (ret < 0) - return -nl2syserr(ret); - orig_cb = nl_socket_get_cb(th->nl_cli.sock); - cb = nl_cb_clone(orig_cb); - nl_cb_put(orig_cb); - if (!cb) - return -ENOMEM; - - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th); - - ret = nl_recvmsgs(th->nl_cli.sock, cb); - nl_cb_put(cb); + int retry = 1; + while (retry) + { + retry = 0; + ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP, + &rt_hdr, sizeof(rt_hdr)); + if (ret < 0) + { + err(th, "get_ifinfo_list: nl_send_simple failed: ret = %d", ret); + return -nl2syserr(ret); + } + orig_cb = nl_socket_get_cb(th->nl_cli.sock); + cb = nl_cb_clone(orig_cb); + nl_cb_put(orig_cb); + if (!cb) + { + err(th, "get_ifinfo_list: nl_cb_clone failed"); + return -ENOMEM; + } + + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th); + + ret = nl_recvmsgs(th->nl_cli.sock, cb); + nl_cb_put(cb); + if (ret < 0) + { + err(th, "get_ifinfo_list: nl_recvmsgs failed: ret = %d", ret); + if (ret != -NLE_DUMP_INTR) + { + return -nl2syserr(ret); + } + retry = 1; + } + } + ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); if (ret < 0) - return -nl2syserr(ret); - return check_call_change_handlers(th, TEAM_IFINFO_CHANGE); + { + err(th, "get_ifinfo_list: check_call_change_handers failed: ret = %d", ret); + } + return ret; }
int ifinfo_list_init(struct team_handle *th)
Please add some description (as I already asked)
Wed, Nov 25, 2015 at 05:49:49PM CET, ctcard1@gmail.com wrote:
libteam/ifinfo.c | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 484ac1b..0ad24b4 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c @@ -333,23 +333,46 @@ int get_ifinfo_list(struct team_handle *th) }; int ret;
- ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
- if (ret < 0)
return -nl2syserr(ret);
- orig_cb = nl_socket_get_cb(th->nl_cli.sock);
- cb = nl_cb_clone(orig_cb);
- nl_cb_put(orig_cb);
- if (!cb)
return -ENOMEM;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
- ret = nl_recvmsgs(th->nl_cli.sock, cb);
- nl_cb_put(cb);
- int retry = 1;
Empty line is missing.
- while (retry)
- {
Please be consistent with the rest of the code (as I already asked)
"{" should be at the end of the line.
retry = 0;
ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
Line should start right after "(" (see the rest of the code).
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_send_simple failed: ret = %d", ret);
return -nl2syserr(ret);
}
orig_cb = nl_socket_get_cb(th->nl_cli.sock);
cb = nl_cb_clone(orig_cb);
nl_cb_put(orig_cb);
if (!cb)
{
err(th, "get_ifinfo_list: nl_cb_clone failed");
return -ENOMEM;
}
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
ret = nl_recvmsgs(th->nl_cli.sock, cb);
nl_cb_put(cb);
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_recvmsgs failed: ret = %d", ret);
No need to print "ret = %d" here. "ret" is properly propagated to the caller.
if (ret != -NLE_DUMP_INTR)
{
return -nl2syserr(ret);
}
No braces needed for one-line statement.
retry = 1;
}
- }
- ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); if (ret < 0)
return -nl2syserr(ret);
- return check_call_change_handlers(th, TEAM_IFINFO_CHANGE);
- {
err(th, "get_ifinfo_list: check_call_change_handers failed: ret = %d", ret);
- }
- return ret;
}
int ifinfo_list_init(struct team_handle *th)
2.4.3 _______________________________________________ libteam mailing list libteam@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/libteam@lists.fedorahosted.org
Please add some description (as I already asked)
where do you want the description?
Wed, Nov 25, 2015 at 05:49:49PM CET, ctcard1@gmail.com wrote:
libteam/ifinfo.c | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 484ac1b..0ad24b4 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c @@ -333,23 +333,46 @@ int get_ifinfo_list(struct team_handle *th) }; int ret;
- ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
- if (ret < 0)
return -nl2syserr(ret);
- orig_cb = nl_socket_get_cb(th->nl_cli.sock);
- cb = nl_cb_clone(orig_cb);
- nl_cb_put(orig_cb);
- if (!cb)
return -ENOMEM;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
- ret = nl_recvmsgs(th->nl_cli.sock, cb);
- nl_cb_put(cb);
- int retry = 1;
Empty line is missing.
- while (retry)
- {
Please be consistent with the rest of the code (as I already asked)
"{" should be at the end of the line.
retry = 0;
ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
Line should start right after "(" (see the rest of the code).
Ah I see - you're using tabstop = 8
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_send_simple failed: ret = %d", ret);
return -nl2syserr(ret);
}
orig_cb = nl_socket_get_cb(th->nl_cli.sock);
cb = nl_cb_clone(orig_cb);
nl_cb_put(orig_cb);
if (!cb)
{
err(th, "get_ifinfo_list: nl_cb_clone failed");
return -ENOMEM;
}
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
ret = nl_recvmsgs(th->nl_cli.sock, cb);
nl_cb_put(cb);
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_recvmsgs failed: ret = %d", ret);
No need to print "ret = %d" here. "ret" is properly propagated to the caller.
I'm pretty sure that was the line that showed me what the problem was (NLE_DUMP_INTR = -33 is not handled by nl2syserr)
if (ret != -NLE_DUMP_INTR)
{
return -nl2syserr(ret);
}
No braces needed for one-line statement.
retry = 1;
}
- }
- ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); if (ret < 0)
return -nl2syserr(ret);
- return check_call_change_handlers(th, TEAM_IFINFO_CHANGE);
- {
err(th, "get_ifinfo_list: check_call_change_handers failed: ret = %d", ret);
- }
- return ret;
}
int ifinfo_list_init(struct team_handle *th)
2.4.3
I'll send an updated patch when I understand where you want to see the description.
Chris
Wed, Nov 25, 2015 at 06:31:55PM CET, ctcard@hotmail.com wrote:
Please add some description (as I already asked)
where do you want the description?
Above the non-existent signed off (I need signed off as well).
Can you please just look in git log to see how to do this?
Thanks.
Wed, Nov 25, 2015 at 05:49:49PM CET, ctcard1@gmail.com wrote:
libteam/ifinfo.c | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 484ac1b..0ad24b4 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c @@ -333,23 +333,46 @@ int get_ifinfo_list(struct team_handle *th) }; int ret;
- ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
- if (ret < 0)
return -nl2syserr(ret);
- orig_cb = nl_socket_get_cb(th->nl_cli.sock);
- cb = nl_cb_clone(orig_cb);
- nl_cb_put(orig_cb);
- if (!cb)
return -ENOMEM;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
- ret = nl_recvmsgs(th->nl_cli.sock, cb);
- nl_cb_put(cb);
- int retry = 1;
Empty line is missing.
- while (retry)
- {
Please be consistent with the rest of the code (as I already asked)
"{" should be at the end of the line.
retry = 0;
ret = nl_send_simple(th->nl_cli.sock, RTM_GETLINK, NLM_F_DUMP,
&rt_hdr, sizeof(rt_hdr));
Line should start right after "(" (see the rest of the code).
Ah I see - you're using tabstop = 8
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_send_simple failed: ret = %d", ret);
return -nl2syserr(ret);
}
orig_cb = nl_socket_get_cb(th->nl_cli.sock);
cb = nl_cb_clone(orig_cb);
nl_cb_put(orig_cb);
if (!cb)
{
err(th, "get_ifinfo_list: nl_cb_clone failed");
return -ENOMEM;
}
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, th);
ret = nl_recvmsgs(th->nl_cli.sock, cb);
nl_cb_put(cb);
if (ret < 0)
{
err(th, "get_ifinfo_list: nl_recvmsgs failed: ret = %d", ret);
No need to print "ret = %d" here. "ret" is properly propagated to the caller.
I'm pretty sure that was the line that showed me what the problem was (NLE_DUMP_INTR = -33 is not handled by nl2syserr)
Now it is, so we don;t have to worry.
if (ret != -NLE_DUMP_INTR)
{
return -nl2syserr(ret);
}
No braces needed for one-line statement.
retry = 1;
}
- }
- ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); if (ret < 0)
return -nl2syserr(ret);
- return check_call_change_handlers(th, TEAM_IFINFO_CHANGE);
- {
err(th, "get_ifinfo_list: check_call_change_handers failed: ret = %d", ret);
- }
- return ret;
}
int ifinfo_list_init(struct team_handle *th)
2.4.3
I'll send an updated patch when I understand where you want to see the description.
Chris
On Wed, Nov 25, 2015 at 06:59:11PM +0100, Jiri Pirko wrote:
Wed, Nov 25, 2015 at 06:31:55PM CET, ctcard@hotmail.com wrote:
Please add some description (as I already asked)
where do you want the description?
Above the non-existent signed off (I need signed off as well).
Can you please just look in git log to see how to do this?
Thanks.
The patch has a general format:
Subject: <here you put a very brief description of what the does> Body:
Here you explain the problem and how the patch fixes it followed by your signature called signed-off-by.
We keep a file called SubmittingPatches in the repo. You also can find good instructions here: http://www.x.org/wiki/Development/Documentation/SubmittingPatches/
Also here: https://www.kernel.org/doc/Documentation/SubmittingPatches looks at section '11) Sign your work'
Don't use git commit -m "commit message log". Instead, run git commit and use the first line as the email's Subject, then leave an empty line, then start the email's body text.
fbl
libteam@lists.fedorahosted.org