From cac423338cf957084119cc8281bc34a7264bc736 Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Mon, 12 Feb 2018 15:28:03 -0500 Subject: [PATCH] apply patch --- py25/bacpypes/bvllservice.py | 24 ++++++++++++------------ py27/bacpypes/bvllservice.py | 25 +++++++++++++------------ py34/bacpypes/bvllservice.py | 24 ++++++++++++------------ 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/py25/bacpypes/bvllservice.py b/py25/bacpypes/bvllservice.py index e195d39a..e1542d07 100755 --- a/py25/bacpypes/bvllservice.py +++ b/py25/bacpypes/bvllservice.py @@ -446,11 +446,6 @@ def __init__(self, addr=None, ttl=None, sapID=None, cid=None, sid=None): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -462,6 +457,11 @@ def indication(self, pdu): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -498,6 +498,13 @@ def confirmation(self, pdu): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -511,13 +518,6 @@ def confirmation(self, pdu): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData) diff --git a/py27/bacpypes/bvllservice.py b/py27/bacpypes/bvllservice.py index 8c01f05e..5cc616b6 100755 --- a/py27/bacpypes/bvllservice.py +++ b/py27/bacpypes/bvllservice.py @@ -442,11 +442,6 @@ def __init__(self, addr=None, ttl=None, sapID=None, cid=None, sid=None): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -458,6 +453,11 @@ def indication(self, pdu): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -494,6 +494,14 @@ def confirmation(self, pdu): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + return + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -507,13 +515,6 @@ def confirmation(self, pdu): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData) diff --git a/py34/bacpypes/bvllservice.py b/py34/bacpypes/bvllservice.py index 2a6285c5..1b2504a9 100755 --- a/py34/bacpypes/bvllservice.py +++ b/py34/bacpypes/bvllservice.py @@ -441,11 +441,6 @@ def __init__(self, addr=None, ttl=None, sapID=None, cid=None, sid=None): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -457,6 +452,11 @@ def indication(self, pdu): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -493,6 +493,13 @@ def confirmation(self, pdu): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -506,13 +513,6 @@ def confirmation(self, pdu): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData)