ISHIDA san Your patch works properly in case of regular eBGP session. Thanks.
> 2015/08/21 12:27、ISHIDA Wataru <ishd.wat...@gmail.com> のメール: > > Hi I’ve modified the patch based on the origin patch to care > the regular eBGP behaviour. > > Could you check it? > >> On Aug 15, 2015, at 8:22 AM, Toshiki Tsuboi <t.tsubo2...@gmail.com >> <mailto:t.tsubo2...@gmail.com>> wrote: >> >> This issue looks complicated to me. >> I guess this patch for “BGP Next Hop Unchanged” works properly. >> >> eBGP eBGP >> ------- R1 -----------> RyuBGP ---------> R2 >> y.y.y.y z.z.z.z => UPDATE(Nexthop: y.y.y.y) >> >> >> But, in case of “Regular eBGP session”, I’m not sure this patch works >> properly as well. >> (maybe, RyuBGP can not change the next hop attribute of R1, when RyuBGP >> sends out R2) >> >> eBGP eBGP >> ------- R1 -----------> RyuBGP ---------> R2 >> y.y.y.y z.z.z.z => UPDATE(Nexthop: y.y.y.y) >> >> Needs for Code refactoring for issue of changing nexthop attribute. >> best regards. >> >> >> >>> 2015/08/14 4:13、Alan Quillin <alanquil...@gmail.com >>> <mailto:alanquil...@gmail.com>> のメール: >>> >>> From: Alan Quillin <alanquil...@gmail.com <mailto:alanquil...@gmail.com>> >>> >>> If the path has a next hop value set, it should be used in the BGP >>> Update message first. This changes to logic to use the check for the >>> next hop in the order prefix/path->peer config->speaker config. This >>> will allow for sending the nexthop as part of the add_prefix message and >>> allow for overiding the nexthop of the peer if one is set. >>> >>> Signed-off-by: Alan Quillin <alanquil...@gmail.com >>> <mailto:alanquil...@gmail.com>> >>> --- >>> ryu/services/protocols/bgp/info_base/base.py | 4 ++++ >>> ryu/services/protocols/bgp/peer.py | 2 ++ >>> 2 files changed, 6 insertions(+) >>> >>> diff --git a/ryu/services/protocols/bgp/info_base/base.py >>> b/ryu/services/protocols/bgp/info_base/base.py >>> index 3546c92..3065cb8 100644 >>> --- a/ryu/services/protocols/bgp/info_base/base.py >>> +++ b/ryu/services/protocols/bgp/info_base/base.py >>> @@ -809,6 +809,10 @@ class Path(object): >>> >>> return not interested_rts.isdisjoint(curr_rts) >>> >>> + def has_nexthop(self): >>> + return not (not self._nexthop or self._nexthop == '0.0.0.0' or >>> + self._nexthop == '::') >>> + >>> def __str__(self): >>> return ( >>> 'Path(source: %s, nlri: %s, source ver#: %s, ' >>> diff --git a/ryu/services/protocols/bgp/peer.py >>> b/ryu/services/protocols/bgp/peer.py >>> index f08ac1e..308cdc2 100644 >>> --- a/ryu/services/protocols/bgp/peer.py >>> +++ b/ryu/services/protocols/bgp/peer.py >>> @@ -803,6 +803,8 @@ class Peer(Source, Sink, NeighborConfListener, >>> Activity): >>> # By default we use BGPS's interface IP with this peer as next_hop. >>> if self._neigh_conf.next_hop: >>> next_hop = self._neigh_conf.next_hop >>> + elif path.has_nexthop(): >>> + next_hop = path.nexthop >>> else: >>> next_hop = self.host_bind_ip >>> if route_family == RF_IPv6_VPN: >>> -- >>> 2.1.4 >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Ryu-devel mailing list >>> Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.sourceforge.net> >>> https://lists.sourceforge.net/lists/listinfo/ryu-devel >>> <https://lists.sourceforge.net/lists/listinfo/ryu-devel> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Ryu-devel mailing list >> Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/ryu-devel >
------------------------------------------------------------------------------
_______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel