mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix review comments
Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
This commit is contained in:
parent
9376cd3c63
commit
79a76217db
2 changed files with 4 additions and 6 deletions
|
@ -55,13 +55,13 @@ func lookupFwMethod(fwMethod uint32) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkDestination(t *testing.T, i *Handle, s *Service, d *Destination, checkPresent bool) {
|
func checkDestination(t *testing.T, i *Handle, s *Service, d *Destination, checkPresent bool) {
|
||||||
dstFound := false
|
var dstFound bool
|
||||||
|
|
||||||
dstArray, err := i.GetDestinations(s)
|
dstArray, err := i.GetDestinations(s)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
for _, dst := range dstArray {
|
for _, dst := range dstArray {
|
||||||
if dst.Address.String() == d.Address.String() && dst.Port == d.Port && lookupFwMethod(dst.ConnectionFlags) == lookupFwMethod(d.ConnectionFlags) {
|
if dst.Address.Equal(d.Address) && dst.Port == d.Port && lookupFwMethod(dst.ConnectionFlags) == lookupFwMethod(d.ConnectionFlags) {
|
||||||
dstFound = true
|
dstFound = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ func checkService(t *testing.T, i *Handle, s *Service, checkPresent bool) {
|
||||||
svcArray, err := i.GetServices()
|
svcArray, err := i.GetServices()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
svcFound := false
|
var svcFound bool
|
||||||
|
|
||||||
for _, svc := range svcArray {
|
for _, svc := range svcArray {
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,6 @@ done:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, m := range msgs {
|
for _, m := range msgs {
|
||||||
|
|
||||||
if m.Header.Seq != req.Seq {
|
if m.Header.Seq != req.Seq {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -235,7 +234,6 @@ done:
|
||||||
if m.Header.Type == syscall.NLMSG_DONE {
|
if m.Header.Type == syscall.NLMSG_DONE {
|
||||||
break done
|
break done
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Header.Type == syscall.NLMSG_ERROR {
|
if m.Header.Type == syscall.NLMSG_ERROR {
|
||||||
error := int32(native.Uint32(m.Data[0:4]))
|
error := int32(native.Uint32(m.Data[0:4]))
|
||||||
if error == 0 {
|
if error == 0 {
|
||||||
|
@ -396,7 +394,7 @@ func (i *Handle) doGetServicesCmd(svc *Service) ([]*Service, error) {
|
||||||
for _, msg := range msgs {
|
for _, msg := range msgs {
|
||||||
srv, err := i.parseService(msg)
|
srv, err := i.parseService(msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res = append(res, srv)
|
res = append(res, srv)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue