Changeset 1629
- Timestamp:
- 11/12/08 18:35:45 (2 months ago)
- Files:
-
- branches/0.4.7/lib/cxcore/cxcore/cxnetlink.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.4.7/lib/cxcore/cxcore/cxnetlink.py
r1627 r1629 370 370 CX_MAX_MSG = CX_MAX_LENGTH - sizeof(cxhdr) 371 371 372 CX_FLAGS_FIRST_FRAGMENT = 0x001 373 CX_FLAGS_FINAL_FRAGMENT = 0x002 374 CX_FLAGS_MORE_FRAGMENTS = 0x004 375 376 CX_MSG_TRACK = 0x001 372 373 # flag value bit No 374 CX_FLAGS_FIRST_FRAGMENT = 0x001 # 1 375 CX_FLAGS_FINAL_FRAGMENT = 0x002 # 2 376 CX_FLAGS_MORE_FRAGMENTS = 0x004 # 3 377 378 CX_MSG_TRACK = 0x100 # 9 379 CX_MSG_ECHO = 0x200 # 10 380 CX_MSG_DROP = 0x400 # 11 377 381 378 382 class cxmsg(Structure): … … 495 499 raise 496 500 501 # parse header 502 header = cxhdr.from_address(addressof(self.recv_buffer)) 503 if header.version < CX_PROTO_VERSION: 504 return 505 497 506 for i in map(lambda x: x.name, self.mdns.lookupByIP(address)): 498 507 if self.watch.has_key(i): … … 500 509 del self.watch[i] 501 510 502 # parse header 503 header = cxhdr.from_address(addressof(self.recv_buffer)) 504 if header.version < CX_PROTO_VERSION: 511 # watch flags 512 if (header.flags & CX_MSG_ECHO) and (header.flags & CX_FLAGS_FIRST_FRAGMENT): 513 (host,prop,record) = self.mdns.lookup(i) 514 self.send(host,None,record,CX_MSG_DROP) 515 516 if header.flags & CX_MSG_DROP: 505 517 return 506 518 … … 602 614 fragment = 1 603 615 while (offset < len(c)) and (fragment < CX_MAX_FRAGMENT): 604 msg.header.flags = 0616 msg.header.flags = flags 605 617 606 618 if offset == 0:
