[PATCH] IPv6 support for ggate
From: Craig Boston (craig_at_tobuj.gank.org)
Date: 10/28/05
- Previous message: M. Warner Losh: "Re: locking in a device driver"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 27 Oct 2005 23:04:50 -0500 To: freebsd-hackers@freebsd.org
Hi hackers:
Today I had a need to run ggate over an IPv6-only network. I was a
little surprised that it didn't seem to like that, but not discouraged.
So here's a patch that adds IPv6 support for ggated(8) and ggatec(8)
;)
Overview:
* Standardizes on sockaddr_storage for both sockets and addresses
* A few semantic differences for certain functions due to the above
change (ip2str, g_gate_str2ip)
* ggated by default listens on both v4 and v6 sockets (uses select loop
instead of accept loop). You can listen on v4 only with "-a 0.0.0.0"
or v6 only with "-a ::", or of course bind to a specific address
* Use getaddrinfo in place of gethostbyname, and parse addresses with
inet_pton
* All address are stored internally in network byte order now. Mask
comparisons should be independent of byte order since it's purely a
"vertical" comparison.
Things I'm not entirely happy with:
* More AF_INET/AF_INET6 conditional code than I'd have liked to add.
Unfortunately there doesn't seem to be an easy way to be protocol
neutral with a lot of the socket functions.
* The v6 part of countmask is really ugly and complicated. I need to
check the ifconfig source and see if there's any standard way for
converting a /nnn mask to a binary mask.
* When resolving DNS names, it will only use the first entry if there
are multiple. It technically always had this problem, but it's more
noticeable now. Networks are more likely to have names with both a v4
and v6 record than to have multiple v4 addresses. Fixing this the
'right way' would require significantly more invasive changes.
Other than that, I was running with this patch for most of the afternoon
with great success. Now I just need to write a kernel mode ggatec so I
can mount root over ggate :P
-- Craig
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- text/plain attachment: ggate.ipv6.diff
- Previous message: M. Warner Losh: "Re: locking in a device driver"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|