diff options
author | ru <ru@FreeBSD.org> | 2000-09-21 06:52:59 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-09-21 06:52:59 +0000 |
commit | 13420271d140fb8ec84ff0b4eee3d93ca165563d (patch) | |
tree | d3127b95dc4cc50f7c5890bce01823764e1006de /lib | |
parent | 5b97c1ba6513d84b8e072c64d729a6c4acc490d4 (diff) | |
download | FreeBSD-src-13420271d140fb8ec84ff0b4eee3d93ca165563d.zip FreeBSD-src-13420271d140fb8ec84ff0b4eee3d93ca165563d.tar.gz |
Fixed the calculations with UDP header length field.
The field is in network byte order and contains the
size of the header.
Reviewed by: brian
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalias/alias_cuseeme.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalias/alias_cuseeme.c b/lib/libalias/alias_cuseeme.c index b1b95f4..7ac1f83 100644 --- a/lib/libalias/alias_cuseeme.c +++ b/lib/libalias/alias_cuseeme.c @@ -70,7 +70,7 @@ AliasHandleCUSeeMeOut(struct ip *pip, struct alias_link *link) struct udphdr *ud; ud = (struct udphdr *)((char *)pip + (pip->ip_hl << 2)); - if(ud->uh_ulen >= sizeof(struct cu_header)) { + if (ntohs(ud->uh_ulen) - sizeof(struct udphdr) >= sizeof(struct cu_header)) { struct cu_header *cu; struct alias_link *cu_link; @@ -104,7 +104,7 @@ AliasHandleCUSeeMeIn(struct ip *pip, struct in_addr original_addr) cu = (struct cu_header *)(ud + 1); oc = (struct oc_header *)(cu + 1); ci = (struct client_info *)(oc + 1); - end = (char *)cu + ud->uh_ulen; + end = (char *)ud + ntohs(ud->uh_ulen); if ((char *)oc <= end) { if(cu->dest_addr) |