All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski at intel.com>
To: ell at lists.01.org
Subject: Re: [PATCH 1/4] rtnl: Add l_rtnl_route_set_gateway
Date: Wed, 05 Jan 2022 15:20:58 +0100	[thread overview]
Message-ID: <CAOq732J-4g7vb2F5xt5pMpkB7pUPM8xkX6oomGZ31PMJd7LX-Q@mail.gmail.com> (raw)
In-Reply-To: 492f1eb9-7785-55b2-2479-3c2b88c7b48d@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

Hi Denis,

On Mon, 3 Jan 2022 at 19:54, Denis Kenzior <denkenz(a)gmail.com> wrote:
> On 1/3/22 08:18, Andrew Zaborowski wrote:
> > Allow creating prefix routes for off-link prefixes, i.e. ones that
> > should be routed through a gateway.
> > ---
> >   ell/ell.sym |  1 +
> >   ell/rtnl.c  | 16 ++++++++++++++++
> >   ell/rtnl.h  |  1 +
> >   3 files changed, 18 insertions(+)
> >
>
> <snip>
>
> >
> > +LIB_EXPORT bool l_rtnl_route_set_gateway(struct l_rtnl_route *rt,
> > +                                             const char *address)
> > +{
> > +     if (unlikely(!rt))
> > +             return false;
> > +
> > +     switch (rt->family) {
> > +     case AF_INET:
> > +             return inet_pton(AF_INET, address, &rt->gw.in_addr) == 1;
> > +     case AF_INET6:
> > +             return inet_pton(AF_INET6, address, &rt->gw.in6_addr) == 1;
> > +     default:
> > +             return  false;
> > +     }
> > +}
> > +
>
> Since we already have l_rtnl_route_new_gateway, would this make more sense as a
> dedicated constructor? Something like l_rtnl_route_new_static?

Ok.

Best regards

             reply	other threads:[~2022-01-05 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 14:20 Andrew Zaborowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-03 18:37 [PATCH 1/4] rtnl: Add l_rtnl_route_set_gateway Denis Kenzior
2022-01-03 14:18 Andrew Zaborowski

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=CAOq732J-4g7vb2F5xt5pMpkB7pUPM8xkX6oomGZ31PMJd7LX-Q@mail.gmail.com \
    --to=unknown@example.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.