summaryrefslogtreecommitdiff
path: root/ospfd/ospf_network.c
diff options
context:
space:
mode:
authorpaul <paul>2004-07-23 15:13:48 +0000
committerpaul <paul>2004-07-23 15:13:48 +0000
commit2dd8bb4e9b296782f361008b5aa959ac51e16a4c (patch)
treed8a0925a7f2216ce8700d66b18981cb151138b9e /ospfd/ospf_network.c
parent4f7baa0e434053c9f9a70f526be1514ea47cd274 (diff)
2004-07-23 Paul Jakma <paul@dishone.st>
* ospf_network.c: Replace PKTINFO/RECVIF with call to setsockopt_pktinfo * ospf_packet.c: Use getsockopt_pktinfo_ifindex and SOPT_SIZE_CMSG_PKTINFO_IPV4.
Diffstat (limited to 'ospfd/ospf_network.c')
-rw-r--r--ospfd/ospf_network.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 2766abd5..63851879 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -201,27 +201,9 @@ ospf_sock_init (void)
zlog_warn ("IP_HDRINCL option not available");
#endif /* IP_HDRINCL */
-#if defined (IP_PKTINFO)
- ret = setsockopt (ospf_sock, IPPROTO_IP, IP_PKTINFO, &hincl, sizeof (hincl));
- if (ret < 0)
- {
- if ( ospfd_privs.change (ZPRIVS_LOWER) )
- zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
- zlog_warn ("Can't set IP_PKTINFO option");
- }
-#elif defined (IP_RECVIF)
- ret = setsockopt (ospf_sock, IPPROTO_IP, IP_RECVIF, &hincl, sizeof (hincl));
- if (ret < 0)
- {
- if ( ospfd_privs.change (ZPRIVS_LOWER) )
- zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
- zlog_warn ("Can't set IP_RECVIF option");
- }
-#else
-#warning "cannot be able to receive link information on this OS"
-#endif
+ ret = setsockopt_pktinfo (AF_INET, ospf_sock, 1);
+ if (ret < 0)
+ zlog_warn ("Can't set pktinfo option");
if (ospfd_privs.change (ZPRIVS_LOWER))
{