Re: IPv6 sending to a device without a route

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If your interface is Point-to-Point, can you use MSG_DONTROUTE flag with sendmsg?

Chinh
--
http://www.certicom.com

Andrew May wrote:
I would really like to be able to send an IPv6 with a arbitrary IP out a
specific interface for a setup/probe type situation.
So there is no route setup yet, and it will be sent out a Point-to-Point
type interface.
With IPv4 I was able to do this just fine with a sendmsg with the
IP_PKTINFO data. But with SOL_IPV6/IPV6_PKTINFO, I am not able to do the
same thing.

The IPv4 code comments in route.c at line 2240, seem to be the reason it
works for IPv4. Should IPv6 work the same way? Or is there a bug in my
test app?
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.24.y.git;a=blob;f=net/ipv4/route.c;h=28484f396b048e1dd49210e5caffc24e29148f2b;hb=HEAD

Here is a test app and the results I get on 2.6.24.

==============
acmay@mud:~$ ip -6 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::217:31ff:fec4:4cd9/64 scope link
       valid_lft forever preferred_lft forever
acmay@mud:~$ ip -6 route
2001::/64 dev eth1  metric 256  expires 21333753sec mtu 1500 advmss 1440
hoplimit 4294967295
fe80::/64 dev eth1  metric 256  expires 21035002sec mtu 1500 advmss 1440
hoplimit 4294967295
ff00::/8 dev eth1  metric 256  expires 21035002sec mtu 1500 advmss 1440
hoplimit 4294967295
acmay@mud:~$ ./a.out eth1 2001::1 2002::1
eth1 ifindex = 2
sendmsg failed
: Network is unreachable

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux