[Xorp-users] Question on supporting multiple routing tables [PATCH]

Pavlin Radoslavov pavlin at icir.org
Fri Aug 31 09:54:37 PDT 2007


> I can do this.  One question:  In the comments for send_packet, it says
> if_name is optional for unicast packets..however it looks like the
> actual code will error out if the ifp is not found:
> 
>      ifp = iftree().find_interface(if_name);
>      if (ifp == NULL) {
> 	error_msg = c_format("No interface %s", if_name.c_str());
> 	return (XORP_ERROR);
>      }
> 
> I assume the comments are wrong, or maybe the find_interface will grab
> some random interface if if_name is blank?

Yes, the comments don't match the current processing, because the
original semantics were relaxed so for transmitting unicast packets
the interface/vif name can be omitted (and let the kernel choose
the outgoing interface). We need to rethink that and decide whether
to keep the original semantics and fix the code or redefine the
semantics.

> For the proto_sock_transmit(), I guess I should just get the name from the ifp
> and bind to that, or would you rather me pass in if_name ?

You could get the name from the vifp.

> > Finally, would it work if you replace "nl" with NULL when you try to
> > un-bind.
> 
> Doesn't seem "NULL" is valid according to the man page.  Evidently you
> can set the 'length' argument to 0 and have that work, but I wanted to
> be doubly sure in case other OSs do things slightly different.

OK, fair enough.

Thanks,
Pavlin



More information about the Xorp-users mailing list