Message ID | 1417442928-20680-10-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | New |
Headers | show |
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5c0a44c..0f2dc33 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -561,7 +561,7 @@ int odp_pktio_set_mtu(odp_pktio_t id, int mtu) return -1; } - if (entry->s.pkt_sock_mmap.sockfd) + if (entry->s.pkt_sock_mmap.sockfd > -1) sockfd = entry->s.pkt_sock_mmap.sockfd; else sockfd = entry->s.pkt_sock.sockfd; @@ -591,7 +591,7 @@ int odp_pktio_mtu(odp_pktio_t id) return -1; } - if (entry->s.pkt_sock_mmap.sockfd) + if (entry->s.pkt_sock_mmap.sockfd > -1) sockfd = entry->s.pkt_sock_mmap.sockfd; else sockfd = entry->s.pkt_sock.sockfd;
Socket can be 0 and it's accounted in previews patch. Correct that function too. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/odp_packet_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)