Can't bind bpf to specific eth controller

**Hardware Platform:**DRIVE AGX Xavier™ 
**Software Version:**  DRIVE-V5.0.13-E3550-EB-Aurix-With3LSS-3.01.03
**Host Machine Version:** QNX  localhost 7.0.255 2018/06/06-16:06:46EDT ARMv8_nVidia-Parker aarch64le
**SDK Manager Version:** 5.0.13

We have to use j59 connector on the board for Ethernet communication. 
The following configuration setup is required in our project:
export SOCK=/sock2
 ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33136
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
eth0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 9000
        capabilities rx=1f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM>
        capabilities tx=7f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM,TSO4,TSO6>
        enabled rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        enabled tx=27<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
        address: 00:04:4b:a4:ef:6d
        media: Ethernet autoselect (1000baseT full-duplex,flowcontrol,rxpause,txpause)
        status: active
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        inet6 fe80::204:4bff:fea4:ef6d%eth0 prefixlen 64 scopeid 0x11
vlan2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 8996
        vlan: 2 priority: 0 parent: eth0
        address: 00:04:4b:a4:ef:6d
        inet 192.168.1.60 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::204:4bff:fea4:ef6d%vlan2 prefixlen 64 scopeid 0x12

In given code example we tested binding bpf to specific interfaces:

#include <stdint.h>
#include <errno.h>
#include <net/if_ether.h>
#include <net/if.h>
#include <net/bpf.h>
#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h> 
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>

static int bpf = -1;

int main(int argc, char **argv){


    if (argc != 3) {
       fprintf(stderr,"usage: %s <bpf full path> <ethernet interface>\n", argv[0]);
       exit(0);
    }

    printf("\n------------------------------------------------------");
    bpf = open(argv[1], O_RDWR); 
    if (bpf < 0) {
      printf("\nFailed opening %s! Error number: %d\n%s\n", argv[1], errno, strerror (errno));
      (void) close(bpf);
      bpf = -1;
  	}
  	else
  		printf("\nFile %s is opened!\n", argv[1]);

    if (ioctl(bpf, BIOCSETIF, argv[2]) < 0) {
      printf("\nCan't bind %s to %s! \nErrno: %d\nStrerror: %s\n", argv[1], argv[2], errno, strerror (errno));
      (void) close(bpf);
      bpf = -1;
  	}
      else
      	printf("\n%s is binded to %s!\n", argv[1], argv[2]);
    printf("------------------------------------------------------\n\n");
  return 0;

}

and we got the next results:


# /app/etc/bind_test /dev/bpf eq0

------------------------------------------------------
File /dev/bpf is opened!

/dev/bpf is binded to eq0!
------------------------------------------------------

# /app/etc/bind_test /dev/bpf0 eq0

------------------------------------------------------
File /dev/bpf0 is opened!

/dev/bpf0 is binded to eq0!
------------------------------------------------------

# /app/etc/bind_test /dev/bpf vlan200

------------------------------------------------------
File /dev/bpf is opened!

/dev/bpf is binded to vlan200!
------------------------------------------------------

# /app/etc/bind_test /dev/bpf0 vlan200

------------------------------------------------------
File /dev/bpf0 is opened!

/dev/bpf0 is binded to vlan200!
------------------------------------------------------

# /app/etc/bind_test /dev/bpf hv0

------------------------------------------------------
File /dev/bpf is opened!

/dev/bpf is binded to hv0!
------------------------------------------------------

 #/app/etc/bind_test /dev/bpf0 hv0

------------------------------------------------------
File /dev/bpf0 is opened!

/dev/bpf0 is binded to hv0!
------------------------------------------------------

 #/app/etc/bind_test /dev/bpf hv1

------------------------------------------------------
File /dev/bpf is opened!

/dev/bpf is binded to hv1!
------------------------------------------------------

 #/app/etc/bind_test /dev/bpf0 hv1

------------------------------------------------------
File /dev/bpf0 is opened!

/dev/bpf0 is binded to hv1!
------------------------------------------------------

 export SOCK=/sock2
 #/app/etc/bind_test /dev/bpf eth0

------------------------------------------------------
File /dev/bpf is opened!

Can't bind /dev/bpf to eth0!
Errno: 6
Strerror: No such device or address
------------------------------------------------------

# /app/etc/bind_test /dev/bpf0 eth0

------------------------------------------------------
File /dev/bpf0 is opened!

Can't bind /dev/bpf0 to eth0!
Errno: 6
Strerror: No such device or address
------------------------------------------------------

# /app/etc/bind_test /dev/bpf vlan2

------------------------------------------------------
File /dev/bpf is opened!

Can't bind /dev/bpf to vlan2!
Errno: 6
Strerror: No such device or address
------------------------------------------------------

# /app/etc/bind_test /dev/bpf0 vlan2

------------------------------------------------------
File /dev/bpf0 is opened!

Can't bind /dev/bpf0 to vlan2!
Errno: 6
Strerror: No such device or address
------------------------------------------------------

Does anyone know what could be an issue here, and what we can do to resolve it?

Hi @mihajloj,

This forum category is intended to support devzone releases (https://developer.nvidia.com/drive/downloads).
Till now all the releases are DRIVE OS Linux so let us clarify who should support your QNX issue via personal messages. Thanks!