forked from Mirror/frr
2004-12-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_network.c: Improve all setsockopt error messages to give detailed information on the arguments.
This commit is contained in:
parent
cc49eb5a5f
commit
3dc56b5bd3
|
@ -1,3 +1,8 @@
|
||||||
|
2004-12-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
|
* ospf_network.c: Improve all setsockopt error messages to give detailed
|
||||||
|
information on the arguments.
|
||||||
|
|
||||||
2004-12-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2004-12-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
* ospf_packet.c: (ospf_db_desc) Reduce severity of "Negotiation done"
|
* ospf_packet.c: (ospf_db_desc) Reduce severity of "Negotiation done"
|
||||||
|
|
|
@ -55,8 +55,10 @@ ospf_if_add_allspfrouters (struct ospf *top, struct prefix *p,
|
||||||
p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
|
p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
|
||||||
ifindex);
|
ifindex);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (AllSPFRouters): %s",
|
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
|
||||||
safe_strerror (errno));
|
"ifindex %u, AllSPFRouters): %s; perhaps a kernel limit "
|
||||||
|
"on # of multicast group memberships has been exceeded?",
|
||||||
|
top->fd, inet_ntoa(p->u.prefix4), ifindex, safe_strerror(errno));
|
||||||
else
|
else
|
||||||
zlog_info ("interface %s join AllSPFRouters Multicast group.",
|
zlog_info ("interface %s join AllSPFRouters Multicast group.",
|
||||||
inet_ntoa (p->u.prefix4));
|
inet_ntoa (p->u.prefix4));
|
||||||
|
@ -74,8 +76,9 @@ ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
|
||||||
p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
|
p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
|
||||||
ifindex);
|
ifindex);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn("can't setsockopt IP_DROP_MEMBERSHIP (AllSPFRouters): %s",
|
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
|
||||||
safe_strerror (errno));
|
"ifindex %u, AllSPFRouters): %s",
|
||||||
|
top->fd, inet_ntoa(p->u.prefix4), ifindex, safe_strerror(errno));
|
||||||
else
|
else
|
||||||
zlog_info ("interface %s leave AllSPFRouters Multicast group.",
|
zlog_info ("interface %s leave AllSPFRouters Multicast group.",
|
||||||
inet_ntoa (p->u.prefix4));
|
inet_ntoa (p->u.prefix4));
|
||||||
|
@ -94,8 +97,10 @@ ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, unsigned int
|
||||||
p->u.prefix4, htonl (OSPF_ALLDROUTERS),
|
p->u.prefix4, htonl (OSPF_ALLDROUTERS),
|
||||||
ifindex);
|
ifindex);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (AllDRouters): %s",
|
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
|
||||||
safe_strerror (errno));
|
"ifindex %u, AllDRouters): %s; perhaps a kernel limit "
|
||||||
|
"on # of multicast group memberships has been exceeded?",
|
||||||
|
top->fd, inet_ntoa(p->u.prefix4), ifindex, safe_strerror(errno));
|
||||||
else
|
else
|
||||||
zlog_info ("interface %s join AllDRouters Multicast group.",
|
zlog_info ("interface %s join AllDRouters Multicast group.",
|
||||||
inet_ntoa (p->u.prefix4));
|
inet_ntoa (p->u.prefix4));
|
||||||
|
@ -113,8 +118,9 @@ ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, unsigned int
|
||||||
p->u.prefix4, htonl (OSPF_ALLDROUTERS),
|
p->u.prefix4, htonl (OSPF_ALLDROUTERS),
|
||||||
ifindex);
|
ifindex);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (AllDRouters): %s",
|
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
|
||||||
safe_strerror (errno));
|
"ifindex %u, AllDRouters): %s",
|
||||||
|
top->fd, inet_ntoa(p->u.prefix4), ifindex, safe_strerror(errno));
|
||||||
else
|
else
|
||||||
zlog_info ("interface %s leave AllDRouters Multicast group.",
|
zlog_info ("interface %s leave AllDRouters Multicast group.",
|
||||||
inet_ntoa (p->u.prefix4));
|
inet_ntoa (p->u.prefix4));
|
||||||
|
@ -134,18 +140,22 @@ ospf_if_ipmulticast (struct ospf *top, struct prefix *p, unsigned int ifindex)
|
||||||
/* Prevent receiving self-origined multicast packets. */
|
/* Prevent receiving self-origined multicast packets. */
|
||||||
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_LOOP, (void *)&val, len);
|
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_LOOP, (void *)&val, len);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_MULTICAST_LOOP(0): %s", safe_strerror (errno));
|
zlog_warn ("can't setsockopt IP_MULTICAST_LOOP(0) for fd %d: %s",
|
||||||
|
top->fd, safe_strerror(errno));
|
||||||
|
|
||||||
/* Explicitly set multicast ttl to 1 -- endo. */
|
/* Explicitly set multicast ttl to 1 -- endo. */
|
||||||
val = 1;
|
val = 1;
|
||||||
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&val, len);
|
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&val, len);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1): %s", safe_strerror (errno));
|
zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1) for fd %d: %s",
|
||||||
|
top->fd, safe_strerror (errno));
|
||||||
|
|
||||||
ret = setsockopt_multicast_ipv4 (top->fd, IP_MULTICAST_IF,
|
ret = setsockopt_multicast_ipv4 (top->fd, IP_MULTICAST_IF,
|
||||||
p->u.prefix4, 0, ifindex);
|
p->u.prefix4, 0, ifindex);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("can't setsockopt IP_MULTICAST_IF: %s", safe_strerror (errno));
|
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));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -182,7 +192,7 @@ ospf_sock_init (void)
|
||||||
if ( ospfd_privs.change (ZPRIVS_LOWER) )
|
if ( ospfd_privs.change (ZPRIVS_LOWER) )
|
||||||
zlog_err ("ospf_sock_init: could not lower privs, %s",
|
zlog_err ("ospf_sock_init: could not lower privs, %s",
|
||||||
safe_strerror (errno) );
|
safe_strerror (errno) );
|
||||||
zlog_warn ("Can't set IP_HDRINCL option");
|
zlog_warn ("Can't set IP_HDRINCL option for fd %d",ospf_sock);
|
||||||
}
|
}
|
||||||
#elif defined (IPTOS_PREC_INTERNETCONTROL)
|
#elif defined (IPTOS_PREC_INTERNETCONTROL)
|
||||||
#warning "IP_HDRINCL not available on this system"
|
#warning "IP_HDRINCL not available on this system"
|
||||||
|
@ -208,7 +218,7 @@ ospf_sock_init (void)
|
||||||
ret = setsockopt_ifindex (AF_INET, ospf_sock, 1);
|
ret = setsockopt_ifindex (AF_INET, ospf_sock, 1);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn ("Can't set pktinfo option");
|
zlog_warn ("Can't set pktinfo option for fd %d", ospf_sock);
|
||||||
|
|
||||||
if (ospfd_privs.change (ZPRIVS_LOWER))
|
if (ospfd_privs.change (ZPRIVS_LOWER))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue