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:
parent
ba5e887bb5
commit
9f8be105fa
@ -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{
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user