Skip to content

Commit aa18e03

Browse files
committed
interface now needs to be defined in sledconf
1 parent 04098a3 commit aa18e03

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/modules/out_5a_75e.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
#define WIDTH 256
3333
#define HEIGHT 256
3434

35+
#define xstr(x) str(x)
36+
#define str(x) #x
37+
38+
#ifndef INTERFACE
39+
#error "define INTERFACE in sledconf"
40+
#endif
41+
3542
typedef struct
3643
{
3744
uint8_t b;
@@ -131,7 +138,7 @@ int init(void) {
131138

132139
/* Get the index of the interface to send on */
133140
memset(&if_idx, 0, sizeof(struct ifreq));
134-
strncpy(if_idx.ifr_name, "eth0", IFNAMSIZ-1);
141+
strncpy(if_idx.ifr_name, xstr(INTERFACE), IFNAMSIZ-1);
135142
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
136143
{
137144
perror("SIOCGIFINDEX");

0 commit comments

Comments
 (0)