Opened 8 years ago

Closed 6 years ago

#1824 closed defect (fixed)

IfaceMgrTest.sendReceive6 test hangs on OpenBSD

Reported by: muks Owned by: marcin
Priority: medium Milestone: Kea0.8
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

IfaceMgrTest?.sendReceive6 test hangs on OpenBSD 5.0 on x86_64:

[ RUN      ] IfaceMgrTest.sendReceive6
IfaceMgr initialization.
Interface detection is not implemented yet. Reading interfaces.txt file instead.
Please use format: interface-name link-local-address
Detected interface lo0/::1
Creating UDP6 socket on lo0/3 ::1/port=10547
Created socket 6 on lo0/::1/port=10547
Creating UDP6 socket on lo0/3 ::1/port=10546
Created socket 7 on lo0/::1/port=10546
Send packet failed.
Sent 128 bytes over socket 6 on lo0/3 interface:  dst=::1, src=::
Trying to receive over UDP6 socket 6 bound to ::1/port=10547 on lo0/3

Subtickets

Change History (15)

comment:1 Changed 8 years ago by jinmei

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 8 years ago by vorner

  • Sub-Project changed from DNS to DHCP

This very much looks like a DHCP task. Should we move it from the next-sprint-proposed somewhere?

comment:3 Changed 8 years ago by jelte

Note, this test will be disabled on the openbsd testbuilder (through gtest filter). If this ticket is fixed, please make sure we don't forget to re-enable it

comment:4 Changed 8 years ago by jelte

  • Milestone Next-Sprint-Proposed deleted

comment:5 Changed 7 years ago by stephen

  • Milestone set to DHCP Outstanding Tasks

comment:6 Changed 7 years ago by stephen

  • Milestone changed from DHCP Outstanding Tasks to Sprint-DHCP-20130509

comment:7 Changed 7 years ago by stephen

  • Milestone changed from Sprint-DHCP-20130509 to DHCP Outstanding Tasks

comment:8 Changed 6 years ago by tomek

  • Milestone changed from DHCP Outstanding Tasks to DHCP-Kea1.0-alpha

Does the issue still occurring? The code has been refactored many times since this ticket was submitted.

comment:9 Changed 6 years ago by marcin

  • Owner set to marcin
  • Status changed from new to assigned

comment:10 Changed 6 years ago by marcin

I reproduced the test failure on OpenBSD 5.2, using bind10 compiled from master branch, commit 833deb1fced98bc568ab238a8e4f6f876ca97283

The test doesn't hang but sendmsg returns an error:

[ RUN      ] IfaceMgrTest.sendReceive6
terminate called after throwing an instance of 'isc::dhcp::SocketWriteError'
  what():  Pkt6 send failed: sendmsg() returned -1
Abort trap (core dumped) 
FAIL: libdhcp++_unittests

comment:11 Changed 6 years ago by marcin

  • Owner changed from marcin to UnAssigned
  • Status changed from assigned to reviewing

There is a bug on OpenBSD which causes sendmsg to fail if CMSG_LEN is used to calculate the message length. The current workaround for this is to use CMSG_SPACE which includes message padding and works fine on OpenBSD and other OSes.

Proposed ChangeLog:

XXX.	[bug]		marcin
	libdhcp++: Used the CMSG_SPACE instead of CMSG_LEN macro to calculate
	msg_controllen field of the DHCPv6 message. Use of CMSG_LEN causes
	sendmsg failures on OpenBSD due to a bug on OpenBSD.
	(Trac #1824, git aabc)

comment:12 Changed 6 years ago by tomek

  • Owner changed from UnAssigned to tomek

comment:13 Changed 6 years ago by jreed

Also please reference the bug in OpenBSD here in this ticket (maybe a URL to a mailing list posting?). I don't think they have a bug ID tracking, but if they do, then reference in the ChangeLog? entry also?

comment:14 Changed 6 years ago by tomek

  • Owner changed from tomek to marcin

Changes look fine, but please include OpenBSD bug # in the changelog (or another pointer to specific bug).

Please merge.

comment:15 Changed 6 years ago by marcin

  • Resolution set to fixed
  • Status changed from reviewing to closed

The OpenBSD bug referred in this ticket has been reported/discussed here:
http://www.archivum.info/mailing.openbsd.bugs/2009-02/00017///%20kernel-6080-msg_controllen-of-IPV6_PKTINFO.html

The fix has been merged to master with commit: 39c9499d001a98c8d2f5792563c28a5eb2cc5fcb

Note: See TracTickets for help on using tickets.