Adding the IPv6 to the manpage. - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 30a8aaeeec4fda1bcee8fb9419bb0a924241fd67
(DIR) parent 0989e87037363bc4977b23da4304c51284026a14
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 13 Apr 2013 21:25:04 +0200
Adding the IPv6 to the manpage.
Diffstat:
M geomyidae.8 | 8 ++++++++
M main.c | 10 +++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/geomyidae.8 b/geomyidae.8
@@ -11,6 +11,8 @@
.Sh SYNOPSIS
.Nm
.Bk -words
+.Op Fl 4
+.Op Fl 6
.Op Fl d
.Op Fl l Ar logfile
.Op Fl v Ar loglevel
@@ -77,6 +79,12 @@ source archive.
geomyidae options and default settings:
.Bl -tag -width Ds
.
+.It Fl 4
+Only use IPv4.
+.
+.It Fl 6
+Only use IPv6.
+.
.It Fl d
Don't fork into background
.
(DIR) diff --git a/main.c b/main.c
@@ -395,19 +395,23 @@ main(int argc, char *argv[])
if(bindip)
hints.ai_flags |= AI_CANONNAME;
+ listfd = -1;
if(v6) {
hints.ai_family = PF_INET6;
listfd = getlistenfd(&hints, bindip, port);
if(!v4 && listfd < 0) {
- perror("getlistenfd");
+ perror("getlistenfd6");
return 1;
}
+ if(listfd < 0)
+ perror("getlistenfd6");
}
- if(v4) {
+ if(v4 && listfd < 0) {
+ printf("In v4\n");
hints.ai_family = PF_INET;
listfd = getlistenfd(&hints, bindip, port);
if(listfd < 0) {
- perror("getlistenfd");
+ perror("getlistenfd4");
return 1;
}
}