Bug 67075

Summary: Compilation broken on linux 2.6 - unknown type name 'sa_family_t'
Product: systemd Reporter: Jesper Larsen <jesper.larsen>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch

Description Jesper Larsen 2013-07-19 09:46:49 UTC
Created attachment 82673 [details]
Patch

The following commit breaks compilation with Linux kernel headers from 2.6.37.

http://cgit.freedesktop.org/systemd/systemd/commit/?id=2e996f4d4b642c5682c608c9692ad2ffae398ab2

Compilation breaks with the output

In file included from src/nspawn/nspawn.c:42:0: /usr/include/linux/netlink.h:31:2: error: unknown type name 'sa_family_t'

linux/netlink.h includes linux/socket.h for sa_family_t, but it is protected by a #ifdef __KERNEL__

Newer kernels have fixed this issue such that linux/netlink.h is self contained.

A work around is to include linux/netlink.h after sys/socket.h

I have attached a patch that does this, and verified that it fixes compilation on the 2.6.37 kernel.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-07-19 12:29:11 UTC
Applied in http://cgit.freedesktop.org/systemd/systemd/commit/?id=aea38d8.

Normally we wouldn't care about unsupported kernels, but since this just reorders two lines, I don't see why not to apply it.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.