From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Konstantin Osipov <kostja@tarantool.org> Subject: [tarantool-patches] Re: [PATCH 1/4] swim: move sockaddr_in checkers to swim_proto.h Date: Thu, 18 Apr 2019 18:24:18 +0300 [thread overview] Message-ID: <5554cf76-e1e1-6bde-1aaf-2ee856752523@tarantool.org> (raw) In-Reply-To: <20190418151641.GC13022@chai> On 18/04/2019 18:16, Konstantin Osipov wrote: > * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/04/18 17:11]: >> Sorry, accidentally broke a test. The fix is >> force pushed: >> >> ====================================================== >> swim_inaddr_is_empty(const struct sockaddr_in *addr) >> { >> - return addr->sin_port == 0 && addr->sin_addr.s_addr == 0; >> + return addr->sin_port == 0 || addr->sin_addr.s_addr == 0; >> } > > This means you haven't paused to explain or test or add a > pre-condition check to the setter function. > Why either of the components can be empty, not both? Shouldn't > you check for such broken addresses when setting them, to not > allow setting them at all? > > The patch is OK to push obviously, just food for thought. It's mainly against malicious and bad-formatter packets. Since the protocol will be public, it can happen that custom drivers will send bad packets. > > -- > Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 > http://tarantool.io - www.twitter.com/kostja_osipov >
next prev parent reply other threads:[~2019-04-18 15:24 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-17 19:56 [tarantool-patches] [PATCH 0/4] swim suspicion preparation Vladislav Shpilevoy 2019-04-17 19:56 ` [tarantool-patches] [PATCH 1/4] swim: move sockaddr_in checkers to swim_proto.h Vladislav Shpilevoy 2019-04-18 11:35 ` [tarantool-patches] " Vladislav Shpilevoy 2019-04-18 15:16 ` Konstantin Osipov 2019-04-18 15:24 ` Vladislav Shpilevoy [this message] 2019-04-18 16:02 ` Konstantin Osipov 2019-04-18 18:34 ` Vladislav Shpilevoy 2019-04-18 15:15 ` Konstantin Osipov 2019-04-17 19:56 ` [tarantool-patches] [PATCH 2/4] swim: extract binary ip/port into a separate struct Vladislav Shpilevoy 2019-04-18 15:17 ` [tarantool-patches] " Konstantin Osipov 2019-04-18 18:34 ` Vladislav Shpilevoy 2019-04-17 19:56 ` [tarantool-patches] [PATCH 3/4] swim: fix a bug with invalidation of round msg in fly Vladislav Shpilevoy 2019-04-18 15:19 ` [tarantool-patches] " Konstantin Osipov 2019-04-18 18:34 ` Vladislav Shpilevoy 2019-04-17 19:56 ` [tarantool-patches] [PATCH 4/4] swim: do not rebuild packet meta multiple times Vladislav Shpilevoy 2019-04-18 17:23 ` [tarantool-patches] " Konstantin Osipov 2019-04-18 18:34 ` Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=5554cf76-e1e1-6bde-1aaf-2ee856752523@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH 1/4] swim: move sockaddr_in checkers to swim_proto.h' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox