Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 1 Apr 2013 12:53:11 -0400
From: Rich Felker <dalias@...ifal.cx>
To: simon@...kelleys.org.uk
Cc: musl@...ts.openwall.com
Subject: Breakeage on Linux due to SO_REUSEPORT

Hi,

Back in November, we had a bug report against musl libc due to dnsmasq
failing because we had defined SO_REUSEPORT in the headers, but Linux
did not support it. At the time I just removed the definition, but
we're adding it back now, as Linux has just recently added
SO_REUSEPORT support, and thus the same issue will arise with glibc
(which is just including asm/socket.h and thus getting the kernel's
definition of it) too. I've attached the original bug report thread.

The fundamental problem is that it's not valid to assume SO_REUSEPORT
is supported/working just because it's defined. Instead, the usage
pattern should probably be something like

#ifdef SO_REUSEPORT
	if (setsockopt(s, SO_REUSEPORT, ...)<0 && errno==ENOPROTOOPT)
#endif
	setsockopt(s, SO_REUSEADDR, ...);


Rich

Content of type "message/rfc822" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.