Skip to content

Fix building on systems with musl#10

Merged
rsmarples merged 1 commit intoNetworkConfiguration:masterfrom
pbui:musl-if_ether
Oct 20, 2019
Merged

Fix building on systems with musl#10
rsmarples merged 1 commit intoNetworkConfiguration:masterfrom
pbui:musl-if_ether

Conversation

@pbui
Copy link
Contributor

@pbui pbui commented Oct 19, 2019

musl has its own definition of struct ethhdr, so only include netinet/if_ether.h on systems with GLIBC. For the ARPHDR constants, we must include linux/if_arp.h instead.

This patch was used downstream in void-linux/void-packages#15616.


#include <arpa/inet.h>
#include <net/if.h>
#if defined(__GLIBC__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move thism block to after the network headers and before errno.h with whitespace and a comment to say it's needed for musl?

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing... I've made the request changes. Let me know if you need any other modifications.

src/if-linux.c Outdated
#include <netinet/in.h>
#include <net/route.h>

/* Needed to support compiling with musl */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this comment to your initial commit comment has it has more value:

musl has its own definition of struct ethhdr, so only include
netinet/if_ether.h on systems with GLIBC.
For the ARPHDR constants, we must include linux/if_arp.h instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have changed the comment.

musl has its own definition of struct ethhdr, so only include
netinet/if_ether.h on systems with GLIBC.  For the ARPHDR constants, we
must include linux/if_arp.h instead.
@rsmarples rsmarples merged commit 91792b0 into NetworkConfiguration:master Oct 20, 2019
rsmarples pushed a commit that referenced this pull request Jan 25, 2021
musl has its own definition of struct ethhdr, so only include
netinet/if_ether.h on systems with GLIBC.  For the ARPHDR constants, we
must include linux/if_arp.h instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants