All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/1] Allow to monitor protocol configuration
@ 2012-10-23  9:49 Nicolas Dichtel
  2012-10-23  9:49 ` [RFC PATCH net-next 1/3] rtnl: add a new type of msg to advertise " Nicolas Dichtel
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-23  9:49 UTC (permalink / raw)
  To: netdev; +Cc: davem

This patch serie aims to advertising via netlink any change in the network
configuration of a protocol (network or transport). For example the announcement
when ip forwarding parameter is toggled. 

It adds a new kind of message, RTM_NEWNETCONF.

Following this serie, is a patch against iproute2, to show an example of how to
use it.

Comments are welcome.

Regards,
Nicolas

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

* [RFC PATCH net-next 1/3] rtnl: add a new type of msg to advertise protocol configuration
  2012-10-23  9:49 [RFC PATCH net-next 0/1] Allow to monitor protocol configuration Nicolas Dichtel
@ 2012-10-23  9:49 ` Nicolas Dichtel
  2012-10-23  9:49 ` [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-23  9:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

A new type is added to allow userland to monitor protocol configuration, like
IPv4 or IPv6.
For example, monitoring the state of the forwarding status of an interface of
the system.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/netconf.h   | 22 ++++++++++++++++++++++
 include/uapi/linux/rtnetlink.h |  3 +++
 2 files changed, 25 insertions(+)
 create mode 100644 include/uapi/linux/netconf.h

diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
new file mode 100644
index 0000000..d051372
--- /dev/null
+++ b/include/uapi/linux/netconf.h
@@ -0,0 +1,22 @@
+#ifndef _UAPI_LINUX_NETCONF_H_
+#define _UAPI_LINUX_NETCONF_H_
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct netconfmsg {
+	__u8	ncm_family;
+};
+
+enum {
+	NETCONFA_UNSPEC,
+	NETCONFA_IFINDEX,
+	NETCONFA_FORWARDING,
+	__NETCONFA_MAX
+};
+#define NETCONFA_MAX	(__NETCONFA_MAX - 1)
+
+#define NETCONFA_IFINDEX_ALL		-1
+#define NETCONFA_IFINDEX_DEFAULT	-2
+
+#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index fcd768b..8372514 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -120,6 +120,9 @@ enum {
 	RTM_SETDCB,
 #define RTM_SETDCB RTM_SETDCB
 
+	RTM_NEWNETCONF = 80,
+#define RTM_NEWNETCONF RTM_NEWNETCONF
+
 	__RTM_MAX,
 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
 };
-- 
1.7.12

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

* [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-23  9:49 [RFC PATCH net-next 0/1] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-23  9:49 ` [RFC PATCH net-next 1/3] rtnl: add a new type of msg to advertise " Nicolas Dichtel
@ 2012-10-23  9:49 ` Nicolas Dichtel
  2012-10-23 17:29   ` David Miller
  2012-10-23  9:49 ` [RFC PATCH net-next 3/3] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
  2012-10-23  9:54 ` [RFC PATCH iproute2] ip: allow to monitor netconf messages Nicolas Dichtel
  3 siblings, 1 reply; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-23  9:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 ++
 net/ipv6/addrconf.c            | 70 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 8372514..20cfaa3 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -590,6 +590,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV6_NETCONF,
+#define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0424e4e..f741e99 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -81,6 +81,7 @@
 #include <net/pkt_sched.h>
 #include <linux/if_tunnel.h>
 #include <linux/rtnetlink.h>
+#include <linux/netconf.h>
 
 #ifdef CONFIG_IPV6_PRIVACY
 #include <linux/random.h>
@@ -460,6 +461,65 @@ static struct inet6_dev *ipv6_find_idev(struct net_device *dev)
 	return idev;
 }
 
+static inline int inet6_netconf_msgsize(void)
+{
+	return NLMSG_ALIGN(sizeof(struct netconfmsg))
+	       + nla_total_size(4)	/* NETCONFA_IFINDEX */
+	       + nla_total_size(4);	/* NETCONFA_FORWARDING */
+}
+
+static int inet6_fill_netconf_devconf(struct sk_buff *skb, int ifindex,
+				      struct ipv6_devconf *devconf, u32 portid,
+				      u32 seq, int event, unsigned int flags)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET6;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0) {
+		nlmsg_cancel(skb, nlh);
+		return -EMSGSIZE;
+	}
+	if (nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0) {
+		nlmsg_cancel(skb, nlh);
+		return -EMSGSIZE;
+	}
+
+	return nlmsg_end(skb, nlh);
+}
+
+static void inet6_netconf_notify_devconf(struct net *net, int event,
+					 int ifindex,
+					 struct ipv6_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet6_netconf_msgsize(), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet6_fill_netconf_devconf(skb, ifindex, devconf, 0, 0, event, 0);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet6_netconf_msgsize() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV6_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV6_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 static void dev_forward_change(struct inet6_dev *idev)
 {
@@ -486,6 +546,8 @@ static void dev_forward_change(struct inet6_dev *idev)
 		else
 			addrconf_leave_anycast(ifa);
 	}
+	inet6_netconf_notify_devconf(dev_net(dev), RTM_NEWNETCONF,
+				     dev->ifindex, &idev->cnf);
 }
 
 
@@ -518,6 +580,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	*p = newf;
 
 	if (p == &net->ipv6.devconf_dflt->forwarding) {
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
+						     NETCONFA_IFINDEX_DEFAULT,
+						     net->ipv6.devconf_dflt);
 		rtnl_unlock();
 		return 0;
 	}
@@ -525,6 +591,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	if (p == &net->ipv6.devconf_all->forwarding) {
 		net->ipv6.devconf_dflt->forwarding = newf;
 		addrconf_forward_change(net, newf);
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
+						     NETCONFA_IFINDEX_ALL,
+						     net->ipv6.devconf_all);
 	} else if ((!newf) ^ (!old))
 		dev_forward_change((struct inet6_dev *)table->extra1);
 	rtnl_unlock();
-- 
1.7.12

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

* [RFC PATCH net-next 3/3] rtnl/ipv4: use netconf msg to advertise forwarding status
  2012-10-23  9:49 [RFC PATCH net-next 0/1] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-23  9:49 ` [RFC PATCH net-next 1/3] rtnl: add a new type of msg to advertise " Nicolas Dichtel
  2012-10-23  9:49 ` [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-23  9:49 ` Nicolas Dichtel
  2012-10-23  9:54 ` [RFC PATCH iproute2] ip: allow to monitor netconf messages Nicolas Dichtel
  3 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-23  9:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 +
 net/ipv4/devinet.c             | 83 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 20cfaa3..15937f2 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -590,6 +590,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV4_NETCONF,
+#define RTNLGRP_IPV4_NETCONF	RTNLGRP_IPV4_NETCONF
 	RTNLGRP_IPV6_NETCONF,
 #define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2a6abc1..19516e1 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -55,6 +55,7 @@
 #include <linux/sysctl.h>
 #endif
 #include <linux/kmod.h>
+#include <linux/netconf.h>
 
 #include <net/arp.h>
 #include <net/ip.h>
@@ -1442,6 +1443,65 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
 	return 0;
 }
 
+static inline int inet_netconf_msgsize(void)
+{
+	return NLMSG_ALIGN(sizeof(struct netconfmsg))
+	       + nla_total_size(4)	/* NETCONFA_IFINDEX */
+	       + nla_total_size(4);	/* NETCONFA_FORWARDING */
+}
+
+static int inet_fill_netconf_devconf(struct sk_buff *skb, int ifindex,
+				     struct ipv4_devconf *devconf, u32 portid,
+				     u32 seq, int event, unsigned int flags)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0) {
+		nlmsg_cancel(skb, nlh);
+		return -EMSGSIZE;
+	}
+	if (nla_put_s32(skb, NETCONFA_FORWARDING,
+			IPV4_DEVCONF(*devconf, FORWARDING)) < 0) {
+		nlmsg_cancel(skb, nlh);
+		return -EMSGSIZE;
+	}
+
+	return nlmsg_end(skb, nlh);
+}
+
+static void inet_netconf_notify_devconf(struct net *net, int event, int ifindex,
+					struct ipv4_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet_netconf_msgsize(), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet_fill_netconf_devconf(skb, ifindex, devconf, 0, 0, event, 0);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet_netconf_msgsize() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV4_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 
 static void devinet_copy_dflt_conf(struct net *net, int i)
@@ -1467,6 +1527,11 @@ static void inet_forward_change(struct net *net)
 
 	IPV4_DEVCONF_ALL(net, ACCEPT_REDIRECTS) = !on;
 	IPV4_DEVCONF_DFLT(net, FORWARDING) = on;
+	inet_netconf_notify_devconf(net, RTM_NEWNETCONF, NETCONFA_IFINDEX_ALL,
+				    net->ipv4.devconf_all);
+	inet_netconf_notify_devconf(net, RTM_NEWNETCONF,
+				    NETCONFA_IFINDEX_DEFAULT,
+				    net->ipv4.devconf_dflt);
 
 	for_each_netdev(net, dev) {
 		struct in_device *in_dev;
@@ -1474,8 +1539,11 @@ static void inet_forward_change(struct net *net)
 			dev_disable_lro(dev);
 		rcu_read_lock();
 		in_dev = __in_dev_get_rcu(dev);
-		if (in_dev)
+		if (in_dev) {
 			IN_DEV_CONF_SET(in_dev, FORWARDING, on);
+			inet_netconf_notify_devconf(net, RTM_NEWNETCONF,
+						    dev->ifindex, &in_dev->cnf);
+		}
 		rcu_read_unlock();
 	}
 }
@@ -1527,15 +1595,22 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 			}
 			if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
 				inet_forward_change(net);
-			} else if (*valp) {
+			} else {
 				struct ipv4_devconf *cnf = ctl->extra1;
 				struct in_device *idev =
 					container_of(cnf, struct in_device, cnf);
-				dev_disable_lro(idev->dev);
+				if (*valp)
+					dev_disable_lro(idev->dev);
+				inet_netconf_notify_devconf(net, RTM_NEWNETCONF,
+							    idev->dev->ifindex,
+							    cnf);
 			}
 			rtnl_unlock();
 			rt_cache_flush(net);
-		}
+		} else
+			inet_netconf_notify_devconf(net, RTM_NEWNETCONF,
+						    NETCONFA_IFINDEX_DEFAULT,
+						    net->ipv4.devconf_dflt);
 	}
 
 	return ret;
-- 
1.7.12

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

* [RFC PATCH iproute2] ip: allow to monitor netconf messages
  2012-10-23  9:49 [RFC PATCH net-next 0/1] Allow to monitor protocol configuration Nicolas Dichtel
                   ` (2 preceding siblings ...)
  2012-10-23  9:49 ` [RFC PATCH net-next 3/3] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-23  9:54 ` Nicolas Dichtel
  2012-10-23 12:52   ` Stephen Hemminger
  3 siblings, 1 reply; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-23  9:54 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Nicolas Dichtel

Example of the output:
$ ip monitor netconf&
[1] 24901
$ echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
ipv6 dev lo forwarding off
ipv6 dev eth0 forwarding off
ipv6 all forwarding off
$ echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
ipv4 dev eth0 forwarding on

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/libnetlink.h      |  1 +
 include/linux/netconf.h   | 22 ++++++++++++
 include/linux/rtnetlink.h |  7 ++++
 ip/Makefile               |  2 +-
 ip/ip_common.h            |  2 ++
 ip/ipmonitor.c            | 16 +++++++++
 ip/ipnetconf.c            | 92 +++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 141 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/netconf.h
 create mode 100644 ip/ipnetconf.c

diff --git a/include/libnetlink.h b/include/libnetlink.h
index 81649af..4a6b878 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -8,6 +8,7 @@
 #include <linux/if_link.h>
 #include <linux/if_addr.h>
 #include <linux/neighbour.h>
+#include <linux/netconf.h>
 
 struct rtnl_handle
 {
diff --git a/include/linux/netconf.h b/include/linux/netconf.h
new file mode 100644
index 0000000..d051372
--- /dev/null
+++ b/include/linux/netconf.h
@@ -0,0 +1,22 @@
+#ifndef _UAPI_LINUX_NETCONF_H_
+#define _UAPI_LINUX_NETCONF_H_
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct netconfmsg {
+	__u8	ncm_family;
+};
+
+enum {
+	NETCONFA_UNSPEC,
+	NETCONFA_IFINDEX,
+	NETCONFA_FORWARDING,
+	__NETCONFA_MAX
+};
+#define NETCONFA_MAX	(__NETCONFA_MAX - 1)
+
+#define NETCONFA_IFINDEX_ALL		-1
+#define NETCONFA_IFINDEX_DEFAULT	-2
+
+#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index d5b7fdd..f23d7ad 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -120,6 +120,9 @@ enum {
 	RTM_SETDCB,
 #define RTM_SETDCB RTM_SETDCB
 
+	RTM_NEWNETCONF = 80,
+#define RTM_NEWNETCONF RTM_NEWNETCONF
+
 	__RTM_MAX,
 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
 };
@@ -585,6 +588,10 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV4_NETCONF,
+#define RTNLGRP_IPV4_NETCONF	RTNLGRP_IPV4_NETCONF
+	RTNLGRP_IPV6_NETCONF,
+#define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/ip/Makefile b/ip/Makefile
index dfe2e71..ccf9608 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -4,7 +4,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
     iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
     iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o \
-    iplink_vxlan.o tcp_metrics.o
+    iplink_vxlan.o tcp_metrics.o ipnetconf.o
 
 RTMONOBJ=rtmon.o
 
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 2fd66b7..d50f763 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -25,6 +25,8 @@ extern int print_prefix(const struct sockaddr_nl *who,
 			struct nlmsghdr *n, void *arg);
 extern int print_rule(const struct sockaddr_nl *who,
 		      struct nlmsghdr *n, void *arg);
+extern int print_netconf(const struct sockaddr_nl *who,
+			 struct nlmsghdr *n, void *arg);
 extern int do_ipaddr(int argc, char **argv);
 extern int do_ipaddrlabel(int argc, char **argv);
 extern int do_iproute(int argc, char **argv);
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 4b1d469..d87e58f 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -85,6 +85,12 @@ int accept_msg(const struct sockaddr_nl *who,
 		print_rule(who, n, arg);
 		return 0;
 	}
+	if (n->nlmsg_type == RTM_NEWNETCONF) {
+		if (prefix_banner)
+			fprintf(fp, "[NETCONF]");
+		print_netconf(who, n, arg);
+		return 0;
+	}
 	if (n->nlmsg_type == 15) {
 		char *tstr;
 		time_t secs = ((__u32*)NLMSG_DATA(n))[0];
@@ -118,6 +124,7 @@ int do_ipmonitor(int argc, char **argv)
 	int lroute=0;
 	int lprefix=0;
 	int lneigh=0;
+	int lnetconf=0;
 
 	rtnl_close(&rth);
 	ipaddr_reset_filter(1);
@@ -143,6 +150,9 @@ int do_ipmonitor(int argc, char **argv)
 		} else if (matches(*argv, "neigh") == 0) {
 			lneigh = 1;
 			groups = 0;
+		} else if (matches(*argv, "netconf") == 0) {
+			lnetconf = 1;
+			groups = 0;
 		} else if (strcmp(*argv, "all") == 0) {
 			groups = ~RTMGRP_TC;
 			prefix_banner=1;
@@ -176,6 +186,12 @@ int do_ipmonitor(int argc, char **argv)
 	if (lneigh) {
 		groups |= nl_mgrp(RTNLGRP_NEIGH);
 	}
+	if (lnetconf) {
+		if (!preferred_family || preferred_family == AF_INET)
+			groups |= nl_mgrp(RTNLGRP_IPV4_NETCONF);
+		if (!preferred_family || preferred_family == AF_INET6)
+			groups |= nl_mgrp(RTNLGRP_IPV6_NETCONF);
+	}
 	if (file) {
 		FILE *fp;
 		fp = fopen(file, "r");
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
new file mode 100644
index 0000000..f92eabf
--- /dev/null
+++ b/ip/ipnetconf.c
@@ -0,0 +1,92 @@
+/*
+ *		This program is free software; you can redistribute it and/or
+ *		modify it under the terms of the GNU General Public License
+ *		as published by the Free Software Foundation; either version
+ *		2 of the License, or (at your option) any later version.
+ *
+ * Authors:	Nicolas Dichtel, <nicolas.dichtel@6wind.com>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include "rt_names.h"
+#include "utils.h"
+#include "ip_common.h"
+
+static struct
+{
+	int family;
+} filter;
+
+#define NETCONF_RTA(r)	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct netconfmsg))))
+
+int print_netconf(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+{
+	FILE *fp = (FILE*)arg;
+	struct netconfmsg *ncm = NLMSG_DATA(n);
+	int len = n->nlmsg_len;
+	struct rtattr *tb[NETCONFA_MAX+1];
+
+	if (n->nlmsg_type != RTM_NEWNETCONF) {
+		fprintf(stderr, "Not RTM_NEWNETCONF: %08x %08x %08x\n",
+			n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
+
+		return 0;
+	}
+	len -= NLMSG_SPACE(sizeof(*ncm));
+	if (len < 0) {
+		fprintf(stderr, "BUG: wrong nlmsg len %d\n", len);
+		return -1;
+	}
+
+	if (filter.family && filter.family != ncm->ncm_family)
+		return 0;
+
+	parse_rtattr(tb, NETCONFA_MAX, NETCONF_RTA(ncm),
+		     NLMSG_PAYLOAD(n, sizeof(*ncm)));
+
+	switch (ncm->ncm_family) {
+	case AF_INET:
+		fprintf(fp, "ipv4 ");
+		break;
+	case AF_INET6:
+		fprintf(fp, "ipv6 ");
+		break;
+	default:
+		fprintf(fp, "unknown ");
+		break;
+	}
+
+	if (tb[NETCONFA_IFINDEX]) {
+		int *ifindex = (int *)RTA_DATA(tb[NETCONFA_IFINDEX]);
+
+		switch (*ifindex) {
+		case NETCONFA_IFINDEX_ALL:
+			fprintf(fp, "all ");
+			break;
+		case NETCONFA_IFINDEX_DEFAULT:
+			fprintf(fp, "default ");
+			break;
+		default:
+			fprintf(fp, "dev %s ", ll_index_to_name(*ifindex));
+			break;
+		}
+	}
+
+	if (tb[NETCONFA_FORWARDING])
+		fprintf(fp, "forwarding %s ",
+			*(int *)RTA_DATA(tb[NETCONFA_FORWARDING])?"on":"off");
+
+	fprintf(fp, "\n");
+	fflush(fp);
+	return 0;
+}
-- 
1.7.12

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

* Re: [RFC PATCH iproute2] ip: allow to monitor netconf messages
  2012-10-23  9:54 ` [RFC PATCH iproute2] ip: allow to monitor netconf messages Nicolas Dichtel
@ 2012-10-23 12:52   ` Stephen Hemminger
  0 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2012-10-23 12:52 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev

Thanks for submitting, but currently iproute2 tree is being
used for 3.7 features.

Please resubmit after netconf is merged in upstream kernel
(i.e. during 3.8 merge window).

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

* Re: [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-23  9:49 ` [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-23 17:29   ` David Miller
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  0 siblings, 1 reply; 24+ messages in thread
From: David Miller @ 2012-10-23 17:29 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Tue, 23 Oct 2012 11:49:48 +0200

> +static int inet6_fill_netconf_devconf(struct sk_buff *skb, int ifindex,
> +				      struct ipv6_devconf *devconf, u32 portid,
> +				      u32 seq, int event, unsigned int flags)
> +{
> +	struct nlmsghdr  *nlh;
> +	struct netconfmsg *ncm;
> +
> +	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
> +			flags);
> +	if (nlh == NULL)
> +		return -EMSGSIZE;
> +
> +	ncm = nlmsg_data(nlh);
> +	ncm->ncm_family = AF_INET6;
> +
> +	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0) {
> +		nlmsg_cancel(skb, nlh);
> +		return -EMSGSIZE;
> +	}
> +	if (nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0) {
> +		nlmsg_cancel(skb, nlh);
> +		return -EMSGSIZE;
> +	}
> +
> +	return nlmsg_end(skb, nlh);
> +}

Don't report values that aren't changing, that's wasteful.

You need to therefore provide a ->get() operation, so that when
a daemon starts up which is interested in these values, it can
fetch the initial state.

That's why you should only report the differences in the events,
rather than unconditionally reporting all the values all the
time, whether they change or not.

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

* [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration
  2012-10-23 17:29   ` David Miller
@ 2012-10-24 16:02     ` Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
                         ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev

This patch serie aims to advertising via netlink any change in the network
configuration of a protocol (network or transport). For example the announcement
when ip forwarding parameter is toggled. 

It adds a new kind of messages, RTM_NEWNETCONF/RTM_GETNETCONF.

The patch which adds the support of netconf messages in iproute2 will be sent
when the feature will be included.  If someone is interested to get it before,
just tell me!

v2: rename functions to be consistent
    specify type of the attribute to notify when calling
    inet[6]_netconf_notify_devconf(), goal is to notify only thinks that
    changed.
    add RTM_GETNETCONF support

Comments are welcome.

Regards,
Nicolas

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

* [RFC PATCH net-next v2 1/5] rtnl: add a new type of msg to advertise protocol configuration
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
@ 2012-10-24 16:02       ` Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
                         ` (4 subsequent siblings)
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

A new type is added to allow userland to monitor protocol configuration, like
IPv4 or IPv6.
For example, monitoring the state of the forwarding status of an interface of
the system.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/netconf.h   | 22 ++++++++++++++++++++++
 include/uapi/linux/rtnetlink.h |  5 +++++
 2 files changed, 27 insertions(+)
 create mode 100644 include/uapi/linux/netconf.h

diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
new file mode 100644
index 0000000..d051372
--- /dev/null
+++ b/include/uapi/linux/netconf.h
@@ -0,0 +1,22 @@
+#ifndef _UAPI_LINUX_NETCONF_H_
+#define _UAPI_LINUX_NETCONF_H_
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct netconfmsg {
+	__u8	ncm_family;
+};
+
+enum {
+	NETCONFA_UNSPEC,
+	NETCONFA_IFINDEX,
+	NETCONFA_FORWARDING,
+	__NETCONFA_MAX
+};
+#define NETCONFA_MAX	(__NETCONFA_MAX - 1)
+
+#define NETCONFA_IFINDEX_ALL		-1
+#define NETCONFA_IFINDEX_DEFAULT	-2
+
+#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index fcd768b..0043b41 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -120,6 +120,11 @@ enum {
 	RTM_SETDCB,
 #define RTM_SETDCB RTM_SETDCB
 
+	RTM_NEWNETCONF = 80,
+#define RTM_NEWNETCONF RTM_NEWNETCONF
+	RTM_GETNETCONF = 82,
+#define RTM_GETNETCONF RTM_GETNETCONF
+
 	__RTM_MAX,
 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
 };
-- 
1.7.12

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

* [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
@ 2012-10-24 16:02       ` Nicolas Dichtel
  2012-10-26  6:18         ` David Miller
  2012-10-24 16:02       ` [RFC PATCH net-next v2 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
                         ` (3 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 ++
 net/ipv6/addrconf.c            | 77 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 0043b41..a4d75ea 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -592,6 +592,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV6_NETCONF,
+#define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0424e4e..9bf4d1b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -81,6 +81,7 @@
 #include <net/pkt_sched.h>
 #include <linux/if_tunnel.h>
 #include <linux/rtnetlink.h>
+#include <linux/netconf.h>
 
 #ifdef CONFIG_IPV6_PRIVACY
 #include <linux/random.h>
@@ -460,6 +461,72 @@ static struct inet6_dev *ipv6_find_idev(struct net_device *dev)
 	return idev;
 }
 
+static inline int inet6_netconf_msgsize_devconf(int type)
+{
+	int size =  NLMSG_ALIGN(sizeof(struct netconfmsg))
+		    + nla_total_size(4);	/* NETCONFA_IFINDEX */
+
+	if (type == NETCONFA_FORWARDING)
+		size += nla_total_size(4);
+
+	return size;
+}
+
+static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
+				      struct ipv6_devconf *devconf, u32 portid,
+				      u32 seq, int event, unsigned int flags,
+				      int type)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET6;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
+		goto nla_put_failure;
+
+	if (type == NETCONFA_FORWARDING &&
+	    nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0)
+		goto nla_put_failure;
+
+	return nlmsg_end(skb, nlh);
+
+nla_put_failure:
+	nlmsg_cancel(skb, nlh);
+	return -EMSGSIZE;
+}
+
+static void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
+					 struct ipv6_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet6_netconf_msgsize_devconf(type), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet6_netconf_fill_devconf(skb, ifindex, devconf, 0, 0,
+					 RTM_NEWNETCONF, 0, type);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet6_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV6_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV6_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 static void dev_forward_change(struct inet6_dev *idev)
 {
@@ -486,6 +553,8 @@ static void dev_forward_change(struct inet6_dev *idev)
 		else
 			addrconf_leave_anycast(ifa);
 	}
+	inet6_netconf_notify_devconf(dev_net(dev), NETCONFA_FORWARDING,
+				     dev->ifindex, &idev->cnf);
 }
 
 
@@ -518,6 +587,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	*p = newf;
 
 	if (p == &net->ipv6.devconf_dflt->forwarding) {
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						     NETCONFA_IFINDEX_DEFAULT,
+						     net->ipv6.devconf_dflt);
 		rtnl_unlock();
 		return 0;
 	}
@@ -525,6 +598,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	if (p == &net->ipv6.devconf_all->forwarding) {
 		net->ipv6.devconf_dflt->forwarding = newf;
 		addrconf_forward_change(net, newf);
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						     NETCONFA_IFINDEX_ALL,
+						     net->ipv6.devconf_all);
 	} else if ((!newf) ^ (!old))
 		dev_forward_change((struct inet6_dev *)table->extra1);
 	rtnl_unlock();
-- 
1.7.12

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

* [RFC PATCH net-next v2 3/5] rtnl/ipv6: add support of RTM_GETNETCONF
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-24 16:02       ` Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
                         ` (2 subsequent siblings)
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

This message allows to get the devconf for an interface.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/addrconf.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9bf4d1b..dbab3ad 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -466,7 +466,8 @@ static inline int inet6_netconf_msgsize_devconf(int type)
 	int size =  NLMSG_ALIGN(sizeof(struct netconfmsg))
 		    + nla_total_size(4);	/* NETCONFA_IFINDEX */
 
-	if (type == NETCONFA_FORWARDING)
+	/* type -1 is used for ALL */
+	if (type == -1 || type == NETCONFA_FORWARDING)
 		size += nla_total_size(4);
 
 	return size;
@@ -491,7 +492,8 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
 	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
 		goto nla_put_failure;
 
-	if (type == NETCONFA_FORWARDING &&
+	/* type -1 is used for ALL */
+	if ((type == -1 || type == NETCONFA_FORWARDING) &&
 	    nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0)
 		goto nla_put_failure;
 
@@ -527,6 +529,73 @@ errout:
 		rtnl_set_sk_err(net, RTNLGRP_IPV6_NETCONF, err);
 }
 
+static const struct nla_policy devconf_ipv6_policy[NETCONFA_MAX+1] = {
+	[NETCONFA_IFINDEX]	= { .len = sizeof(int) },
+	[NETCONFA_FORWARDING]	= { .len = sizeof(int) },
+};
+
+static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
+				     struct nlmsghdr *nlh,
+				     void *arg)
+{
+	struct net *net = sock_net(in_skb->sk);
+	struct nlattr *tb[NETCONFA_MAX+1];
+	struct netconfmsg *ncm;
+	struct sk_buff *skb;
+	struct ipv6_devconf *devconf;
+	struct inet6_dev *in6_dev;
+	struct net_device *dev;
+	int ifindex;
+	int err;
+
+	err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX,
+			  devconf_ipv6_policy);
+	if (err < 0)
+		goto errout;
+
+	err = EINVAL;
+	if (!tb[NETCONFA_IFINDEX])
+		goto errout;
+
+	ifindex = nla_get_s32(tb[NETCONFA_IFINDEX]);
+	switch (ifindex) {
+	case NETCONFA_IFINDEX_ALL:
+		devconf = net->ipv6.devconf_all;
+		break;
+	case NETCONFA_IFINDEX_DEFAULT:
+		devconf = net->ipv6.devconf_dflt;
+		break;
+	default:
+		dev = __dev_get_by_index(net, ifindex);
+		if (dev == NULL)
+			goto errout;
+		in6_dev = __in6_dev_get(dev);
+		if (in6_dev == NULL)
+			goto errout;
+		devconf = &in6_dev->cnf;
+		break;
+	}
+
+	err = -ENOBUFS;
+	skb = nlmsg_new(inet6_netconf_msgsize_devconf(-1), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet6_netconf_fill_devconf(skb, ifindex, devconf,
+					 NETLINK_CB(in_skb).portid,
+					 nlh->nlmsg_seq, RTM_NEWNETCONF, 0,
+					 -1);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet6_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+errout:
+	return err;
+}
+
 #ifdef CONFIG_SYSCTL
 static void dev_forward_change(struct inet6_dev *idev)
 {
@@ -4861,6 +4930,8 @@ int __init addrconf_init(void)
 			inet6_dump_ifmcaddr, NULL);
 	__rtnl_register(PF_INET6, RTM_GETANYCAST, NULL,
 			inet6_dump_ifacaddr, NULL);
+	__rtnl_register(PF_INET6, RTM_GETNETCONF, inet6_netconf_get_devconf,
+			NULL, NULL);
 
 	ipv6_addr_label_rtnl_register();
 
-- 
1.7.12

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

* [RFC PATCH net-next v2 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                         ` (2 preceding siblings ...)
  2012-10-24 16:02       ` [RFC PATCH net-next v2 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
@ 2012-10-24 16:02       ` Nicolas Dichtel
  2012-10-24 16:02       ` [RFC PATCH net-next v2 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
  2012-10-26  6:19       ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 +
 net/ipv4/devinet.c             | 93 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 91 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index a4d75ea..3dee071 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -592,6 +592,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV4_NETCONF,
+#define RTNLGRP_IPV4_NETCONF	RTNLGRP_IPV4_NETCONF
 	RTNLGRP_IPV6_NETCONF,
 #define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2a6abc1..845fe48 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -55,6 +55,7 @@
 #include <linux/sysctl.h>
 #endif
 #include <linux/kmod.h>
+#include <linux/netconf.h>
 
 #include <net/arp.h>
 #include <net/ip.h>
@@ -1442,6 +1443,73 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
 	return 0;
 }
 
+static inline int inet_netconf_msgsize_devconf(int type)
+{
+	int size = NLMSG_ALIGN(sizeof(struct netconfmsg))
+		   + nla_total_size(4);	/* NETCONFA_IFINDEX */
+
+	if (type == NETCONFA_FORWARDING)
+		size += nla_total_size(4);
+
+	return size;
+}
+
+static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
+				     struct ipv4_devconf *devconf, u32 portid,
+				     u32 seq, int event, unsigned int flags,
+				     int type)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
+		goto nla_put_failure;
+
+	if (type == NETCONFA_FORWARDING &&
+	    nla_put_s32(skb, NETCONFA_FORWARDING,
+			IPV4_DEVCONF(*devconf, FORWARDING)) < 0)
+		goto nla_put_failure;
+
+	return nlmsg_end(skb, nlh);
+
+nla_put_failure:
+	nlmsg_cancel(skb, nlh);
+	return -EMSGSIZE;
+}
+
+static void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
+					struct ipv4_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet_netconf_msgsize_devconf(type), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet_netconf_fill_devconf(skb, ifindex, devconf, 0, 0,
+					RTM_NEWNETCONF, 0, type);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV4_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 
 static void devinet_copy_dflt_conf(struct net *net, int i)
@@ -1467,6 +1535,12 @@ static void inet_forward_change(struct net *net)
 
 	IPV4_DEVCONF_ALL(net, ACCEPT_REDIRECTS) = !on;
 	IPV4_DEVCONF_DFLT(net, FORWARDING) = on;
+	inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+				    NETCONFA_IFINDEX_ALL,
+				    net->ipv4.devconf_all);
+	inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+				    NETCONFA_IFINDEX_DEFAULT,
+				    net->ipv4.devconf_dflt);
 
 	for_each_netdev(net, dev) {
 		struct in_device *in_dev;
@@ -1474,8 +1548,11 @@ static void inet_forward_change(struct net *net)
 			dev_disable_lro(dev);
 		rcu_read_lock();
 		in_dev = __in_dev_get_rcu(dev);
-		if (in_dev)
+		if (in_dev) {
 			IN_DEV_CONF_SET(in_dev, FORWARDING, on);
+			inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						    dev->ifindex, &in_dev->cnf);
+		}
 		rcu_read_unlock();
 	}
 }
@@ -1527,15 +1604,23 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 			}
 			if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
 				inet_forward_change(net);
-			} else if (*valp) {
+			} else {
 				struct ipv4_devconf *cnf = ctl->extra1;
 				struct in_device *idev =
 					container_of(cnf, struct in_device, cnf);
-				dev_disable_lro(idev->dev);
+				if (*valp)
+					dev_disable_lro(idev->dev);
+				inet_netconf_notify_devconf(net,
+							    NETCONFA_FORWARDING,
+							    idev->dev->ifindex,
+							    cnf);
 			}
 			rtnl_unlock();
 			rt_cache_flush(net);
-		}
+		} else
+			inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						    NETCONFA_IFINDEX_DEFAULT,
+						    net->ipv4.devconf_dflt);
 	}
 
 	return ret;
-- 
1.7.12

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

* [RFC PATCH net-next v2 5/5] rtnl/ipv4: add support of RTM_GETNETCONF
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                         ` (3 preceding siblings ...)
  2012-10-24 16:02       ` [RFC PATCH net-next v2 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-24 16:02       ` Nicolas Dichtel
  2012-10-26  6:19       ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-24 16:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

This message allows to get the devconf for an interface.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv4/devinet.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 845fe48..2f522970 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1448,7 +1448,8 @@ static inline int inet_netconf_msgsize_devconf(int type)
 	int size = NLMSG_ALIGN(sizeof(struct netconfmsg))
 		   + nla_total_size(4);	/* NETCONFA_IFINDEX */
 
-	if (type == NETCONFA_FORWARDING)
+	/* type -1 is used for ALL */
+	if (type == -1 || type == NETCONFA_FORWARDING)
 		size += nla_total_size(4);
 
 	return size;
@@ -1473,7 +1474,8 @@ static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
 	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
 		goto nla_put_failure;
 
-	if (type == NETCONFA_FORWARDING &&
+	/* type -1 is used for ALL */
+	if ((type == -1 || type == NETCONFA_FORWARDING) &&
 	    nla_put_s32(skb, NETCONFA_FORWARDING,
 			IPV4_DEVCONF(*devconf, FORWARDING)) < 0)
 		goto nla_put_failure;
@@ -1510,6 +1512,73 @@ errout:
 		rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
 }
 
+static const struct nla_policy devconf_ipv4_policy[NETCONFA_MAX+1] = {
+	[NETCONFA_IFINDEX]	= { .len = sizeof(int) },
+	[NETCONFA_FORWARDING]	= { .len = sizeof(int) },
+};
+
+static int inet_netconf_get_devconf(struct sk_buff *in_skb,
+				    struct nlmsghdr *nlh,
+				    void *arg)
+{
+	struct net *net = sock_net(in_skb->sk);
+	struct nlattr *tb[NETCONFA_MAX+1];
+	struct netconfmsg *ncm;
+	struct sk_buff *skb;
+	struct ipv4_devconf *devconf;
+	struct in_device *in_dev;
+	struct net_device *dev;
+	int ifindex;
+	int err;
+
+	err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX,
+			  devconf_ipv4_policy);
+	if (err < 0)
+		goto errout;
+
+	err = EINVAL;
+	if (!tb[NETCONFA_IFINDEX])
+		goto errout;
+
+	ifindex = nla_get_s32(tb[NETCONFA_IFINDEX]);
+	switch (ifindex) {
+	case NETCONFA_IFINDEX_ALL:
+		devconf = net->ipv4.devconf_all;
+		break;
+	case NETCONFA_IFINDEX_DEFAULT:
+		devconf = net->ipv4.devconf_dflt;
+		break;
+	default:
+		dev = __dev_get_by_index(net, ifindex);
+		if (dev == NULL)
+			goto errout;
+		in_dev = __in_dev_get_rtnl(dev);
+		if (in_dev == NULL)
+			goto errout;
+		devconf = &in_dev->cnf;
+		break;
+	}
+
+	err = -ENOBUFS;
+	skb = nlmsg_new(inet_netconf_msgsize_devconf(-1), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet_netconf_fill_devconf(skb, ifindex, devconf,
+					NETLINK_CB(in_skb).portid,
+					nlh->nlmsg_seq, RTM_NEWNETCONF, 0,
+					-1);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+errout:
+	return err;
+}
+
 #ifdef CONFIG_SYSCTL
 
 static void devinet_copy_dflt_conf(struct net *net, int i)
@@ -1894,5 +1963,7 @@ void __init devinet_init(void)
 	rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL);
 	rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL);
 	rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL);
+	rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf,
+		      NULL, NULL);
 }
 
-- 
1.7.12

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

* Re: [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-24 16:02       ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-26  6:18         ` David Miller
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-26  9:03           ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status David Laight
  0 siblings, 2 replies; 24+ messages in thread
From: David Miller @ 2012-10-26  6:18 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 24 Oct 2012 18:02:56 +0200

> +static inline int inet6_netconf_msgsize_devconf(int type)

Outside of header files, we don't add explicit inlines, we let
the compiler decide.

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

* Re: [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration
  2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                         ` (4 preceding siblings ...)
  2012-10-24 16:02       ` [RFC PATCH net-next v2 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
@ 2012-10-26  6:19       ` David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: David Miller @ 2012-10-26  6:19 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 24 Oct 2012 18:02:54 +0200

> This patch serie aims to advertising via netlink any change in the network
> configuration of a protocol (network or transport). For example the announcement
> when ip forwarding parameter is toggled. 
> 
> It adds a new kind of messages, RTM_NEWNETCONF/RTM_GETNETCONF.
> 
> The patch which adds the support of netconf messages in iproute2 will be sent
> when the feature will be included.  If someone is interested to get it before,
> just tell me!
> 
> v2: rename functions to be consistent
>     specify type of the attribute to notify when calling
>     inet[6]_netconf_notify_devconf(), goal is to notify only thinks that
>     changed.
>     add RTM_GETNETCONF support
> 
> Comments are welcome.

Besides the inline function thing, this set looks fine to me.

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

* [PATCH net-next v3 0/5] Allow to monitor protocol configuration
  2012-10-26  6:18         ` David Miller
@ 2012-10-26  8:28           ` Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
                               ` (5 more replies)
  2012-10-26  9:03           ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status David Laight
  1 sibling, 6 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev

This patch serie aims to advertising via netlink any change in the network
configuration of a protocol (network or transport). For example the announcement
when ip forwarding parameter is toggled. 

It adds a new kind of messages, RTM_NEWNETCONF/RTM_GETNETCONF.

The patch which adds the support of netconf messages in iproute2 will be sent
when the feature will be included.  If someone is interested to get it before,
just tell me!

v3: remove inline attribute in non header files

v2: rename functions to be consistent
    specify type of the attribute to notify when calling
    inet[6]_netconf_notify_devconf(), goal is to notify only thinks that
    changed.
    add RTM_GETNETCONF support

Comments are welcome.

Regards,
Nicolas

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

* [PATCH net-next v3 1/5] rtnl: add a new type of msg to advertise protocol configuration
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
@ 2012-10-26  8:28             ` Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
                               ` (4 subsequent siblings)
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

A new type is added to allow userland to monitor protocol configuration, like
IPv4 or IPv6.
For example, monitoring the state of the forwarding status of an interface of
the system.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/netconf.h   | 22 ++++++++++++++++++++++
 include/uapi/linux/rtnetlink.h |  5 +++++
 2 files changed, 27 insertions(+)
 create mode 100644 include/uapi/linux/netconf.h

diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
new file mode 100644
index 0000000..d051372
--- /dev/null
+++ b/include/uapi/linux/netconf.h
@@ -0,0 +1,22 @@
+#ifndef _UAPI_LINUX_NETCONF_H_
+#define _UAPI_LINUX_NETCONF_H_
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct netconfmsg {
+	__u8	ncm_family;
+};
+
+enum {
+	NETCONFA_UNSPEC,
+	NETCONFA_IFINDEX,
+	NETCONFA_FORWARDING,
+	__NETCONFA_MAX
+};
+#define NETCONFA_MAX	(__NETCONFA_MAX - 1)
+
+#define NETCONFA_IFINDEX_ALL		-1
+#define NETCONFA_IFINDEX_DEFAULT	-2
+
+#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index fcd768b..0043b41 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -120,6 +120,11 @@ enum {
 	RTM_SETDCB,
 #define RTM_SETDCB RTM_SETDCB
 
+	RTM_NEWNETCONF = 80,
+#define RTM_NEWNETCONF RTM_NEWNETCONF
+	RTM_GETNETCONF = 82,
+#define RTM_GETNETCONF RTM_GETNETCONF
+
 	__RTM_MAX,
 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
 };
-- 
1.7.12

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

* [PATCH net-next v3 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
@ 2012-10-26  8:28             ` Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
                               ` (3 subsequent siblings)
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 ++
 net/ipv6/addrconf.c            | 77 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 0043b41..a4d75ea 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -592,6 +592,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV6_NETCONF,
+#define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0424e4e..0c57a8f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -81,6 +81,7 @@
 #include <net/pkt_sched.h>
 #include <linux/if_tunnel.h>
 #include <linux/rtnetlink.h>
+#include <linux/netconf.h>
 
 #ifdef CONFIG_IPV6_PRIVACY
 #include <linux/random.h>
@@ -460,6 +461,72 @@ static struct inet6_dev *ipv6_find_idev(struct net_device *dev)
 	return idev;
 }
 
+static int inet6_netconf_msgsize_devconf(int type)
+{
+	int size =  NLMSG_ALIGN(sizeof(struct netconfmsg))
+		    + nla_total_size(4);	/* NETCONFA_IFINDEX */
+
+	if (type == NETCONFA_FORWARDING)
+		size += nla_total_size(4);
+
+	return size;
+}
+
+static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
+				      struct ipv6_devconf *devconf, u32 portid,
+				      u32 seq, int event, unsigned int flags,
+				      int type)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET6;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
+		goto nla_put_failure;
+
+	if (type == NETCONFA_FORWARDING &&
+	    nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0)
+		goto nla_put_failure;
+
+	return nlmsg_end(skb, nlh);
+
+nla_put_failure:
+	nlmsg_cancel(skb, nlh);
+	return -EMSGSIZE;
+}
+
+static void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
+					 struct ipv6_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet6_netconf_msgsize_devconf(type), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet6_netconf_fill_devconf(skb, ifindex, devconf, 0, 0,
+					 RTM_NEWNETCONF, 0, type);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet6_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV6_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV6_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 static void dev_forward_change(struct inet6_dev *idev)
 {
@@ -486,6 +553,8 @@ static void dev_forward_change(struct inet6_dev *idev)
 		else
 			addrconf_leave_anycast(ifa);
 	}
+	inet6_netconf_notify_devconf(dev_net(dev), NETCONFA_FORWARDING,
+				     dev->ifindex, &idev->cnf);
 }
 
 
@@ -518,6 +587,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	*p = newf;
 
 	if (p == &net->ipv6.devconf_dflt->forwarding) {
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						     NETCONFA_IFINDEX_DEFAULT,
+						     net->ipv6.devconf_dflt);
 		rtnl_unlock();
 		return 0;
 	}
@@ -525,6 +598,10 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
 	if (p == &net->ipv6.devconf_all->forwarding) {
 		net->ipv6.devconf_dflt->forwarding = newf;
 		addrconf_forward_change(net, newf);
+		if ((!newf) ^ (!old))
+			inet6_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						     NETCONFA_IFINDEX_ALL,
+						     net->ipv6.devconf_all);
 	} else if ((!newf) ^ (!old))
 		dev_forward_change((struct inet6_dev *)table->extra1);
 	rtnl_unlock();
-- 
1.7.12

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

* [PATCH net-next v3 3/5] rtnl/ipv6: add support of RTM_GETNETCONF
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-26  8:28             ` Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
                               ` (2 subsequent siblings)
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

This message allows to get the devconf for an interface.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/addrconf.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0c57a8f..8f0b12a 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -466,7 +466,8 @@ static int inet6_netconf_msgsize_devconf(int type)
 	int size =  NLMSG_ALIGN(sizeof(struct netconfmsg))
 		    + nla_total_size(4);	/* NETCONFA_IFINDEX */
 
-	if (type == NETCONFA_FORWARDING)
+	/* type -1 is used for ALL */
+	if (type == -1 || type == NETCONFA_FORWARDING)
 		size += nla_total_size(4);
 
 	return size;
@@ -491,7 +492,8 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
 	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
 		goto nla_put_failure;
 
-	if (type == NETCONFA_FORWARDING &&
+	/* type -1 is used for ALL */
+	if ((type == -1 || type == NETCONFA_FORWARDING) &&
 	    nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0)
 		goto nla_put_failure;
 
@@ -527,6 +529,73 @@ errout:
 		rtnl_set_sk_err(net, RTNLGRP_IPV6_NETCONF, err);
 }
 
+static const struct nla_policy devconf_ipv6_policy[NETCONFA_MAX+1] = {
+	[NETCONFA_IFINDEX]	= { .len = sizeof(int) },
+	[NETCONFA_FORWARDING]	= { .len = sizeof(int) },
+};
+
+static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
+				     struct nlmsghdr *nlh,
+				     void *arg)
+{
+	struct net *net = sock_net(in_skb->sk);
+	struct nlattr *tb[NETCONFA_MAX+1];
+	struct netconfmsg *ncm;
+	struct sk_buff *skb;
+	struct ipv6_devconf *devconf;
+	struct inet6_dev *in6_dev;
+	struct net_device *dev;
+	int ifindex;
+	int err;
+
+	err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX,
+			  devconf_ipv6_policy);
+	if (err < 0)
+		goto errout;
+
+	err = EINVAL;
+	if (!tb[NETCONFA_IFINDEX])
+		goto errout;
+
+	ifindex = nla_get_s32(tb[NETCONFA_IFINDEX]);
+	switch (ifindex) {
+	case NETCONFA_IFINDEX_ALL:
+		devconf = net->ipv6.devconf_all;
+		break;
+	case NETCONFA_IFINDEX_DEFAULT:
+		devconf = net->ipv6.devconf_dflt;
+		break;
+	default:
+		dev = __dev_get_by_index(net, ifindex);
+		if (dev == NULL)
+			goto errout;
+		in6_dev = __in6_dev_get(dev);
+		if (in6_dev == NULL)
+			goto errout;
+		devconf = &in6_dev->cnf;
+		break;
+	}
+
+	err = -ENOBUFS;
+	skb = nlmsg_new(inet6_netconf_msgsize_devconf(-1), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet6_netconf_fill_devconf(skb, ifindex, devconf,
+					 NETLINK_CB(in_skb).portid,
+					 nlh->nlmsg_seq, RTM_NEWNETCONF, 0,
+					 -1);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet6_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+errout:
+	return err;
+}
+
 #ifdef CONFIG_SYSCTL
 static void dev_forward_change(struct inet6_dev *idev)
 {
@@ -4861,6 +4930,8 @@ int __init addrconf_init(void)
 			inet6_dump_ifmcaddr, NULL);
 	__rtnl_register(PF_INET6, RTM_GETANYCAST, NULL,
 			inet6_dump_ifacaddr, NULL);
+	__rtnl_register(PF_INET6, RTM_GETNETCONF, inet6_netconf_get_devconf,
+			NULL, NULL);
 
 	ipv6_addr_label_rtnl_register();
 
-- 
1.7.12

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

* [PATCH net-next v3 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                               ` (2 preceding siblings ...)
  2012-10-26  8:28             ` [PATCH net-next v3 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
@ 2012-10-26  8:28             ` Nicolas Dichtel
  2012-10-26  8:28             ` [PATCH net-next v3 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
  2012-10-28 23:05             ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  2 +
 net/ipv4/devinet.c             | 93 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 91 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index a4d75ea..3dee071 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -592,6 +592,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
 	RTNLGRP_DCB,
 #define RTNLGRP_DCB		RTNLGRP_DCB
+	RTNLGRP_IPV4_NETCONF,
+#define RTNLGRP_IPV4_NETCONF	RTNLGRP_IPV4_NETCONF
 	RTNLGRP_IPV6_NETCONF,
 #define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
 	__RTNLGRP_MAX
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2a6abc1..020fdd2 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -55,6 +55,7 @@
 #include <linux/sysctl.h>
 #endif
 #include <linux/kmod.h>
+#include <linux/netconf.h>
 
 #include <net/arp.h>
 #include <net/ip.h>
@@ -1442,6 +1443,73 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
 	return 0;
 }
 
+static int inet_netconf_msgsize_devconf(int type)
+{
+	int size = NLMSG_ALIGN(sizeof(struct netconfmsg))
+		   + nla_total_size(4);	/* NETCONFA_IFINDEX */
+
+	if (type == NETCONFA_FORWARDING)
+		size += nla_total_size(4);
+
+	return size;
+}
+
+static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
+				     struct ipv4_devconf *devconf, u32 portid,
+				     u32 seq, int event, unsigned int flags,
+				     int type)
+{
+	struct nlmsghdr  *nlh;
+	struct netconfmsg *ncm;
+
+	nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct netconfmsg),
+			flags);
+	if (nlh == NULL)
+		return -EMSGSIZE;
+
+	ncm = nlmsg_data(nlh);
+	ncm->ncm_family = AF_INET;
+
+	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
+		goto nla_put_failure;
+
+	if (type == NETCONFA_FORWARDING &&
+	    nla_put_s32(skb, NETCONFA_FORWARDING,
+			IPV4_DEVCONF(*devconf, FORWARDING)) < 0)
+		goto nla_put_failure;
+
+	return nlmsg_end(skb, nlh);
+
+nla_put_failure:
+	nlmsg_cancel(skb, nlh);
+	return -EMSGSIZE;
+}
+
+static void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
+					struct ipv4_devconf *devconf)
+{
+	struct sk_buff *skb;
+	int err = -ENOBUFS;
+
+	skb = nlmsg_new(inet_netconf_msgsize_devconf(type), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet_netconf_fill_devconf(skb, ifindex, devconf, 0, 0,
+					RTM_NEWNETCONF, 0, type);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	rtnl_notify(skb, net, 0, RTNLGRP_IPV4_NETCONF, NULL, GFP_ATOMIC);
+	return;
+errout:
+	if (err < 0)
+		rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
+}
+
 #ifdef CONFIG_SYSCTL
 
 static void devinet_copy_dflt_conf(struct net *net, int i)
@@ -1467,6 +1535,12 @@ static void inet_forward_change(struct net *net)
 
 	IPV4_DEVCONF_ALL(net, ACCEPT_REDIRECTS) = !on;
 	IPV4_DEVCONF_DFLT(net, FORWARDING) = on;
+	inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+				    NETCONFA_IFINDEX_ALL,
+				    net->ipv4.devconf_all);
+	inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+				    NETCONFA_IFINDEX_DEFAULT,
+				    net->ipv4.devconf_dflt);
 
 	for_each_netdev(net, dev) {
 		struct in_device *in_dev;
@@ -1474,8 +1548,11 @@ static void inet_forward_change(struct net *net)
 			dev_disable_lro(dev);
 		rcu_read_lock();
 		in_dev = __in_dev_get_rcu(dev);
-		if (in_dev)
+		if (in_dev) {
 			IN_DEV_CONF_SET(in_dev, FORWARDING, on);
+			inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						    dev->ifindex, &in_dev->cnf);
+		}
 		rcu_read_unlock();
 	}
 }
@@ -1527,15 +1604,23 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 			}
 			if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
 				inet_forward_change(net);
-			} else if (*valp) {
+			} else {
 				struct ipv4_devconf *cnf = ctl->extra1;
 				struct in_device *idev =
 					container_of(cnf, struct in_device, cnf);
-				dev_disable_lro(idev->dev);
+				if (*valp)
+					dev_disable_lro(idev->dev);
+				inet_netconf_notify_devconf(net,
+							    NETCONFA_FORWARDING,
+							    idev->dev->ifindex,
+							    cnf);
 			}
 			rtnl_unlock();
 			rt_cache_flush(net);
-		}
+		} else
+			inet_netconf_notify_devconf(net, NETCONFA_FORWARDING,
+						    NETCONFA_IFINDEX_DEFAULT,
+						    net->ipv4.devconf_dflt);
 	}
 
 	return ret;
-- 
1.7.12

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

* [PATCH net-next v3 5/5] rtnl/ipv4: add support of RTM_GETNETCONF
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                               ` (3 preceding siblings ...)
  2012-10-26  8:28             ` [PATCH net-next v3 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
@ 2012-10-26  8:28             ` Nicolas Dichtel
  2012-10-28 23:05             ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: Nicolas Dichtel @ 2012-10-26  8:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

This message allows to get the devconf for an interface.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv4/devinet.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 020fdd2..f8b1e04 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1448,7 +1448,8 @@ static int inet_netconf_msgsize_devconf(int type)
 	int size = NLMSG_ALIGN(sizeof(struct netconfmsg))
 		   + nla_total_size(4);	/* NETCONFA_IFINDEX */
 
-	if (type == NETCONFA_FORWARDING)
+	/* type -1 is used for ALL */
+	if (type == -1 || type == NETCONFA_FORWARDING)
 		size += nla_total_size(4);
 
 	return size;
@@ -1473,7 +1474,8 @@ static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
 	if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
 		goto nla_put_failure;
 
-	if (type == NETCONFA_FORWARDING &&
+	/* type -1 is used for ALL */
+	if ((type == -1 || type == NETCONFA_FORWARDING) &&
 	    nla_put_s32(skb, NETCONFA_FORWARDING,
 			IPV4_DEVCONF(*devconf, FORWARDING)) < 0)
 		goto nla_put_failure;
@@ -1510,6 +1512,73 @@ errout:
 		rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
 }
 
+static const struct nla_policy devconf_ipv4_policy[NETCONFA_MAX+1] = {
+	[NETCONFA_IFINDEX]	= { .len = sizeof(int) },
+	[NETCONFA_FORWARDING]	= { .len = sizeof(int) },
+};
+
+static int inet_netconf_get_devconf(struct sk_buff *in_skb,
+				    struct nlmsghdr *nlh,
+				    void *arg)
+{
+	struct net *net = sock_net(in_skb->sk);
+	struct nlattr *tb[NETCONFA_MAX+1];
+	struct netconfmsg *ncm;
+	struct sk_buff *skb;
+	struct ipv4_devconf *devconf;
+	struct in_device *in_dev;
+	struct net_device *dev;
+	int ifindex;
+	int err;
+
+	err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX,
+			  devconf_ipv4_policy);
+	if (err < 0)
+		goto errout;
+
+	err = EINVAL;
+	if (!tb[NETCONFA_IFINDEX])
+		goto errout;
+
+	ifindex = nla_get_s32(tb[NETCONFA_IFINDEX]);
+	switch (ifindex) {
+	case NETCONFA_IFINDEX_ALL:
+		devconf = net->ipv4.devconf_all;
+		break;
+	case NETCONFA_IFINDEX_DEFAULT:
+		devconf = net->ipv4.devconf_dflt;
+		break;
+	default:
+		dev = __dev_get_by_index(net, ifindex);
+		if (dev == NULL)
+			goto errout;
+		in_dev = __in_dev_get_rtnl(dev);
+		if (in_dev == NULL)
+			goto errout;
+		devconf = &in_dev->cnf;
+		break;
+	}
+
+	err = -ENOBUFS;
+	skb = nlmsg_new(inet_netconf_msgsize_devconf(-1), GFP_ATOMIC);
+	if (skb == NULL)
+		goto errout;
+
+	err = inet_netconf_fill_devconf(skb, ifindex, devconf,
+					NETLINK_CB(in_skb).portid,
+					nlh->nlmsg_seq, RTM_NEWNETCONF, 0,
+					-1);
+	if (err < 0) {
+		/* -EMSGSIZE implies BUG in inet_netconf_msgsize_devconf() */
+		WARN_ON(err == -EMSGSIZE);
+		kfree_skb(skb);
+		goto errout;
+	}
+	err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
+errout:
+	return err;
+}
+
 #ifdef CONFIG_SYSCTL
 
 static void devinet_copy_dflt_conf(struct net *net, int i)
@@ -1894,5 +1963,7 @@ void __init devinet_init(void)
 	rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL);
 	rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL);
 	rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL);
+	rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf,
+		      NULL, NULL);
 }
 
-- 
1.7.12

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

* RE: [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-26  6:18         ` David Miller
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
@ 2012-10-26  9:03           ` David Laight
  2012-10-26  9:17             ` David Miller
  1 sibling, 1 reply; 24+ messages in thread
From: David Laight @ 2012-10-26  9:03 UTC (permalink / raw)
  To: David Miller, nicolas.dichtel; +Cc: netdev

> > +static inline int inet6_netconf_msgsize_devconf(int type)
> 
> Outside of header files, we don't add explicit inlines, we let
> the compiler decide.

Hmmm.... In my experience it makes bad decisions,
even for static functions that are only called once.
And yes, I have checked that the inlined code is smaller
and faster.

	David

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

* Re: [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status
  2012-10-26  9:03           ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status David Laight
@ 2012-10-26  9:17             ` David Miller
  0 siblings, 0 replies; 24+ messages in thread
From: David Miller @ 2012-10-26  9:17 UTC (permalink / raw)
  To: David.Laight; +Cc: nicolas.dichtel, netdev

From: "David Laight" <David.Laight@ACULAB.COM>
Date: Fri, 26 Oct 2012 10:03:54 +0100

>> > +static inline int inet6_netconf_msgsize_devconf(int type)
>> 
>> Outside of header files, we don't add explicit inlines, we let
>> the compiler decide.
> 
> Hmmm.... In my experience it makes bad decisions,
> even for static functions that are only called once.
> And yes, I have checked that the inlined code is smaller
> and faster.

This isn't for you to decide.  It's been decided long ago that we're
doing things tree wide doing things this way.

If GCC is not perfect, submit a well formed bug report, don't complain
here.

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

* Re: [PATCH net-next v3 0/5] Allow to monitor protocol configuration
  2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
                               ` (4 preceding siblings ...)
  2012-10-26  8:28             ` [PATCH net-next v3 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
@ 2012-10-28 23:05             ` David Miller
  5 siblings, 0 replies; 24+ messages in thread
From: David Miller @ 2012-10-28 23:05 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 26 Oct 2012 10:28:48 +0200

> This patch serie aims to advertising via netlink any change in the network
> configuration of a protocol (network or transport). For example the announcement
> when ip forwarding parameter is toggled. 
> 
> It adds a new kind of messages, RTM_NEWNETCONF/RTM_GETNETCONF.
> 
> The patch which adds the support of netconf messages in iproute2 will be sent
> when the feature will be included.  If someone is interested to get it before,
> just tell me!
> 
> v3: remove inline attribute in non header files
> 
> v2: rename functions to be consistent
>     specify type of the attribute to notify when calling
>     inet[6]_netconf_notify_devconf(), goal is to notify only thinks that
>     changed.
>     add RTM_GETNETCONF support
> 
> Comments are welcome.

All applied, thanks Nicolas.

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

end of thread, other threads:[~2012-10-28 23:05 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-23  9:49 [RFC PATCH net-next 0/1] Allow to monitor protocol configuration Nicolas Dichtel
2012-10-23  9:49 ` [RFC PATCH net-next 1/3] rtnl: add a new type of msg to advertise " Nicolas Dichtel
2012-10-23  9:49 ` [RFC PATCH net-next 2/3] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-23 17:29   ` David Miller
2012-10-24 16:02     ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration Nicolas Dichtel
2012-10-24 16:02       ` [RFC PATCH net-next v2 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
2012-10-24 16:02       ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-26  6:18         ` David Miller
2012-10-26  8:28           ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration Nicolas Dichtel
2012-10-26  8:28             ` [PATCH net-next v3 1/5] rtnl: add a new type of msg to advertise " Nicolas Dichtel
2012-10-26  8:28             ` [PATCH net-next v3 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-26  8:28             ` [PATCH net-next v3 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
2012-10-26  8:28             ` [PATCH net-next v3 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-26  8:28             ` [PATCH net-next v3 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
2012-10-28 23:05             ` [PATCH net-next v3 0/5] Allow to monitor protocol configuration David Miller
2012-10-26  9:03           ` [RFC PATCH net-next v2 2/5] rtnl/ipv6: use netconf msg to advertise forwarding status David Laight
2012-10-26  9:17             ` David Miller
2012-10-24 16:02       ` [RFC PATCH net-next v2 3/5] rtnl/ipv6: add support of RTM_GETNETCONF Nicolas Dichtel
2012-10-24 16:02       ` [RFC PATCH net-next v2 4/5] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-24 16:02       ` [RFC PATCH net-next v2 5/5] rtnl/ipv4: add support of RTM_GETNETCONF Nicolas Dichtel
2012-10-26  6:19       ` [RFC PATCH net-next v2 0/5] Allow to monitor protocol configuration David Miller
2012-10-23  9:49 ` [RFC PATCH net-next 3/3] rtnl/ipv4: use netconf msg to advertise forwarding status Nicolas Dichtel
2012-10-23  9:54 ` [RFC PATCH iproute2] ip: allow to monitor netconf messages Nicolas Dichtel
2012-10-23 12:52   ` Stephen Hemminger

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.