[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 4/4] bb_lookup_port(): return 0 if lookup failed
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2021-09-10 8:11:56
Message-ID: CAK1hOcPBoEvBT=G-5nejChS3wbZwsoBBdVWDqX1Qo5Ea0CoCLg () mail ! gmail ! com
[Download RAW message or body]

On Fri, Sep 10, 2021 at 12:25 AM Sergey Ponomarev <stokito@gmail.com> wrote:
> the bb_lookup_port() is a library function and I'm not sure if it's fine to die.

It's ok to die. We can review all callers. So far I don't see which caller
needs to stay alive aftes this error.

> There are already some error messages like:
>                o_lport = bb_lookup_port(str_p, o_udpmode ? "udp" : "tcp");
>                 if (!o_lport)
>                         bb_error_msg_and_die("bad local port '%s'", str_p);

Yes. And I propose to consolidate them to one location.

> Also passing a zero port into xhost2sockaddr() will also make process die

Not really. I just tried "tftp 127.0.0.1:0 -pl README"
and it "works" in the sense that it tries to sendto()
to 127.0.0.1:0 (which makes kernel unhappy).
IOW: xhost2sockaddr("127.0.0.1:0") does not terminate.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic