Bug 264625 - Including <arpa/inet.h> and <netinet/if_ether.h> causes unknown type name 'u_char'
Summary: Including <arpa/inet.h> and <netinet/if_ether.h> causes unknown type name 'u_...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 13.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-12 06:55 UTC by Yuri Victorovich
Modified: 2022-06-12 15:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2022-06-12 06:55:22 UTC
The nemesis project includes these headers (https://github.com/libnet/nemesis/blob/master/src/nemesis-proto_igmp.c#L9) for the ETHER_MAP_IP_MULTICAST macro here: https://github.com/libnet/nemesis/blob/master/src/nemesis-proto_igmp.c#L68

This causes unknown type names errors like this:
> /usr/include/net/ethernet.h:61:2: error: unknown type name 'u_char'; did you mean 'char'?
>         u_char  ether_dhost[ETHER_ADDR_LEN];
>         ^

I am not sure what's wrong here. Are these headers wrong headers for this macro? It doesn't have a manpage.
Comment 1 Willem Jan Withagen 2022-06-12 09:51:37 UTC
(In reply to Yuri Victorovich from comment #0)

# man inet

tels you that it requires:
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <netinet/in.h>
     #include <arpa/inet.h>

So perhaps that fixes your problem.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-12 15:15:30 UTC
(In reply to Willem Jan Withagen from comment #1)

Jan,

These headers though don't define the ETHER_MAP_IP_MULTICAST macro.

Perhaps the headers from multicast(4) should have helped but they also fail for some other reason, see bug#264635


Yuri