Thanks for the quick response!
Here are some further comments:
Jeff Kann wrote:
>
> On Thu, 13 Apr 2000, Retvari Gabor wrote:
>
> - Hi, Folks...
> -
> - I need your help very badly concerning SOCK_RAW socket options.
> - Suppose an IP packet, which comprises REMOTE source and destination IP
> - addresses (i.e., different from any of the local interfaces of the
> - partiular router) - this packet happens to be an RSVP Path message. As
> - the Router Alert option is enabled the incoming packet is caught and
> - passed to a user space program (rsvpd). After processing this packet it
> - has to be sent further but WITHOUT installing any static (new) gateways
> - to the kernel routing table. The packet's destination address is a
> - remote address (does not reside on any of the router's attached LANS -
> - and this destination does not have any references in the kernel routing
> - table), but we - somehow - know, which is the next hop address of this
> - packet - but this must not be installed to the Kernel routing table.
>
> This sounds strange. If you don't have the route in the routing table,
> how do you know which interface to forward the Path message out to?
This is the responsibility of a QoS routing protocol module: e.g.:
QoSPF, which tells rsvpd, where to forward the message through a Unix
domain socket.
> The
> packet should be dropped, if the router doesn't know the route.
>
The Router Alert option assures, that before locally processing the
packet in the kernel, it is forwarded to the user domain rsvpd program,
it is not discarded...
> - I enabled the IP_PKTINFO option:
> -
> - setsockopt(fd,SOL_IP,IP_PKTINFO, (char *) &so_on,sizeof(so_on));
> -
> - and I filled the 'struct in_pktinfo':
> -
> - ipi->ipi_ifindex = outgoing_if_index; /* Interface index */
> - ipi->ipi_spec_dst.s_addr = next_hop_addr; /* Routing destination
> - address */ - recall, this is a remote address with no reference in the
> - kernel routing table...
> - and I left ipi_addr (/* Header Destination address */) unconfigured.
>
> I am not sure if the PKTINTO stuff can be used here (because I've never
> tried it), but you could have just bound the raw socket to the outgoing
> interface (which you learned via routing) and send the packet with that
> socket.
I have a "common" socket for the entire traffic: I must not bind it to
any interfaces...
> - Although the parameters seem to be correct, the 'sendmsg' returns -1,
> - errno = 22 (EINVAL). Is the conception correct? Does the kernel perform
> - routing table lookup, and the missing gateway causes the EINVAL
> - (blackhole route)? Should I enable SO_DONTROUTE option as well?
> - p.s.: is reading the interface identifier indices (if_index) by ioctl or
> - by a netlink socket compatible? When building the "dummy network driver"
> - (for PPP purposes) into the kernel these calls return different
> - interface indices:
> - ioctl: lo (if_index = 1), dummy (index = 2), eth0 (index = 3) etc.
> - netlink socket: lo (if_index = 1), eth0 (index = 2!!!!!) etc.
> -
> - shouldn't interface indices be unambiguous?
>
> If you reboot the machine, do they come out with the same numbers?
>
Sure they do: netlink socket returns all interfaces (dummy, teql0 (???)
etc.), ioctl does not...
any more comments would be extremely appreciated...
Thanks again: Gabor Retvari/BUTE
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]