diff options
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | etc/bash_completion.d/vyatta-cfg | 1 | ||||
-rwxr-xr-x | scripts/init/vyos-router | 37 | ||||
-rwxr-xr-x | scripts/vyatta-save-config.pl | 8 |
4 files changed, 45 insertions, 2 deletions
diff --git a/debian/control b/debian/control index 0d821c5..f5b686d 100644 --- a/debian/control +++ b/debian/control @@ -19,6 +19,7 @@ Depends: sed (>= 4.1.5), libvyatta-cfg1 (>=${binary:Version}), unionfs-fuse, systemd, + uuid-runtime, libboost-filesystem1.67.0 | libboost-filesystem1.74.0, libapt-pkg4.12 | libapt-pkg5.0 | libapt-pkg6.0, ${perl:Depends}, ${shlibs:Depends} diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 8fc92e9..0226ed9 100644 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -350,6 +350,7 @@ vyatta_compare_complete () [ $COMP_CWORD -eq 1 -a -z "$current_prefix" ]; then echo echo "Possible completions:" + echo -e " commands\tCompare working & active configurations and show \"set\" commands" echo -e " <Enter>\tCompare working & active configurations" echo -e " saved\t\tCompare working & saved configurations" echo -e " <N>\t\tCompare working with revision N" diff --git a/scripts/init/vyos-router b/scripts/init/vyos-router index 409ca20..3283444 100755 --- a/scripts/init/vyos-router +++ b/scripts/init/vyos-router @@ -226,6 +226,40 @@ security_reset () find /etc/swanctl -type f | xargs rm -f } +# XXX: T3885 - generate persistend DHCPv6 DUID (Type4 - UUID based) +gen_duid () +{ + DUID_FILE="/var/lib/dhcpv6/dhcp6c_duid" + UUID_FILE="/sys/class/dmi/id/product_uuid" + UUID_FILE_ALT="/sys/class/dmi/id/product_serial" + if [ ! -f ${UUID_FILE} ] && [ ! -f ${UUID_FILE_ALT} ]; then + return 1 + fi + + # DUID is based on the BIOS/EFI UUID. We omit additional - characters + if [ -f ${UUID_FILE} ]; then + UUID=$(cat ${UUID_FILE} | tr -d -) + fi + if [ -z ${UUID} ]; then + UUID=$(uuidgen --sha1 --namespace @dns --name $(cat ${UUID_FILE_ALT}) | tr -d -) + fi + # Add DUID type4 (UUID) information + DUID_TYPE="0004" + + # The length-information (as per RFC6355 UUID is 128 bits long) is in big-endian + # format - beware when porting to ARM64. The length field consists out of the + # UUID (128 bit + 16 bits DUID type) resulting in hex 12. + DUID_LEN="0012" + if [ "$(echo -n I | od -to2 | head -n1 | cut -f2 -d" " | cut -c6 )" -eq 1 ]; then + # true on little-endian (x86) systems + DUID_LEN="1200" + fi + + for i in $(echo -n ${DUID_LEN}${DUID_TYPE}${UUID} | sed 's/../& /g'); do + echo -ne "\x$i" + done > ${DUID_FILE} +} + start () { # some legacy directories migrated over from old rl-system.init @@ -249,6 +283,9 @@ start () # Clear out Debian APT source config file empty /etc/apt/sources.list + # Generate DHCPv6 DUID + gen_duid || log_failure_msg "could not generate DUID" + # Fixup for FRR # In 5.1 master, zebra thinks existence of /var/run/netns is # a requirement for netns support diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl index 9c973d9..9f1ec5c 100755 --- a/scripts/vyatta-save-config.pl +++ b/scripts/vyatta-save-config.pl @@ -57,9 +57,13 @@ if ($save_file =~ /^[^\/]\w+:\//) { if ($save_file =~ /^(\w+):\/\/\w/) { $mode = 'url'; $proto = lc($1); - if ($proto eq "scp") {} + if ($proto eq "ftp") {} + elsif ($proto eq "ftps") {} + elsif ($proto eq "http") {} + elsif ($proto eq "https") {} + elsif ($proto eq "scp") {} elsif ($proto eq "sftp") {} - elsif ($proto eq "ftp") {} + elsif ($proto eq "ssh") {} elsif ($proto eq "tftp") {} else { print "Invalid URL protocol [$proto]\n"; |