mirror of
https://github.com/markqvist/tncattach.git
synced 2025-07-22 18:15:23 -04:00
TAP
- Added another check
This commit is contained in:
parent
64c18e6050
commit
3227ed232b
7
TAP.c
7
TAP.c
@ -244,6 +244,13 @@ int open_tap(void) {
|
|||||||
{
|
{
|
||||||
// Firstly, obtain the interface index by `ifr_name`
|
// Firstly, obtain the interface index by `ifr_name`
|
||||||
int inet6 = socket(AF_INET6, SOCK_DGRAM, 0);
|
int inet6 = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||||
|
if(inet6 < 0)
|
||||||
|
{
|
||||||
|
printf("Error opening control socket for adding IPv6 address to interface\n");
|
||||||
|
cleanup();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if(ioctl(inet6, SIOCGIFINDEX, &ifr) < 0)
|
if(ioctl(inet6, SIOCGIFINDEX, &ifr) < 0)
|
||||||
{
|
{
|
||||||
printf("Could not get interface index for interface '%s'\n", ifr.ifr_name);
|
printf("Could not get interface index for interface '%s'\n", ifr.ifr_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user