diff options
Diffstat (limited to 'usr.sbin/setkey/scriptdump.pl')
-rw-r--r-- | usr.sbin/setkey/scriptdump.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/setkey/scriptdump.pl b/usr.sbin/setkey/scriptdump.pl index 5df9b4f..aa36544 100644 --- a/usr.sbin/setkey/scriptdump.pl +++ b/usr.sbin/setkey/scriptdump.pl @@ -20,8 +20,8 @@ open(IN, "setkey -D |") || die; foreach $_ (<IN>) { if (/^[^\t]/) { ($src, $dst) = split(/\s+/, $_); - } elsif (/^\t(esp|ah) mode=(\S+) spi=(\d+).*replay=(\d+)/) { - ($proto, $ipsecmode, $spi, $replay) = ($1, $2, $3, $4); + } elsif (/^\t(esp|ah) mode=(\S+) spi=(\d+).*reqid=(\d+)/) { + ($proto, $ipsecmode, $spi, $reqid) = ($1, $2, $3, $4); } elsif (/^\tE: (\S+) (.*)/) { $ealgo = $1; $ekey = $2; @@ -32,17 +32,19 @@ foreach $_ (<IN>) { $akey = $2; $akey =~ s/\s//g; $akey =~ s/^/0x/g; - } elsif (/^\tstate=/) { + } elsif (/^\treplay=(\d+) flags=(0x\d+) state=/) { print "$mode $src $dst $proto $spi -m $ipsecmode"; - print " -r $replay" if $replay; + $replay = $1; + print " -u $reqid" if $reqid; if ($mode eq 'add') { + print " -r $replay" if $replay; if ($proto eq 'esp') { print " -E $ealgo $ekey" if $ealgo; print " -A $aalgo $akey" if $aalgo; } elsif ($proto eq 'ah') { print " -A $aalgo $akey" if $aalgo; } - } + } print ";\n"; $src = $dst = $upper = $proxy = ''; |