Opened 15 years ago

Closed 5 years ago

#2632 closed bug (fixed)

Possible redefinition for struct sockaddr_in, related to IPv6

Reported by: andreasf Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Network & Internet/IPv6 Version: R1/pre-alpha1
Keywords: Cc: phoudoin
Blocked By: Blocking:
Platform: All


The POSIX headers netinet/in.h and netinet/NetAdress.h appear to duplicate some definitions.

This somehow leads to a redefinition error for struct sockaddr_in when compiling Git with IPv6 support.

Change History (11)

comment:1 by andreasf, 15 years ago

Sorry. The error does occur, with the headers I'm a little wrong: netinet/in.h is not in posix but in legacy, in6.h is in posix though, complicated...

comment:2 by andreasf, 15 years ago

Really sorry for the confusion, but my original report was right. Spotlight just managed to delete some files while I was looking at them.

There are two files in headers/posix/netinet/in/, in.h and NetAddress.h, for which a diff shows no difference at all. has no mention of a NetAddress.h, so I suggest we move or drop it.

comment:3 by axeld, 15 years ago

Resolution: invalid
Status: newclosed

Not sure what your system messed up there, but NetAddress.h is in headers/os/net/, and not in posix/netinet. Also, it has completely different contents than in.h, it just happens to include it.

If you still find something wrong with the current setup, feel free to reopen this bug, though; maybe I just didn't understand you correctly :-)

comment:4 by andreasf, 15 years ago

Resolution: invalid
Status: closedreopened
Summary: Duplicate definitions in netinet/in.h and netinet/NetAddress.hPossible redefinition for struct sockaddr_in, related to IPv6

Git confirms that some files have been wrongly moved around somehow on my Mac, yeah. But that's the wrong explanation only.

The problem of struct sockaddr_in being redefined occurs while compiling on a Haiku system, so that is still a problem. Unfortunately in this case I have absolutely no explanation at hand. I checked the header guards, and they looked okay.

I am aware that IPv6 is not or not fully supported yet, but in that case I'd expect to either find that out at runtime, or at compile-time by missing IPv6 structs, functions etc. Not by conflicts with otherwise fine IPv4 stuff.

comment:5 by anevilyak, 15 years ago

Just curious, what's the testcase that's causing it to fail? I've compiled various other pieces of network code without issues on Haiku itself, so it'd be helpful to have some more specifics here.

comment:6 by andreasf, 15 years ago

Compiling Git (git.git master, post 1.6.0-rc3) without setting NO_IPV6=YesPlease in the Makefile.

comment:7 by scottmc, 13 years ago

Component: - GeneralNetwork & Internet/IPv6

comment:8 by phoudoin, 13 years ago

Cc: phoudoin added

comment:9 by luroh, 9 years ago

Milestone: R1Unscheduled

Moving IPv6 related tickets out of R1 milestone.

comment:10 by axeld, 6 years ago

Owner: changed from axeld to nobody
Status: reopenedassigned

comment:11 by waddlesplash, 5 years ago

Resolution: fixed
Status: assignedclosed

There is only one definition of sockaddr_in in the tree now.

Note: See TracTickets for help on using tickets.