1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Use SO_BINDTODEVICE also in Linux/IPv6.

This commit is contained in:
Ondrej Zajicek
2010-04-02 16:11:46 +02:00
parent 97ab4c3498
commit e7b09e4ab9
4 changed files with 24 additions and 12 deletions

View File

@@ -66,17 +66,7 @@ ospf_sk_open(struct ospf_iface *ifa)
sk = sk_new(p->pool);
sk->type = SK_IP;
sk->dport = OSPF_PROTO;
#ifdef OSPFv2
/*
* In Linux IPv4, binding a raw socket to an IP address of an iface causes
* that the socket does not receive multicast packets, as they have
* different (multicast) destination IP address.
*/
sk->saddr = IPA_NONE;
#else /* OSPFv3 */
sk->saddr = ifa->addr->ip; /* link-local addr */
#endif
sk->tos = IP_PREC_INTERNET_CONTROL;
sk->rx_hook = ospf_rx_hook;