Skip to content

Commit

Permalink
pythonGH-107812: extend socket's netlink support to FreeBSD (python…
Browse files Browse the repository at this point in the history
  • Loading branch information
igalic authored Aug 10, 2023
1 parent 2ec16fe commit f50c172
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Extend socket's netlink support to the FreeBSD platform.
2 changes: 2 additions & 0 deletions Modules/socketmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ typedef int socklen_t;
# include <asm/types.h>
# endif
# include <linux/netlink.h>
#elif defined(HAVE_NETLINK_NETLINK_H)
# include <netlink/netlink.h>
#else
# undef AF_NETLINK
#endif
Expand Down
15 changes: 15 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,8 @@ AC_CHECK_HEADERS([net/if.h], [], [],
])

# On Linux, netlink.h requires asm/types.h
AC_CHECK_HEADERS([linux/netlink.h], [], [], [
# On FreeBSD, netlink.h is located in netlink/netlink.h
AC_CHECK_HEADERS([linux/netlink.h netlink/netlink.h], [], [], [
#ifdef HAVE_ASM_TYPES_H
#include <asm/types.h>
#endif
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H

/* Define to 1 if you have the <netlink/netlink.h> header file. */
#undef HAVE_NETLINK_NETLINK_H

/* Define to 1 if you have the <netpacket/packet.h> header file. */
#undef HAVE_NETPACKET_PACKET_H

Expand Down

0 comments on commit f50c172

Please sign in to comment.