* [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf
@ 2015-07-07 17:56 Andy Gospodarek
2015-07-08 9:43 ` Nicolas Dichtel
2015-07-09 6:35 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Andy Gospodarek @ 2015-07-07 17:56 UTC (permalink / raw)
To: netdev; +Cc: nicolas.dichtel, Andy Gospodarek
This kernel patch exports the value of the new
ignore_routes_with_linkdown via netconf.
v2: changes to notify userspace via netlink when sysctl values change
and proposed for 'net' since this could be considered a bugfix
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
I realize two of these changes result in lines >80 chars, but this is to
keep the coding-style used by the surrounding code.
There are multiple ways to resolve this, but one would be to shorten the
defines used for this feature as "IGNORE_ROUTES_WITH_LINKDOWN" is a
mouthful. I would propose dropping "_WITH_" from all the defines and
have only "IGNORE_ROUTES_LINKDOWN" everywhere. Doing this now in 'net'
would be ideal before a release happens and it cannot be changed.
include/uapi/linux/netconf.h | 1 +
net/ipv4/devinet.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
index 669a1f0..23cbd34 100644
--- a/include/uapi/linux/netconf.h
+++ b/include/uapi/linux/netconf.h
@@ -15,6 +15,7 @@ enum {
NETCONFA_RP_FILTER,
NETCONFA_MC_FORWARDING,
NETCONFA_PROXY_NEIGH,
+ NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
__NETCONFA_MAX
};
#define NETCONFA_MAX (__NETCONFA_MAX - 1)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 7498716..e813196 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1740,6 +1740,8 @@ static int inet_netconf_msgsize_devconf(int type)
size += nla_total_size(4);
if (type == -1 || type == NETCONFA_PROXY_NEIGH)
size += nla_total_size(4);
+ if (type == -1 || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN)
+ size += nla_total_size(4);
return size;
}
@@ -1780,6 +1782,10 @@ static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
nla_put_s32(skb, NETCONFA_PROXY_NEIGH,
IPV4_DEVCONF(*devconf, PROXY_ARP)) < 0)
goto nla_put_failure;
+ if ((type == -1 || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) &&
+ nla_put_s32(skb, NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
+ IPV4_DEVCONF(*devconf, IGNORE_ROUTES_WITH_LINKDOWN)) < 0)
+ goto nla_put_failure;
nlmsg_end(skb, nlh);
return 0;
@@ -1819,6 +1825,7 @@ static const struct nla_policy devconf_ipv4_policy[NETCONFA_MAX+1] = {
[NETCONFA_FORWARDING] = { .len = sizeof(int) },
[NETCONFA_RP_FILTER] = { .len = sizeof(int) },
[NETCONFA_PROXY_NEIGH] = { .len = sizeof(int) },
+ [NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN] = { .len = sizeof(int) },
};
static int inet_netconf_get_devconf(struct sk_buff *in_skb,
@@ -2048,6 +2055,12 @@ static int devinet_conf_proc(struct ctl_table *ctl, int write,
inet_netconf_notify_devconf(net, NETCONFA_PROXY_NEIGH,
ifindex, cnf);
}
+ if (i == IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN - 1 &&
+ new_value != old_value) {
+ ifindex = devinet_conf_ifindex(net, cnf);
+ inet_netconf_notify_devconf(net, NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
+ ifindex, cnf);
+ }
}
return ret;
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf
2015-07-07 17:56 [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf Andy Gospodarek
@ 2015-07-08 9:43 ` Nicolas Dichtel
2015-07-08 12:42 ` Andy Gospodarek
2015-07-09 6:35 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Dichtel @ 2015-07-08 9:43 UTC (permalink / raw)
To: Andy Gospodarek, netdev
Le 07/07/2015 19:56, Andy Gospodarek a écrit :
> This kernel patch exports the value of the new
> ignore_routes_with_linkdown via netconf.
>
> v2: changes to notify userspace via netlink when sysctl values change
> and proposed for 'net' since this could be considered a bugfix
Hmm, commit title contains net-next, not net.
>
> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
> Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
> I realize two of these changes result in lines >80 chars, but this is to
> keep the coding-style used by the surrounding code.
>
> There are multiple ways to resolve this, but one would be to shorten the
> defines used for this feature as "IGNORE_ROUTES_WITH_LINKDOWN" is a
> mouthful. I would propose dropping "_WITH_" from all the defines and
> have only "IGNORE_ROUTES_LINKDOWN" everywhere. Doing this now in 'net'
Yes. Or even shorter: IGNORE_NH_LINKDOWN?
> would be ideal before a release happens and it cannot be changed.
Yes.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf
2015-07-08 9:43 ` Nicolas Dichtel
@ 2015-07-08 12:42 ` Andy Gospodarek
0 siblings, 0 replies; 4+ messages in thread
From: Andy Gospodarek @ 2015-07-08 12:42 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: netdev
On Wed, Jul 08, 2015 at 11:43:50AM +0200, Nicolas Dichtel wrote:
> Le 07/07/2015 19:56, Andy Gospodarek a écrit :
> >This kernel patch exports the value of the new
> >ignore_routes_with_linkdown via netconf.
> >
> >v2: changes to notify userspace via netlink when sysctl values change
> >and proposed for 'net' since this could be considered a bugfix
> Hmm, commit title contains net-next, not net.
I went back and forth about where it should land.
Dave, any chance we might be able to add this to 'net' rather than
saving it for 4.3? It isn't a bug-fix per se, but does help make this
feature complete.
>
> >
> >Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
> >Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
> >---
> >I realize two of these changes result in lines >80 chars, but this is to
> >keep the coding-style used by the surrounding code.
> >
> >There are multiple ways to resolve this, but one would be to shorten the
> >defines used for this feature as "IGNORE_ROUTES_WITH_LINKDOWN" is a
> >mouthful. I would propose dropping "_WITH_" from all the defines and
> >have only "IGNORE_ROUTES_LINKDOWN" everywhere. Doing this now in 'net'
> Yes. Or even shorter: IGNORE_NH_LINKDOWN?
That might be a more appropriate name considering multipath/ecmp cases.
>
> >would be ideal before a release happens and it cannot be changed.
> Yes.
I'll cook up an update based on this patch and see what it looks like.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf
2015-07-07 17:56 [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf Andy Gospodarek
2015-07-08 9:43 ` Nicolas Dichtel
@ 2015-07-09 6:35 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2015-07-09 6:35 UTC (permalink / raw)
To: gospo; +Cc: netdev, nicolas.dichtel
From: Andy Gospodarek <gospo@cumulusnetworks.com>
Date: Tue, 7 Jul 2015 13:56:57 -0400
> This kernel patch exports the value of the new
> ignore_routes_with_linkdown via netconf.
>
> v2: changes to notify userspace via netlink when sysctl values change
> and proposed for 'net' since this could be considered a bugfix
>
> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
> Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Applied to net, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-09 6:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 17:56 [PATCH net-next v2] ipv4: add support for linkdown sysctl to netconf Andy Gospodarek
2015-07-08 9:43 ` Nicolas Dichtel
2015-07-08 12:42 ` Andy Gospodarek
2015-07-09 6:35 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).