From 7f383974424e7080dabca217da607dcea2c64e9f Mon Sep 17 00:00:00 2001 From: IWAMOTO Toshihiro Date: Wed, 18 May 2016 17:00:36 +0900 Subject: [PATCH] packet/bgp: Add missing __hash__ function This commit fixes up the commit 7d42aecb, which added __eq__ without adding __hash__ and left some copy-paste error. Signed-off-by: IWAMOTO Toshihiro Signed-off-by: FUJITA Tomonori --- ryu/lib/packet/bgp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index 2fb51e88..96746f52 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -1095,7 +1095,9 @@ class RouteTargetMembershipNLRI(StringifyMixin): def __eq__(self, other): return ((self.origin_as, self.route_target) == (other.origin_as, other.route_target)) - return (self.afi, self.safi) == (other.afi, other.safi) + + def __hash__(self): + return hash((self.origin_as, self.route_target)) @classmethod def parser(cls, buf):