diff options
| author | Chirag Shah <chirag@cumulusnetworks.com> | 2017-09-16 18:08:33 -0700 | 
|---|---|---|
| committer | Chirag Shah <chirag@cumulusnetworks.com> | 2017-10-03 09:22:47 -0700 | 
| commit | e1b18df1ea6b001486342e14982177531eae8e45 (patch) | |
| tree | b81c063a65a3b2dcea0ff608b8308510fc4ab63b /ospfd/ospf_network.c | |
| parent | e7503eab31d1efc6586b785ebc00b79b0497dc1e (diff) | |
ospfd: fix vrf bind sock non-linux system
For non GNU_LINUX like open Bsd avoid sending packet
to non vrf aware device using in_pktinfo.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_network.c')
| -rw-r--r-- | ospfd/ospf_network.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c index f5402e7cd3..d1c1429054 100644 --- a/ospfd/ospf_network.c +++ b/ospfd/ospf_network.c @@ -153,6 +153,18 @@ int ospf_if_ipmulticast(struct ospf *top, struct prefix *p, ifindex_t ifindex)  	if (ret < 0)  		zlog_warn("can't setsockopt IP_MULTICAST_TTL(1) for fd %d: %s",  			  top->fd, safe_strerror(errno)); +#ifndef GNU_LINUX +	/* For GNU LINUX ospf_write uses IP_PKTINFO, in_pktinfo to send +	 * packet out of ifindex. Below would be used Non Linux system. +	 */ +	ret = setsockopt_ipv4_multicast_if(top->fd, p->u.prefix4, ifindex); +	if (ret < 0) +		zlog_warn( +			"can't setsockopt IP_MULTICAST_IF(fd %d, addr %s, " +			"ifindex %u): %s", +			top->fd, inet_ntoa(p->u.prefix4), ifindex, +			safe_strerror(errno)); +#endif  	return ret;  }  | 
