Skip to content

Commit 740a84b

Browse files
committed
interface specified via cmd line argument
1 parent aa18e03 commit 740a84b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/modules/out_5a_75e.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
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-
4235
typedef struct
4336
{
4437
uint8_t b;
@@ -127,7 +120,7 @@ void wait_until_break(int _modno)
127120
#endif
128121
}
129122

130-
int init(void) {
123+
int init(int moduleno, char *argstr) {
131124
struct ifreq if_idx;
132125

133126
/* Open RAW socket to send on */
@@ -138,7 +131,7 @@ int init(void) {
138131

139132
/* Get the index of the interface to send on */
140133
memset(&if_idx, 0, sizeof(struct ifreq));
141-
strncpy(if_idx.ifr_name, xstr(INTERFACE), IFNAMSIZ-1);
134+
strncpy(if_idx.ifr_name, argstr, IFNAMSIZ-1);
142135
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
143136
{
144137
perror("SIOCGIFINDEX");

0 commit comments

Comments
 (0)