All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: allow routes to be configured with expire values
@ 2015-12-08 14:37 Xin Long
  2015-12-09  3:56 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Xin Long @ 2015-12-08 14:37 UTC (permalink / raw)
  To: network dev; +Cc: davem, Hannes Frederic Sowa

Add the support for adding expire value to routes,  requested by
Tom Gundersen <teg@jklm.no> for systemd-networkd, and NetworkManager
wants it too.

add it by using the field rta_expires of rta_cacheinfo

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/route.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c83b6a5..7815bc0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2709,6 +2709,7 @@ static const struct nla_policy rtm_ipv6_policy[RTA_MAX+1] = {
 	[RTA_PREF]              = { .type = NLA_U8 },
 	[RTA_ENCAP_TYPE]	= { .type = NLA_U16 },
 	[RTA_ENCAP]		= { .type = NLA_NESTED },
+	[RTA_CACHEINFO]		= { .len = sizeof(struct rta_cacheinfo) },
 };
 
 static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
@@ -2809,6 +2810,16 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (tb[RTA_ENCAP_TYPE])
 		cfg->fc_encap_type = nla_get_u16(tb[RTA_ENCAP_TYPE]);
 
+	if (tb[RTA_CACHEINFO]) {
+		struct rta_cacheinfo *ci = nla_data(tb[RTA_CACHEINFO]);
+		unsigned long timeout = addrconf_timeout_fixup(ci->rta_expires, HZ);
+
+		if (addrconf_finite_timeout(timeout)) {
+			cfg->fc_expires = jiffies_to_clock_t(timeout * HZ);
+			cfg->fc_flags |= RTF_EXPIRES;
+		}
+	}
+
 	err = 0;
 errout:
 	return err;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ipv6: allow routes to be configured with expire values
  2015-12-08 14:37 [PATCH net-next] ipv6: allow routes to be configured with expire values Xin Long
@ 2015-12-09  3:56 ` David Miller
  2015-12-09 11:50   ` Xin Long
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2015-12-09  3:56 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, hannes

From: Xin Long <lucien.xin@gmail.com>
Date: Tue,  8 Dec 2015 22:37:44 +0800

> Add the support for adding expire value to routes,  requested by
> Tom Gundersen <teg@jklm.no> for systemd-networkd, and NetworkManager
> wants it too.
> 
> add it by using the field rta_expires of rta_cacheinfo
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Fix your outgoing patch emails, the From: field doesn't have your
full name in it so the commit AUTHOR fields look terrible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ipv6: allow routes to be configured with expire values
  2015-12-09  3:56 ` David Miller
@ 2015-12-09 11:50   ` Xin Long
  0 siblings, 0 replies; 3+ messages in thread
From: Xin Long @ 2015-12-09 11:50 UTC (permalink / raw)
  To: David Miller, jk; +Cc: network dev, Hannes Frederic Sowa

On Wed, Dec 9, 2015 at 11:56 AM, David Miller <davem@davemloft.net> wrote:
> From: Xin Long <lucien.xin@gmail.com>
> Date: Tue,  8 Dec 2015 22:37:44 +0800
>
>> Add the support for adding expire value to routes,  requested by
>> Tom Gundersen <teg@jklm.no> for systemd-networkd, and NetworkManager
>> wants it too.
>>
>> add it by using the field rta_expires of rta_cacheinfo
>>
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>
> Fix your outgoing patch emails, the From: field doesn't have your
> full name in it so the commit AUTHOR fields look terrible.

it's not the from field issue, it's the incorrect  full name of my account in
patchwork, I have send mail to Jeremy Kerr to help correct it.

after he do it, i will report, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-09 11:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08 14:37 [PATCH net-next] ipv6: allow routes to be configured with expire values Xin Long
2015-12-09  3:56 ` David Miller
2015-12-09 11:50   ` Xin Long

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.