[MacPorts] #67982: py*-grpcio: missing includes for if_nametoindex

MacPorts noreply at macports.org
Fri Aug 18 06:59:23 UTC 2023


#67982: py*-grpcio: missing includes for if_nametoindex
--------------------+--------------------
 Reporter:  jmroot  |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  grpc
--------------------+--------------------
 On macOS (and also FreeBSD), using `if_nametoindex` is
 [https://man.freebsd.org/cgi/man.cgi?query=if_nametoindex&apropos=0&sektion=3&manpath=FreeBSD+13.2-STABLE&arch=default&format=html
 documented] to require these includes:
 {{{
      #include <sys/types.h>
      #include <sys/socket.h>
      #include <net/if.h>
 }}}
 But `grpc_if_nametoindex_posix.cc` only includes `net/if.h`, and depending
 on the exact version of your libc headers can fail to compile like this:
 {{{
 In file included from src/core/lib/iomgr/grpc_if_nametoindex_posix.cc:26:
 /usr/include/net/if.h:306:19: error: field has incomplete type 'struct
 sockaddr'
                 struct  sockaddr ifru_addr;
                                  ^
 }}}

 Any fix should be sent upstream of course, but I'm not sure if
 unconditionally adding these extra includes could cause problems on other
 platforms they support.

-- 
Ticket URL: <https://trac.macports.org/ticket/67982>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list