[quagga-dev 8542] rip_send_packet sendto() returns EINVAL

Doug Kehn rdkehn at yahoo.com
Thu Mar 10 20:55:16 GMT 2011


Hi All,

I'm running Quagga 0.98.6, Linux 2.6.36, glibc 2.10.1.  I'm observing that the sendto() call in rip_send_packet returns EINVAL on a multipoint GRE tunnel interface but not on a point-to-point GRE tunnel interface.  Zebra and ripd are configured with:

# cat /etc/zebra.conf
!
password zebra
enable password zebra
log syslog
!


# cat /etc/ripd.conf
!
password ripd
enable password ripd
log syslog
!
interface tun1
        no ip rip authentication mode
!
router rip
        version 2
        network tun2
        network tun1
        redistribute connected
!


The two tunnel interfaces are configured with:

# mGRE tunnel
ip tunnel add tun1 mode gre key 11223344 ttl 64 csum remote any
ip link set dev tun1 up
ip link set dev tun1 multicast on
ip addr flush dev tun1
ip addr add 10.40.92.114/24 broadcast 10.40.92.255 dev tun1

# PTP tunnel
ip tunnel add tun2 mode gre local 10.40.50.1 remote 10.40.60.1 key 44556677
ip link set dev tun2 up
ip link set dev tun2 multicast on
ip addr flush dev tun2
ip addr add 10.40.40.1/30 broadcast 10.40.40.3 dev tun2

# ip addr show dev tun1
12: tun1: <MULTICAST,NOARP,UP,10000> mtu 1468 qdisc noqueue
    link/gre 0.0.0.0 brd 0.0.0.0
    inet 10.40.92.114/24 brd 10.40.92.255 scope global tun1
# ip addr show dev tun2
13: tun2: <POINTOPOINT,MULTICAST,NOARP,UP,10000> mtu 1472 qdisc noqueue
    link/gre 10.40.50.1 peer 10.40.60.1
    inet 10.40.40.1/30 brd 10.40.40.3 scope global tun2


The following log is emitted when ripd attempts to send multicast over tun1:
Mar 10 18:42:11 10.40.60.199 ripd[1926]: can't send packet : Invalid argument


The following is captured with strace when ripd attempts to send multicast on tun1:
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 8
setsockopt(8, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(8, SOL_IP, IP_MULTICAST_IF, "\0\0\0\0\0\0\0\0\0\0\0\f", 12) = 0
open("/etc/services", O_RDONLY|O_CLOEXEC) = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=8205, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40061000
read(9, "rtmp\t1/ddp\ntcpmux\t1/tcp\ntcpmux\t1"..., 4096) = 4096
close(9)                                = 0
munmap(0x40061000, 4096)                = 0
setresuid32(-1, 0, -1)                  = 0
bind(8, {sa_family=AF_INET, sin_port=htons(520), sin_addr=inet_addr("10.40.92.114")}, 16) = 0
setresuid32(-1, 0, -1)                  = 0
sendto(8, "\1\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20", 24, 0, {sa_family=AF_INET, sin_port=htons(520), sin_addr=inet_addr("224.0.0.9")}, 16) = -1 EINVAL (Invalid argument)
gettimeofday({1299704537, 617325}, NULL) = 0
send(3, "<28>Mar  9 21:02:17 ripd[13762]:"..., 69, MSG_NOSIGNAL) = 69
close(8)                                = 0

For comparison, the following is captured with strace when ripd sends multicast on tun2:
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 8
setsockopt(8, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(8, SOL_IP, IP_MULTICAST_IF, "\0\0\0\0\0\0\0\0\0\0\0\f", 12) = 0
open("/etc/services", O_RDONLY|O_CLOEXEC) = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=8205, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40061000
read(9, "rtmp\t1/ddp\ntcpmux\t1/tcp\ntcpmux\t1"..., 4096) = 4096
close(9)                                = 0
munmap(0x40061000, 4096)                = 0
setresuid32(-1, 0, -1)                  = 0
bind(8, {sa_family=AF_INET, sin_port=htons(520), sin_addr=inet_addr("10.40.92.114")}, 16) = 0
setresuid32(-1, 0, -1)                  = 0
sendto(8, "\1\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20", 24, 0, {sa_family=AF_INET, sin_port=htons(520), sin_addr=inet_addr("224.0.0.9")}, 16) = -1 EINVAL (Invalid argument)
gettimeofday({1299704537, 617325}, NULL) = 0
send(3, "<28>Mar  9 21:02:17 ripd[13762]:"..., 69, MSG_NOSIGNAL) = 69
close(8)                                = 0

The two strace look pretty much identical (less the ifindex used in setsockopt IP_MULTICAST_IF and sin_addr).

The same behavior is also observed with Quagga 0.99.17.  I just didn't capture a strace.

Has anyone seen similar behavior?  Does anyone have any advice as to where to look next?

Thanks,
...doug



      



More information about the Quagga-dev mailing list