All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz at gmail.com>
To: ell at lists.01.org
Subject: Re: [PATCH 1/4] rtnl: Add l_rtnl_route_set_gateway
Date: Mon, 03 Jan 2022 12:37:59 -0600	[thread overview]
Message-ID: <492f1eb9-7785-55b2-2479-3c2b88c7b48d@gmail.com> (raw)
In-Reply-To: 20220103141830.311011-1-andrew.zaborowski@intel.com

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

Hi Andrew,

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?

>   LIB_EXPORT uint32_t l_rtnl_route_get_lifetime(const struct l_rtnl_route *rt)
>   {
>   	if (unlikely(!rt))

Regards,
-Denis

             reply	other threads:[~2022-01-03 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 18:37 Denis Kenzior [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-05 14:20 [PATCH 1/4] rtnl: Add l_rtnl_route_set_gateway Andrew Zaborowski
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=492f1eb9-7785-55b2-2479-3c2b88c7b48d@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.