1
0
mirror of https://github.com/zu1k/nali.git synced 2025-01-22 21:29:02 +08:00

fix ipv4 in ipv6 parse

Signed-off-by: zu1k <i@lgf.im>
This commit is contained in:
zu1k 2021-12-17 13:31:08 +08:00
parent ba5e887bb5
commit 9f8be105fa
No known key found for this signature in database
GPG Key ID: AF2CF33D9FE3F0C6
2 changed files with 2 additions and 9 deletions

View File

@ -4,10 +4,9 @@ import (
"log"
"os"
"github.com/zu1k/nali/internal/constant"
"github.com/spf13/cobra"
"github.com/zu1k/nali/internal/app"
"github.com/zu1k/nali/internal/constant"
)
var rootCmd = &cobra.Command{

View File

@ -25,13 +25,7 @@ func ParseLine(line string) Entities {
}
for _, e := range ip6sLoc {
text := line[e[0]:e[1]]
if ip, _ := netip.ParseAddr(text); ip.Is4In6() {
tmp = append(tmp, &Entity{
Loc: e,
Type: TypeIPv4,
Text: ip.Unmap().String(),
})
} else {
if ip, _ := netip.ParseAddr(text); !ip.Is4In6() {
tmp = append(tmp, &Entity{
Loc: e,
Type: TypeIPv6,