Skip to content

IP_DONTFRAG broken on Apple xcode 12.2 #347

@jagerman

Description

@jagerman

Recently libunbound started failing for me on macos with:

[1605563093] libunbound[25390:0] error: setsockopt(..., IP_DONTFRAG, ...) failed: Protocol not available

I tracked this down to the latest version of xcode (12.2) installing and switching to MacOSX 11.0 ("Big Sur") headers, where this macro is apparently now defined:

$ grep IP_DONTFRAG /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include -r
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/netinet/in.h:#define IP_DONTFRAG             28   /* don't fragment packet */

however it doesn't actually work (at least on my macos 10.15 build system) as the setsockopt fails with the error shown above.

I worked around it by patching services/listen_dnsport.c with:

-#  elif defined(IP_DONTFRAG)
+#  elif defined(IP_DONTFRAG) && !defined(__APPLE__)

which fixes my libunbound use case built with this cursed new version of xcode, but I'm not sure whether that is a proper fix for this issue or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions