My grpc++ server is crashing while binding to ip address. IP address is valid and present on system. However interface to which it is bounded belongs to different VRF.
Is there any API which can be used to set the socket option( SO_BINDTODEVICE) ?
root@SeastoneXP-5:~/lalit# ./gnmi_server.bin
SetupServer address 10.9.5.14
E0708 19:08:02.766255725 27546 server_chttp2.cc:40] {"created":"@1562612882.766193175","description":"No address added out of total 1 resolved","file":"src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":348,"referenced_errors":[{"created":"@1562612882.766187475","description":"Unable to configure socket","fd":122,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":217,"referenced_errors":[{"created":"@1562612882.766170075","description":"Cannot assign requested address","errno":99,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":190,"os_error":"Cannot assign requested address","syscall":"bind"}]}]}
Server listening on 10.9.5.14 Port 50042
Segmentation fault
root@SeastoneXP-5:~/lalit# ifconfig ma1
ma1 Link encap:Ethernet HWaddr 00:e0:ec:7a:83:12
inet addr:10.9.5.14 Bcast:10.9.255.255 Mask:255.255.0.0
inet6 addr: fe80::2e0:ecff:fe7a:8312/64 Scope:Link
inet6 addr: 2600:1700:470:6f3f:10:9:101:53e/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:958942 errors:0 dropped:7 overruns:19 frame:0
TX packets:111757 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:214464622 (204.5 MiB) TX bytes:15174663 (14.4 MiB)
Memory:dff40000-dff5ffff
root@SeastoneXP-5:~/lalit# ip link show ma1
4: ma1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master management state UP mode DEFAULT group default qlen 1000
link/ether 00:e0:ec:7a:83:12 brd ff:ff:ff:ff:ff:ff
root@SeastoneXP-5:~/lalit#