DragonFly commits List (threaded) for 2004-06
cvs commit: src/sys/netinet tcp_subr.c
dillon 2004/06/24 00:45:22 PDT
DragonFly src repository
The route table treats sockaddr data as opaque, which means that the unused
fields in the structure passed to rtalloc() MUST BE ZERO.
The syncache code allocates a governing struct syncache structure which
contains an embedded struct route, but it does not zero this structure.
When used in a mixed IPV4/IPV6 environment, it is possible for a structure
to be allocated for IPV4 whos unused fields for the route lookup (e.g.
sin_port and sin_zero) may contain garbage. This screws up the route
table lookup and causes the wrong route to be returned.
I believe the proper fix in this case is to rewrite the route table code,
but since that would take a very long time the fix I am committing is
to have tcp_rtlookup() zero out the sockaddr_in before it builds it for
the rtalloc() call.
Reported-by: Richard Nyberg <rnyberg@xxxxxxxx>
With-help-from: Hiten Pandya <hmp@xxxxxxxx>
Revision Changes Path
1.34 +10 -0 src/sys/netinet/tcp_subr.c