* [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY
@ 2013-12-18 6:35 Stephen Hemminger
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Stephen Hemminger @ 2013-12-18 6:35 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Use same field for both IPv4 (proxy_arp) and IPv6 (proxy_ndp)
so fix it before API is set to be a common name
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
include/uapi/linux/netconf.h | 2 +-
net/ipv4/devinet.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
--- a/include/uapi/linux/netconf.h 2013-12-17 22:30:00.000000000 -0800
+++ b/include/uapi/linux/netconf.h 2013-12-17 22:31:07.973419694 -0800
@@ -14,7 +14,7 @@ enum {
NETCONFA_FORWARDING,
NETCONFA_RP_FILTER,
NETCONFA_MC_FORWARDING,
- NETCONFA_PROXY_ARP,
+ NETCONFA_PROXY_NEIGH,
__NETCONFA_MAX
};
#define NETCONFA_MAX (__NETCONFA_MAX - 1)
--- a/net/ipv4/devinet.c 2013-12-17 22:30:00.000000000 -0800
+++ b/net/ipv4/devinet.c 2013-12-17 22:31:07.973419694 -0800
@@ -1696,7 +1696,7 @@ static int inet_netconf_msgsize_devconf(
size += nla_total_size(4);
if (type == -1 || type == NETCONFA_MC_FORWARDING)
size += nla_total_size(4);
- if (type == -1 || type == NETCONFA_PROXY_ARP)
+ if (type == -1 || type == NETCONFA_PROXY_NEIGH)
size += nla_total_size(4);
return size;
@@ -1734,8 +1734,8 @@ static int inet_netconf_fill_devconf(str
nla_put_s32(skb, NETCONFA_MC_FORWARDING,
IPV4_DEVCONF(*devconf, MC_FORWARDING)) < 0)
goto nla_put_failure;
- if ((type == -1 || type == NETCONFA_PROXY_ARP) &&
- nla_put_s32(skb, NETCONFA_PROXY_ARP,
+ if ((type == -1 || type == NETCONFA_PROXY_NEIGH) &&
+ nla_put_s32(skb, NETCONFA_PROXY_NEIGH,
IPV4_DEVCONF(*devconf, PROXY_ARP)) < 0)
goto nla_put_failure;
@@ -1775,7 +1775,7 @@ static const struct nla_policy devconf_i
[NETCONFA_IFINDEX] = { .len = sizeof(int) },
[NETCONFA_FORWARDING] = { .len = sizeof(int) },
[NETCONFA_RP_FILTER] = { .len = sizeof(int) },
- [NETCONFA_PROXY_ARP] = { .len = sizeof(int) },
+ [NETCONFA_PROXY_NEIGH] = { .len = sizeof(int) },
};
static int inet_netconf_get_devconf(struct sk_buff *in_skb,
@@ -2002,7 +2002,7 @@ static int devinet_conf_proc(struct ctl_
if (i == IPV4_DEVCONF_PROXY_ARP - 1 &&
new_value != old_value) {
ifindex = devinet_conf_ifindex(net, cnf);
- inet_netconf_notify_devconf(net, NETCONFA_PROXY_ARP,
+ inet_netconf_notify_devconf(net, NETCONFA_PROXY_NEIGH,
ifindex, cnf);
}
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
@ 2013-12-18 6:37 ` Stephen Hemminger
2013-12-20 10:05 ` Nicolas Dichtel
2013-12-22 23:03 ` David Miller
2013-12-18 6:39 ` [PATCH iproute 3/3] iproute2: add proxy_neigh attribute Stephen Hemminger
` (3 subsequent siblings)
4 siblings, 2 replies; 9+ messages in thread
From: Stephen Hemminger @ 2013-12-18 6:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Need to be able to see changes to proxy NDP status on a per
interface basis via netlink (analog to proxy_arp).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/ipv6/addrconf.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
--- a/net/ipv6/addrconf.c 2013-12-16 10:53:01.394635074 -0800
+++ b/net/ipv6/addrconf.c 2013-12-16 11:24:50.937221182 -0800
@@ -442,6 +442,8 @@ static int inet6_netconf_msgsize_devconf
if (type == -1 || type == NETCONFA_MC_FORWARDING)
size += nla_total_size(4);
#endif
+ if (type == -1 || type == NETCONFA_PROXY_NEIGH)
+ size += nla_total_size(4);
return size;
}
@@ -475,6 +477,10 @@ static int inet6_netconf_fill_devconf(st
devconf->mc_forwarding) < 0)
goto nla_put_failure;
#endif
+ if ((type == -1 || type == NETCONFA_PROXY_NEIGH) &&
+ nla_put_s32(skb, NETCONFA_PROXY_NEIGH, devconf->proxy_ndp) < 0)
+ goto nla_put_failure;
+
return nlmsg_end(skb, nlh);
nla_put_failure:
@@ -509,6 +515,7 @@ errout:
static const struct nla_policy devconf_ipv6_policy[NETCONFA_MAX+1] = {
[NETCONFA_IFINDEX] = { .len = sizeof(int) },
[NETCONFA_FORWARDING] = { .len = sizeof(int) },
+ [NETCONFA_PROXY_NEIGH] = { .len = sizeof(int) },
};
static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
@@ -4728,6 +4735,46 @@ int addrconf_sysctl_disable(struct ctl_t
return ret;
}
+static
+int addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+ int *valp = ctl->data;
+ int ret;
+ int old, new;
+
+ old = *valp;
+ ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ new = *valp;
+
+ if (write && old != new) {
+ struct net *net = ctl->extra2;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (valp == &net->ipv6.devconf_dflt->proxy_ndp)
+ inet6_netconf_notify_devconf(net, NETCONFA_PROXY_NEIGH,
+ NETCONFA_IFINDEX_DEFAULT,
+ net->ipv6.devconf_dflt);
+ else if (valp == &net->ipv6.devconf_all->proxy_ndp)
+ inet6_netconf_notify_devconf(net, NETCONFA_PROXY_NEIGH,
+ NETCONFA_IFINDEX_ALL,
+ net->ipv6.devconf_all);
+ else {
+ struct inet6_dev *idev = ctl->extra1;
+
+ inet6_netconf_notify_devconf(net, NETCONFA_PROXY_NEIGH,
+ idev->dev->ifindex,
+ &idev->cnf);
+ }
+ rtnl_unlock();
+ }
+
+ return ret;
+}
+
+
static struct addrconf_sysctl_table
{
struct ctl_table_header *sysctl_header;
@@ -4914,7 +4961,7 @@ static struct addrconf_sysctl_table
.data = &ipv6_devconf.proxy_ndp,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec,
+ .proc_handler = addrconf_sysctl_proxy_ndp,
},
{
.procname = "accept_source_route",
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH iproute 3/3] iproute2: add proxy_neigh attribute
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
@ 2013-12-18 6:39 ` Stephen Hemminger
2013-12-18 17:06 ` [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Jamal Hadi Salim
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2013-12-18 6:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Report changes to proxy_arp/proxy_ndp attribute.
Patch assumes updated netconf.h from net-next (earlier patches).
---
ip/ipnetconf.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
index 9a77ecb..7353f59 100644
--- a/ip/ipnetconf.c
+++ b/ip/ipnetconf.c
@@ -114,6 +114,10 @@ int print_netconf(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf(fp, "mc_forwarding %d ",
*(int *)RTA_DATA(tb[NETCONFA_MC_FORWARDING]));
+ if (tb[NETCONFA_PROXY_NEIGH])
+ fprintf(fp, "proxy_neigh %s ",
+ *(int *)RTA_DATA(tb[NETCONFA_PROXY_NEIGH])?"on":"off");
+
fprintf(fp, "\n");
fflush(fp);
return 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
2013-12-18 6:39 ` [PATCH iproute 3/3] iproute2: add proxy_neigh attribute Stephen Hemminger
@ 2013-12-18 17:06 ` Jamal Hadi Salim
2013-12-18 18:06 ` Stephen Hemminger
2013-12-20 10:02 ` Nicolas Dichtel
2013-12-22 23:03 ` David Miller
4 siblings, 1 reply; 9+ messages in thread
From: Jamal Hadi Salim @ 2013-12-18 17:06 UTC (permalink / raw)
To: Stephen Hemminger, David Miller; +Cc: netdev
On 12/18/13 01:35, Stephen Hemminger wrote:
> Use same field for both IPv4 (proxy_arp) and IPv6 (proxy_ndp)
> so fix it before API is set to be a common name
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> ---
> include/uapi/linux/netconf.h | 2 +-
> net/ipv4/devinet.c | 10 +++++-----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> --- a/include/uapi/linux/netconf.h 2013-12-17 22:30:00.000000000 -0800
> +++ b/include/uapi/linux/netconf.h 2013-12-17 22:31:07.973419694 -0800
> @@ -14,7 +14,7 @@ enum {
> NETCONFA_FORWARDING,
> NETCONFA_RP_FILTER,
> NETCONFA_MC_FORWARDING,
> - NETCONFA_PROXY_ARP,
> + NETCONFA_PROXY_NEIGH,
> __NETCONFA_MAX
> };
Can you do this? ;-> Why not #define NETCONFA_PROXY_NEIGH to be
NETCONFA_PROXY_ARP
cheers,
jamal
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY
2013-12-18 17:06 ` [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Jamal Hadi Salim
@ 2013-12-18 18:06 ` Stephen Hemminger
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2013-12-18 18:06 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: David Miller, netdev
On Wed, 18 Dec 2013 12:06:45 -0500
Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 12/18/13 01:35, Stephen Hemminger wrote:
> > Use same field for both IPv4 (proxy_arp) and IPv6 (proxy_ndp)
> > so fix it before API is set to be a common name
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> >
> > ---
> > include/uapi/linux/netconf.h | 2 +-
> > net/ipv4/devinet.c | 10 +++++-----
> > 2 files changed, 6 insertions(+), 6 deletions(-)
> >
> > --- a/include/uapi/linux/netconf.h 2013-12-17 22:30:00.000000000 -0800
> > +++ b/include/uapi/linux/netconf.h 2013-12-17 22:31:07.973419694 -0800
> > @@ -14,7 +14,7 @@ enum {
> > NETCONFA_FORWARDING,
> > NETCONFA_RP_FILTER,
> > NETCONFA_MC_FORWARDING,
> > - NETCONFA_PROXY_ARP,
> > + NETCONFA_PROXY_NEIGH,
> > __NETCONFA_MAX
> > };
>
> Can you do this? ;-> Why not #define NETCONFA_PROXY_NEIGH to be
> NETCONFA_PROXY_ARP
>
> cheers,
> jamal
>
The patch is against un-released net-next and only changes something
that was just added.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
` (2 preceding siblings ...)
2013-12-18 17:06 ` [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Jamal Hadi Salim
@ 2013-12-20 10:02 ` Nicolas Dichtel
2013-12-22 23:03 ` David Miller
4 siblings, 0 replies; 9+ messages in thread
From: Nicolas Dichtel @ 2013-12-20 10:02 UTC (permalink / raw)
To: Stephen Hemminger, David Miller; +Cc: netdev
Le 18/12/2013 07:35, Stephen Hemminger a écrit :
> Use same field for both IPv4 (proxy_arp) and IPv6 (proxy_ndp)
> so fix it before API is set to be a common name
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
@ 2013-12-20 10:05 ` Nicolas Dichtel
2013-12-22 23:03 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: Nicolas Dichtel @ 2013-12-20 10:05 UTC (permalink / raw)
To: Stephen Hemminger, David Miller; +Cc: netdev
Le 18/12/2013 07:37, Stephen Hemminger a écrit :
> Need to be able to see changes to proxy NDP status on a per
> interface basis via netlink (analog to proxy_arp).
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
` (3 preceding siblings ...)
2013-12-20 10:02 ` Nicolas Dichtel
@ 2013-12-22 23:03 ` David Miller
4 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2013-12-22 23:03 UTC (permalink / raw)
To: stephen; +Cc: netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 17 Dec 2013 22:35:52 -0800
> Use same field for both IPv4 (proxy_arp) and IPv6 (proxy_ndp)
> so fix it before API is set to be a common name
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
2013-12-20 10:05 ` Nicolas Dichtel
@ 2013-12-22 23:03 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2013-12-22 23:03 UTC (permalink / raw)
To: stephen; +Cc: netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 17 Dec 2013 22:37:14 -0800
> Need to be able to see changes to proxy NDP status on a per
> interface basis via netlink (analog to proxy_arp).
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-12-22 23:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 6:35 [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Stephen Hemminger
2013-12-18 6:37 ` [PATCH net-next 2/3] netconf: add support for IPv6 proxy_ndp Stephen Hemminger
2013-12-20 10:05 ` Nicolas Dichtel
2013-12-22 23:03 ` David Miller
2013-12-18 6:39 ` [PATCH iproute 3/3] iproute2: add proxy_neigh attribute Stephen Hemminger
2013-12-18 17:06 ` [PATCH net-next 1/3] netconf: rename PROXY_ARP to NEIGH_PROXY Jamal Hadi Salim
2013-12-18 18:06 ` Stephen Hemminger
2013-12-20 10:02 ` Nicolas Dichtel
2013-12-22 23:03 ` 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).