Skip to content

Commit ba0e5b2

Browse files
ofh: no stack trace on socket/network error
1 parent e683a34 commit ba0e5b2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/ofh/ethernet/ethernet_receiver_impl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ receiver_impl::receiver_impl(const std::string& interface,
3030
{
3131
socket_fd = ::socket(AF_PACKET, SOCK_RAW, htons(ECPRI_ETH_TYPE));
3232
if (socket_fd < 0) {
33-
report_fatal_error("Unable to open socket for Ethernet receiver");
33+
report_error("Unable to open socket for Ethernet receiver");
3434
}
3535

3636
// Set interface to promiscuous mode.
3737
::ifreq if_opts;
3838
::strncpy(if_opts.ifr_name, interface.c_str(), IFNAMSIZ - 1);
3939
if (::ioctl(socket_fd, SIOCGIFFLAGS, &if_opts) < 0) {
40-
report_fatal_error("Unable to get flags for NIC interface in the Ethernet receiver");
40+
report_error("Unable to get flags for NIC interface in the Ethernet receiver");
4141
}
4242
if_opts.ifr_flags |= IFF_PROMISC;
4343
if (::ioctl(socket_fd, SIOCSIFFLAGS, &if_opts) < 0) {
44-
report_fatal_error("Unable to set flags for NIC interface in the Ethernet receiver");
44+
report_error("Unable to set flags for NIC interface in the Ethernet receiver");
4545
}
4646

4747
// Bind to device.
4848
if (::setsockopt(socket_fd, SOL_SOCKET, SO_BINDTODEVICE, interface.c_str(), IFNAMSIZ - 1) == -1) {
49-
report_fatal_error("Unable to bind socket in Ethernet receiver");
49+
report_error("Unable to bind socket in Ethernet receiver");
5050
}
5151

5252
logger.info("Opened successfully the NIC interface '{}' used by the Ethernet receiver", interface);

lib/ofh/ethernet/ethernet_transmitter_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ transmitter_impl::transmitter_impl(const gw_config& config, srslog::basic_logger
2525
{
2626
socket_fd = ::socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
2727
if (socket_fd < 0) {
28-
report_fatal_error("Unable to open socket for Ethernet gateway");
28+
report_error("Unable to open socket for Ethernet gateway");
2929
}
3030

3131
// Get the index of the NIC.
3232
::ifreq if_idx = {};
3333
::strncpy(if_idx.ifr_name, config.interface.c_str(), IFNAMSIZ - 1);
3434
if (::ioctl(socket_fd, SIOCGIFINDEX, &if_idx) < 0) {
35-
report_fatal_error("Unable to get index for NIC interface in the Ethernet transmitter");
35+
report_error("Unable to get index for NIC interface in the Ethernet transmitter");
3636
}
3737

3838
// Prepare the socket address used by sendto.

0 commit comments

Comments
 (0)