Skip to content

Commit 681cd12

Browse files
committed
net 2.0: remove unused SIOCGIFHWADDR call
1 parent 07a3534 commit 681cd12

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/disco/net/xdp/fd_xdp_tile.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ typedef struct {
198198
/* Ring tracking free packet buffers */
199199
fd_net_free_ring_t free_tx;
200200

201-
uchar src_mac_addr[6];
202-
203201
uint default_address;
204202
uint bind_address;
205203
ushort shred_listen_port;
@@ -1177,20 +1175,15 @@ net_xsk_bootstrap( fd_net_ctx_t * ctx,
11771175
return frame_off;
11781176
}
11791177

1180-
/* FIXME source MAC address from netlnk tile instead */
1178+
/* FIXME get default IPv4 address from netdev tbl instead */
11811179

11821180
static void
11831181
interface_addrs( const char * interface,
1184-
uchar * mac,
11851182
uint * ip4_addr ) {
11861183
int fd = socket( AF_INET, SOCK_DGRAM, 0 );
11871184
struct ifreq ifr;
11881185
ifr.ifr_addr.sa_family = AF_INET;
1189-
11901186
strncpy( ifr.ifr_name, interface, IFNAMSIZ );
1191-
if( FD_UNLIKELY( ioctl( fd, SIOCGIFHWADDR, &ifr ) ) )
1192-
FD_LOG_ERR(( "could not get MAC address of interface `%s`: (%i-%s)", interface, errno, fd_io_strerror( errno ) ));
1193-
fd_memcpy( mac, ifr.ifr_hwaddr.sa_data, 6 );
11941187

11951188
if( FD_UNLIKELY( ioctl( fd, SIOCGIFADDR, &ifr ) ) )
11961189
FD_LOG_ERR(( "could not get IP address of interface `%s`: (%i-%s)", interface, errno, fd_io_strerror( errno ) ));
@@ -1234,7 +1227,7 @@ privileged_init( fd_topo_t * topo,
12341227
uint if_idx = if_nametoindex( tile->xdp.interface );
12351228
if( FD_UNLIKELY( !if_idx ) ) FD_LOG_ERR(( "if_nametoindex(%s) failed", tile->xdp.interface ));
12361229

1237-
interface_addrs( tile->xdp.interface, ctx->src_mac_addr, &ctx->default_address );
1230+
interface_addrs( tile->xdp.interface, &ctx->default_address );
12381231

12391232
/* Load up dcache containing UMEM */
12401233

0 commit comments

Comments
 (0)