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. 
  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. 

  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? 
Any comments are appreciated...

        Thanks in advance: Gabor Retvari/BUTE

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?
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to