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 <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWAMOTO Toshihiro 2016-05-18 17:00:36 +09:00 committed by FUJITA Tomonori
parent a7e804fdec
commit 7f38397442

View File

@ -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):