From 2dd8bb4e9b296782f361008b5aa959ac51e16a4c Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 23 Jul 2004 15:13:48 +0000 Subject: 2004-07-23 Paul Jakma * ospf_network.c: Replace PKTINFO/RECVIF with call to setsockopt_pktinfo * ospf_packet.c: Use getsockopt_pktinfo_ifindex and SOPT_SIZE_CMSG_PKTINFO_IPV4. --- ospfd/ospf_network.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'ospfd/ospf_network.c') 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)) { -- cgit v1.2.1