added ipv6 compatability to other commands
This commit is contained in:
@@ -43,7 +43,12 @@ func Server() error{
|
||||
r.POST("/IpTable", func(c *gin.Context) {
|
||||
// Getting IPV4 address of client
|
||||
var ClientHost p2p.IpAddress
|
||||
ClientHost.Ipv4 = c.ClientIP()
|
||||
|
||||
if p2p.Ip4or6(c.ClientIP()) == "version 6" {
|
||||
ClientHost.Ipv6 = c.ClientIP()
|
||||
} else {
|
||||
ClientHost.Ipv4 = c.ClientIP()
|
||||
}
|
||||
|
||||
// Variable to store IP table information
|
||||
var IPTable p2p.IpAddresses
|
||||
@@ -77,12 +82,6 @@ func Server() error{
|
||||
c.String(http.StatusOK, fmt.Sprint(err))
|
||||
}
|
||||
|
||||
// Called step to remove duplicate IP addresses
|
||||
err = p2p.RemoveDuplicates()
|
||||
if err != nil {
|
||||
c.String(http.StatusOK, fmt.Sprint(err))
|
||||
}
|
||||
|
||||
// Reads IP addresses from ip table
|
||||
IpAddresses,err := p2p.ReadIpTable()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user