summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Tomanek <stefan.tomanek@wertarbyte.de>2016-08-05 16:54:12 +0200
committerStefan Tomanek <stefan.tomanek@wertarbyte.de>2016-08-05 16:54:12 +0200
commitfc592a7834337dee6ede882474722b85de34c1a0 (patch)
treec4f5a8a39461de5daa6ab578b187096c89e04ec5
parent09703184a6f44a18fd35b1153dd073097ba1c95c (diff)
parent6400c3feca38c1f12045c0979163c18b7ef51911 (diff)
Merge tag 'release/1.0.3' into debian
-rw-r--r--Makefile2
-rw-r--r--bash_completion/ipv6pref18
-rw-r--r--ipv6pref.pod19
-rwxr-xr-xscripts/ipv6pref.sh17
-rw-r--r--version.inc2
5 files changed, 54 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 32e9c7e..276aa0e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ VERSION:=$(shell cat version.inc)
all: $(LIBRARY) $(MANPAGE)
$(LIBRARY): ipv6pref.c
- $(CC) $(CFLAGS) $< $(LDFLAGS) -ldl -shared -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS) -ldl -fPIC -shared -o $@
%.1: %.pod
pod2man \
diff --git a/bash_completion/ipv6pref b/bash_completion/ipv6pref
new file mode 100644
index 0000000..e0c8eef
--- /dev/null
+++ b/bash_completion/ipv6pref
@@ -0,0 +1,18 @@
+# bash completion for ipv6pref(1)
+
+_ipv6pref() {
+ local cur prev words cword
+ _init_completion || return
+
+ for (( i=1; i <= COMP_CWORD; i++ )); do
+ if [[ ${COMP_WORDS[i]} != -* ]]; then
+ _command_offset $i
+ return
+ fi
+ done
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-p -t' -- "$cur" ) )
+ return
+ fi
+
+} && complete -F _ipv6pref ipv6pref.sh ipv6pref v6pub v6tmp
diff --git a/ipv6pref.pod b/ipv6pref.pod
index 7ca7240..38e0533 100644
--- a/ipv6pref.pod
+++ b/ipv6pref.pod
@@ -6,7 +6,7 @@ ipv6pref -- set IPv6 address selection preference
=head1 SYNOPSIS
-B<ipv6pref> F<< <cmd> >>
+B<ipv6pref> [B<-p> | B<-t>] F<< <cmd> >>
B<v6pub> F<< <cmd> >>
@@ -24,6 +24,23 @@ IPv6 Privacy Extensions.
=back
+=head1 OPTIONS
+
+=over
+
+=item B<-p>
+
+Instruct the called program to use the public IPv6 address for outgoing
+connections. This is the default if the wrapper is called by the name B<v6pub>.
+
+=item B<-t>
+
+Instruct the called program to use the temporary, randomly generated IPv6
+addresses for outgoing connections. This is the default if the wrapper is
+called by the name B<v6tmp>.
+
+=back
+
=head1 AUTHOR
Stefan Tomanek E<lt>stefan.tomanek@wertarbyte.deE<gt>
diff --git a/scripts/ipv6pref.sh b/scripts/ipv6pref.sh
index a7e583b..3d0af01 100755
--- a/scripts/ipv6pref.sh
+++ b/scripts/ipv6pref.sh
@@ -39,17 +39,32 @@ if ! [ "${IPV6PREF_WAS_HERE:-}" ]; then
export LD_PRELOAD="${LIB} ${LD_PRELOAD}"
fi
+ # check wrapper name
WRAPPER="$(basename $0)"
case "$WRAPPER" in
v6pub)
- dbg "Using public address"
+ dbg "Using public address by default"
export IPV6PREF_ADDR="pub"
;;
v6tmp)
+ dbg "Using temporary address by default"
+ export IPV6PREF_ADDR="tmp"
+ ;;
+ esac
+ # check for argument
+ case "${1:-}" in
+ "-p")
+ dbg "Using public address"
+ export IPV6PREF_ADDR="pub"
+ shift
+ ;;
+ "-t")
dbg "Using temporary address"
export IPV6PREF_ADDR="tmp"
+ shift
;;
esac
+
fi
IPV6PREF_WAS_HERE=1 exec "$@"
diff --git a/version.inc b/version.inc
index 6d7de6e..21e8796 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-1.0.2
+1.0.3