Skip to content

Commit

Permalink
bgp/socket: Make BGP error message slightly more useful.
Browse files Browse the repository at this point in the history
Also, don't warn about missing BINDTODEVICE on BSD.  It simply
isn't supported there, so no need to fill logs with warnings users
can do nothing about.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Aug 18, 2010
1 parent ffd75f7 commit 4c211cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xorp/bgp/xrl_target.cc
Expand Up @@ -116,7 +116,7 @@ XrlBgpTarget::bgp_0_3_local_config(
** We may already be configured so don't allow a reconfiguration.
*/
if(!_awaiting_config)
return XrlCmdError::COMMAND_FAILED("Attempt to reconfigure BGP");
return XrlCmdError::COMMAND_FAILED("Attempt to reconfigure BGP denied.");

_use_4byte_asnums = use_4byte_asnums;
try {
Expand Down
5 changes: 5 additions & 0 deletions xorp/libcomm/comm_sock.c
Expand Up @@ -1137,8 +1137,13 @@ comm_set_bindtodevice(xsock_t sock, const char * my_ifname)

return (XORP_OK);
#else
#ifndef __FreeBSD__
// FreeBSD doesn't implement this, so no use filling logs with errors that can't
// be helped. Assume calling code deals with the error code as needed.
XLOG_ERROR("setsockopt SO_BINDTODEVICE %s: %s",
my_ifname, "SO_BINDTODEVICE support not present.");
#endif
UNUSED(my_ifname);
UNUSED(sock);
return (XORP_ERROR);
#endif
Expand Down

0 comments on commit 4c211cd

Please sign in to comment.