lkml.org 
[lkml]   [2000]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject2.2.14: recvfrom() bug or feature?
I'm tracking down a possible bug in RH6.1 routed daemon. It does a

recvfrom(fd, &inbuf, sizeof (inbuf), 0, &from, &fromlen)

and it appears that even when `from' is cleared in advance the from->sa_data
contains not only a 2 byte port number + source IP but also some trailing
garbage afterwards as it seems to me. Is this a bug or a feature?

Example data:

(gdb) p fromlen
$4 = 16
(gdb) p from
$5 = {sa_family = 2, sa_data = "\002\bÁ°\231@\000 üÁ %pÂ"}
This roughly translates to:

\002\b = 520 (source port: route service)
Á°\231@ = 193.176.153.64 (source IP: ppp1 peer)

and the remaining 8 bytes are a mistery and seem to block proper operation of
routed (expects zeroes instead when matching it with interface addresses):

hex 00 20 fc c1 7c 25 70 c2
dec 0 32 252 193 124 37 112 194

--
Frank

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.338 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site