mirror of
https://github.com/minio/minio.git
synced 2024-12-27 15:45:55 -05:00
Merge pull request #493 from fkautz/pr_out_switching_back_to_bigendian
This commit is contained in:
commit
f94d9db4f7
@ -17,6 +17,7 @@
|
|||||||
package quota
|
package quota
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/binary"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
@ -70,12 +71,7 @@ func (p longIP) IptoUint32() (result uint32) {
|
|||||||
if ip == nil {
|
if ip == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
q0 := uint32(ip[0]) << 24
|
return binary.BigEndian.Uint32(ip)
|
||||||
q1 := uint32(ip[1]) << 16
|
|
||||||
q2 := uint32(ip[2]) << 8
|
|
||||||
q3 := uint32(ip[3])
|
|
||||||
result = q0 + q1 + q2 + q3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServeHTTP is an http.Handler ServeHTTP method
|
// ServeHTTP is an http.Handler ServeHTTP method
|
||||||
|
Loading…
Reference in New Issue
Block a user