* [PATCH] bridge-utils:close socket before exit
@ 2022-08-03 8:20 sunsuwan
2022-08-03 15:25 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: sunsuwan @ 2022-08-03 8:20 UTC (permalink / raw)
To: netdev; +Cc: sunsuwan3, chenzhen126, liaichun, yanan, roopa, nikolay, davem,
kuba
brctl should close socket before exit.
Signed-off-by: sunsuwan <sunsuwan3@huawei.com>
---
brctl/brctl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/brctl/brctl.c b/brctl/brctl.c
index 8855234..dd6c347 100644
--- a/brctl/brctl.c
+++ b/brctl/brctl.c
@@ -37,7 +37,7 @@ static void help()
int main(int argc, char *const* argv)
{
const struct command *cmd;
- int f;
+ int f, ret;
static const struct option options[] = {
{ .name = "help", .val = 'h' },
{ .name = "version", .val = 'V' },
@@ -70,16 +70,20 @@ int main(int argc, char *const* argv)
argv += optind;
if ((cmd = command_lookup(*argv)) == NULL) {
fprintf(stderr, "never heard of command [%s]\n", *argv);
+ br_shutdown();
goto help;
}
if (argc < cmd->nargs + 1) {
printf("Incorrect number of arguments for command\n");
printf("Usage: brctl %s %s\n", cmd->name, cmd->help);
+ br_shutdown();
return 1;
}
- return cmd->func(argc, argv);
+ ret = cmd->func(argc, argv);
+ br_shutdown();
+ return ret;
help:
help();
--
2.30.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bridge-utils:close socket before exit
2022-08-03 8:20 [PATCH] bridge-utils:close socket before exit sunsuwan
@ 2022-08-03 15:25 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2022-08-03 15:25 UTC (permalink / raw)
To: sunsuwan
Cc: netdev, chenzhen126, liaichun, yanan, roopa, nikolay, davem, kuba
On Wed, 3 Aug 2022 16:20:51 +0800
sunsuwan <sunsuwan3@huawei.com> wrote:
> brctl should close socket before exit.
>
> Signed-off-by: sunsuwan <sunsuwan3@huawei.com>
Why bother? The file descriptor is closed automatically on process exit.
At this point bridge-utils is in long term hibernation mode.
It has been replaced by bridge command in iproute2.
Don't want to do any changes or releases unless there is a very high priority
bug that must be fixed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-03 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-03 8:20 [PATCH] bridge-utils:close socket before exit sunsuwan
2022-08-03 15:25 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).