Re: [OpenWrt-Devel] [PATCH 0/2]netifd: Check routing table parameter when updating route

2013-11-19 Thread Hans Dedecker
Hi Felix,

I just resubmitted the patches as smaller ones. Functional wise patch 7 and
patch8 belong together; but to make the code review easier I splitted it up
in link layer state awareness on device level (patch 7) and interface level
(patch8).

Bye,
Hans

On Fri, Nov 15, 2013 at 3:07 PM, Felix Fietkau n...@openwrt.org wrote:

 On 2013-11-14 17:13, Hans Dedecker wrote:
  The route table parameter needs to be checked in
 interface_update_proto_route; a route which has
  an identical nexthop but a different routing table needs to be deleted
 and added in the correct
  routing table.
  While dumping the route list via ubus; don't display the default route
 when no default route is enabled.
  Additonal make the ip4table and ip6table parameters visible when
 displaying the interface status.
 
  Signed-off-by: Hans Dedecker dedec...@gmail.com
 Please split your patches into smaller ones to separate unrelated
 changes. This will make review much easier.

 Thanks,

 - Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/2]netifd: Check routing table parameter when updating route

2013-11-19 Thread Felix Fietkau
On 2013-11-19 12:29, Hans Dedecker wrote:
 Hi Felix,
 
 I just resubmitted the patches as smaller ones. Functional wise patch 7
 and patch8 belong together; but to make the code review easier I
 splitted it up in link layer state awareness on device level (patch 7)
 and interface level (patch8).
Thanks. At a first glance it looks much better now. I will review the
patches in detail soon.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/2]netifd: Check routing table parameter when updating route

2013-11-15 Thread Felix Fietkau
On 2013-11-14 17:13, Hans Dedecker wrote:
 The route table parameter needs to be checked in 
 interface_update_proto_route; a route which has
 an identical nexthop but a different routing table needs to be deleted and 
 added in the correct
 routing table.
 While dumping the route list via ubus; don't display the default route when 
 no default route is enabled.
 Additonal make the ip4table and ip6table parameters visible when displaying 
 the interface status.
 
 Signed-off-by: Hans Dedecker dedec...@gmail.com
Please split your patches into smaller ones to separate unrelated
changes. This will make review much easier.

Thanks,

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2]netifd: Check routing table parameter when updating route

2013-11-14 Thread Hans Dedecker
The route table parameter needs to be checked in interface_update_proto_route; 
a route which has
an identical nexthop but a different routing table needs to be deleted and 
added in the correct
routing table.
While dumping the route list via ubus; don't display the default route when no 
default route is enabled.
Additonal make the ip4table and ip6table parameters visible when displaying the 
interface status.

Signed-off-by: Hans Dedecker dedec...@gmail.com
---
 interface-ip.c |3 ++-
 interface.c|2 +-
 ubus.c |7 +++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/interface-ip.c b/interface-ip.c
index 084688c..fb1163c 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -632,7 +632,8 @@ interface_update_proto_route(struct vlist_tree *tree,
route_new = container_of(node_new, struct device_route, node);
 
if (node_old  node_new)
-   keep = !memcmp(route_old-nexthop, route_new-nexthop, 
sizeof(route_old-nexthop));
+   keep = !memcmp(route_old-nexthop, route_new-nexthop, 
sizeof(route_old-nexthop)) 
+   (route_old-table == route_new-table);
 
if (node_old) {
if (!(route_old-flags  DEVADDR_EXTERNAL)  
route_old-enabled  !keep)
diff --git a/interface.c b/interface.c
index 23c7032..9c208a2 100644
--- a/interface.c
+++ b/interface.c
@@ -918,7 +918,7 @@ interface_change_config(struct interface *if_old, struct 
interface *if_new)
 #undef UPDATE
 
if (reload) {
-   D(INTERFACE, Reload interface '%s because of config changes\n,
+   D(INTERFACE, Reload interface '%s' because of config 
changes\n,
  if_old-name);
interface_clear_errors(if_old);
set_config_state(if_old, IFC_RELOAD);
diff --git a/ubus.c b/ubus.c
index 9063680..1b90594 100644
--- a/ubus.c
+++ b/ubus.c
@@ -459,6 +459,9 @@ interface_ip_dump_route_list(struct interface_ip_settings 
*ip, bool enabled)
if (route-enabled != enabled)
continue;
 
+   if ((ip-no_defaultroute == enabled)  !route-mask)
+   continue;
+
if ((route-flags  DEVADDR_FAMILY) == DEVADDR_INET4)
af = AF_INET;
else
@@ -655,6 +658,10 @@ netifd_dump_status(struct interface *iface)
blobmsg_add_string(b, device, dev-ifname);
 
if (iface-state == IFS_UP) {
+   if (iface-ip4table)
+   blobmsg_add_u32(b, ip4table, iface-ip4table);
+   if (iface-ip6table)
+   blobmsg_add_u32(b, ip6table, iface-ip6table);   
  
blobmsg_add_u32(b, metric, iface-metric);
blobmsg_add_u8(b, delegation, 
!iface-proto_ip.no_delegation);
a = blobmsg_open_array(b, ipv4-address);
-- 
1.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel