<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div><span>Hi, I add some explanation to the patch</span></div>
<div><span><br>
</span></div>
<div><span><span>From 57007eef77f266e40640a2c76aabd56fd37553f7 Mon Sep 17 00:00:00 2001<br>
</span>
<div>From: xiaofan <xfan1024@live.com><br>
</div>
<div>Date: Thu, 16 May 2019 21:12:47 +0800<br>
</div>
<div>Subject: [PATCH] interface-ip: fix find locally addressable target for p2p<br>
</div>
<div><br>
</div>
<div>In case of tunnel over PPP(such as gretap over l2tp): tunnel interface<br>
</div>
<div>use PPP's peer address as remote address, netifd script will call<br>
</div>
<div>proto_add_host_dependency function, then netifd will search which device<br>
</div>
<div>can reach to the remote address. Before the patch, netifd don't consider<br>
</div>
<div>the PPP interface can reach to the remote address, so netifd will select<br>
</div>
<div>default route to remote address, it will lead to remote address unreachable.<br>
</div>
<div><br>
</div>
<div>Signed-off-by: xiaofan <xfan1024@live.com><br>
</div>
<div>---<br>
</div>
<div> interface-ip.c | 3 +++<br>
</div>
<div> 1 file changed, 3 insertions(+)<br>
</div>
<div><br>
</div>
<div>diff --git a/interface-ip.c b/interface-ip.c<br>
</div>
<div>index 6900cd7..8d5587c 100644<br>
</div>
<div>--- a/interface-ip.c<br>
</div>
<div>+++ b/interface-ip.c<br>
</div>
<div>@@ -196,6 +196,9 @@ __find_ip_addr_target(struct interface_ip_settings *ip, union if_addr *a, bool v<br>
</div>
<div> if (v6 != ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6))<br>
</div>
<div> continue;<br>
</div>
<div> <br>
</div>
<div>+ if (!v6 && addr->point_to_point && a->in.s_addr == addr->point_to_point)<br>
</div>
<div>+ return true;<br>
</div>
<div>+<br>
</div>
<div> /* Handle offlink addresses correctly */<br>
</div>
<div> unsigned int mask = addr->mask;<br>
</div>
<div> if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6 &&<br>
</div>
<div>-- <br>
</div>
<div>2.17.1<br>
</div>
<div><br>
</div>
<span></span><br>
</span></div>
<div><span><br>
</span></div>
<div><span><br>
</span></div>
<div><span>> </span></div>
<div><span></span></div>
<div>> Hi,<br>
</div>
<div>> <br>
</div>
<div>> On Thu, May 16, 2019 at 4:01 PM Tan Xiaofan <xfan1024@live.com> wrote:<br>
</div>
<div>> ><br>
</div>
<div>> > From d0e1cb81b45ec825199d499cda9c8daef94e13a5 Mon Sep 17 00:00:00 2001<br>
</div>
<div>> > From: xiaofan <xfan1024@live.com><br>
</div>
<div>> > Date: Thu, 16 May 2019 21:12:47 +0800<br>
</div>
<div>> > Subject: [PATCH] interface-ip: fix find locally addressable target for p2p<br>
</div>
<div>> The patch fails to explain why this change is required and what<br>
</div>
<div>> usecase/problem it fixes.<br>
</div>
<div>> <br>
</div>
<div>> Hans<br>
</div>
<div>> ><br>
</div>
<div>> > Signed-off-by: xiaofan <xfan1024@live.com><br>
</div>
<div>> > ---<br>
</div>
<div>> > interface-ip.c | 4 ++++<br>
</div>
<div>> > 1 file changed, 4 insertions(+)<br>
</div>
<div>> ><br>
</div>
<div>> > diff --git a/interface-ip.c b/interface-ip.c<br>
</div>
<div>> > index 6900cd7..7ab8643 100644<br>
</div>
<div>> > --- a/interface-ip.c<br>
</div>
<div>> > +++ b/interface-ip.c<br>
</div>
<div>> > @@ -196,6 +196,10 @@ __find_ip_addr_target(struct interface_ip_settings *ip, union if_addr *a, bool v<br>
</div>
<div>> > if (v6 != ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6))<br>
</div>
<div>> > continue;<br>
</div>
<div>> ><br>
</div>
<div>> > + if (!v6 && addr->point_to_point && a->in.s_addr == addr->point_to_point) {<br>
</div>
<div>> > + return true;<br>
</div>
<div>> > + }<br>
</div>
<div>> > +<br>
</div>
<div>> > /* Handle offlink addresses correctly */<br>
</div>
<div>> > unsigned int mask = addr->mask;<br>
</div>
<div>> > if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6 &&<br>
</div>
<div>> > --<br>
</div>
<div>> > 2.17.1<br>
</div>
<div>> ><br>
</div>
<div>> ><br>
</div>
<div>> > _______________________________________________<br>
</div>
<div>> > openwrt-devel mailing list<br>
</div>
<div>> > openwrt-devel@lists.openwrt.org<br>
</div>
<div>> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel<br>
</div>
<span>> </span>
</body>
</html>