(self, ancbufsize, ignoreflags=0)
| 4628 | # Tests for proper handling of truncated ancillary data |
| 4629 | |
| 4630 | def checkHopLimitTruncatedHeader(self, ancbufsize, ignoreflags=0): |
| 4631 | # Receive hop limit into ancbufsize bytes of ancillary data |
| 4632 | # space, which should be too small to contain the ancillary |
| 4633 | # data header (if ancbufsize is None, pass no second argument |
| 4634 | # to recvmsg()). Check that data is MSG, MSG_CTRUNC is set |
| 4635 | # (unless included in ignoreflags), and no ancillary data is |
| 4636 | # returned. |
| 4637 | self.serv_sock.setsockopt(socket.IPPROTO_IPV6, |
| 4638 | socket.IPV6_RECVHOPLIMIT, 1) |
| 4639 | self.misc_event.set() |
| 4640 | args = () if ancbufsize is None else (ancbufsize,) |
| 4641 | msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, |
| 4642 | len(MSG), *args) |
| 4643 | |
| 4644 | self.assertEqual(msg, MSG) |
| 4645 | self.checkRecvmsgAddress(addr, self.cli_addr) |
| 4646 | self.assertEqual(ancdata, []) |
| 4647 | self.checkFlags(flags, eor=True, checkset=socket.MSG_CTRUNC, |
| 4648 | ignore=ignoreflags) |
| 4649 | |
| 4650 | @requireAttrs(socket, "IPV6_RECVHOPLIMIT", "IPV6_HOPLIMIT") |
| 4651 | def testCmsgTruncNoBufSize(self): |
no test coverage detected