Skip to content

Commit

Permalink
Let the common pcap code handle "setting the direction isn't supported".
Browse files Browse the repository at this point in the history
Just set the "set direction" operation pointer to null.
  • Loading branch information
guyharris committed Nov 8, 2019
1 parent 25a2cbb commit 108b0ee
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pcap-sita.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,12 +915,6 @@ static int pcap_setfilter_acn(pcap_t *handle, struct bpf_program *bpf) {
return 0;
}

static int pcap_setdirection_acn(pcap_t *handle, pcap_direction_t d) {
snprintf(handle->errbuf, sizeof(handle->errbuf),
"Setting direction is not supported on ACN adapters");
return -1;
}

static int acn_read_n_bytes_with_timeout(pcap_t *handle, int count) {
struct timeval tv;
int retval, fd;
Expand Down Expand Up @@ -997,7 +991,7 @@ static int pcap_activate_sita(pcap_t *handle) {

handle->inject_op = pcap_inject_acn;
handle->setfilter_op = pcap_setfilter_acn;
handle->setdirection_op = pcap_setdirection_acn;
handle->setdirection_op = NULL; /* Not implemented */
handle->set_datalink_op = NULL; /* can't change data link type */
handle->getnonblock_op = pcap_getnonblock_fd;
handle->setnonblock_op = pcap_setnonblock_fd;
Expand Down

0 comments on commit 108b0ee

Please sign in to comment.