
|
[openbeosnetteam]
||
[Date Prev]
[07-2006 Date Index]
[Date Next]
||
[Thread Prev]
[07-2006 Thread Index]
[Thread Next]
[openbeosnetteam] Information about routes and interfaces for protocols
- From: Oliver Tappe <openbeos@xxxxxxxxxxxxxxx>
- To: openbeosnetteam@xxxxxxxxxxxxx
- Date: Sun, 30 Jul 2006 19:50:38 +0200
Hi there,
now that a first version of UDP is at least basically working, I'd like to
continue with filling in some holes in the stack:
UDP needs to know the IP of the outgoing interface when sending data.
Normally, only IP would determine this (as a result of the routing decision),
but since UDP requires it, too, I have implemented a workaround that grabs
the domain (via get_domain()) and then fetches the route for the given
destination address. Now that UDP knows the route, it can copy over the
source address from the route.
This works, but having to fetch the domain and the route from UDP (jumping
from the transport layer directly into the datalink layer) isn't really nice,
or am I just being too pedantic, here?
I suspect that BONE is solving this with the get_route() function that is
missing in our net_protocol_module_info. Axel, given the fact that you left
that function out, I'm pretty sure there's a good reason for doing so, still
I wonder if it wouldn't be better to add get_route() to a protocol's module?
Along the same lines: there are instances when IPv4 needs to know the IP
addresses of the local interfaces, in order to determine whether or not a
given source/destination IP is indeed of this host. The current
implementation takes a shortcut (marked as such) and iterates over
net_domain.interfaces without locking. I remember Axel mentioning that
locking isn't thought through yet, so I guess, that's just one incarnation of
this fact >;o)
In order to fix the problem, we could:
1) Add is_local_address() to net_protocol_module_info and
net_datalink_module_info. IPv4 would just delegate the request to the
datalink module, which could lock the interfaces in it's implementation
(as it can access the private parts of net_domain).
2) Export locking functions for net_domain (rather ugly)
Any preferences (or other, better ideas) on this?
cheers,
Oliver
|

|