Commit 33e96693 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

net/udp: getfrag: fix frag preparation status

This fixes a regression introduced by #a69c4ac5

, making the UDP stack
basically unusable since no xmit could ever take place due to the
wrong return value.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent e972e78e
...@@ -553,8 +553,10 @@ static int rt_udp_getfrag(const void *p, unsigned char *to, ...@@ -553,8 +553,10 @@ static int rt_udp_getfrag(const void *p, unsigned char *to,
// We should optimize this function a bit (copy+csum...)! // We should optimize this function a bit (copy+csum...)!
if (offset) if (offset) {
return rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen, to, fraglen); ret = rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen, to, fraglen);
return ret < 0 ? ret : 0;
}
/* Checksum of the complete data part of the UDP message: */ /* Checksum of the complete data part of the UDP message: */
for (i = 0; i < ufh->iovlen; i++) { for (i = 0; i < ufh->iovlen; i++) {
...@@ -565,7 +567,7 @@ static int rt_udp_getfrag(const void *p, unsigned char *to, ...@@ -565,7 +567,7 @@ static int rt_udp_getfrag(const void *p, unsigned char *to,
ret = rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen, ret = rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen,
to + sizeof(struct udphdr), to + sizeof(struct udphdr),
fraglen - sizeof(struct udphdr)); fraglen - sizeof(struct udphdr));
if (ret) if (ret < 0)
return ret; return ret;
/* Checksum of the udp header: */ /* Checksum of the udp header: */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment