Re: [OpenWrt-Devel] [PATCH] netifd: Set source IP for DHCP default route

2014-12-10 Thread Hans Dedecker
On Wed, Dec 10, 2014 at 9:56 AM, Kristian Evensen
 wrote:
> On Wed, Dec 10, 2014 at 9:10 AM, Hans Dedecker  wrote:
>> As a side effect of this patch I noticed multiple default routes (one
>> default route with source IP set and one default route with source IP
>> unset) are present in netifd if the dhcp server replies the default
>> route both in the router option and the staticroutes option. Before
>> the patch the default routes were considered as identical by netifd as
>> the route key was the same; but since the source IP is set now for one
>> of the default routes this is not the case anymore.
>> Is there any reason why the source IP is not set when the staticroutes
>> are added in set_classless_routes in the dhcp script ?
>
> I completely failed to consider static (classless) routes when writing
> this patch. I am not able to test this now, but based on my
> understanding of the RFC it should be safe to add source here as well.
> I am not sure if it will work with multiple default routes though, so
> I guess you just have to test. There is at least no particular reason
> for why I did not add it :)
>
> -Kristian

OK if there's no specific reason why the source IP was not added for
static routes I can give it a try
and test it

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


Re: [OpenWrt-Devel] [PATCH] netifd: Set source IP for DHCP default route

2014-12-10 Thread Kristian Evensen
On Wed, Dec 10, 2014 at 9:10 AM, Hans Dedecker  wrote:
> As a side effect of this patch I noticed multiple default routes (one
> default route with source IP set and one default route with source IP
> unset) are present in netifd if the dhcp server replies the default
> route both in the router option and the staticroutes option. Before
> the patch the default routes were considered as identical by netifd as
> the route key was the same; but since the source IP is set now for one
> of the default routes this is not the case anymore.
> Is there any reason why the source IP is not set when the staticroutes
> are added in set_classless_routes in the dhcp script ?

I completely failed to consider static (classless) routes when writing
this patch. I am not able to test this now, but based on my
understanding of the RFC it should be safe to add source here as well.
I am not sure if it will work with multiple default routes though, so
I guess you just have to test. There is at least no particular reason
for why I did not add it :)

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


Re: [OpenWrt-Devel] [PATCH] netifd: Set source IP for DHCP default route

2014-12-10 Thread Hans Dedecker
On Fri, Dec 5, 2014 at 10:48 AM, Kristian Evensen
 wrote:
>
> From: Kristian Evensen 
>
> This patch depends on "Pass source address to proto_add_ipv4_route".
>
> I have not found a scenario that would break by setting the source address on
> default, but please let me know if any special considerations should be taken.
>
> Signed-off-by: Kristian Evensen 
> ---
>  package/network/config/netifd/files/lib/netifd/dhcp.script | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script 
> b/package/network/config/netifd/files/lib/netifd/dhcp.script
> index 90fa6d3..17e22af 100755
> --- a/package/network/config/netifd/files/lib/netifd/dhcp.script
> +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
> @@ -20,7 +20,7 @@ setup_interface () {
> # TODO: apply $broadcast
>
> for i in $router; do
> -   proto_add_ipv4_route 0.0.0.0 0 "$i"
> +   proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
> done
>
> # CIDR STATIC ROUTES (rfc3442)
> --
> 1.9.1
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

As a side effect of this patch I noticed multiple default routes (one
default route with source IP set and one default route with source IP
unset) are present in netifd if the dhcp server replies the default
route both in the router option and the staticroutes option. Before
the patch the default routes were considered as identical by netifd as
the route key was the same; but since the source IP is set now for one
of the default routes this is not the case anymore.
Is there any reason why the source IP is not set when the staticroutes
are added in set_classless_routes in the dhcp script ?

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


[OpenWrt-Devel] [PATCH] netifd: Set source IP for DHCP default route

2014-12-05 Thread Kristian Evensen
From: Kristian Evensen 

This patch depends on "Pass source address to proto_add_ipv4_route".

I have not found a scenario that would break by setting the source address on
default, but please let me know if any special considerations should be taken.

Signed-off-by: Kristian Evensen 
---
 package/network/config/netifd/files/lib/netifd/dhcp.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script 
b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 90fa6d3..17e22af 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -20,7 +20,7 @@ setup_interface () {
# TODO: apply $broadcast
 
for i in $router; do
-   proto_add_ipv4_route 0.0.0.0 0 "$i"
+   proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
done
 
# CIDR STATIC ROUTES (rfc3442)
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel