Re: kernel network device interface/link encap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <51c8a7be05041217453244f225@xxxxxxxxxxxxxx> you wrote:
> I need an explanation of what exactly the 'link encap' field returned
> by ifconfig means in relationship to an interface. Information about
> how to change it and where it comes from would be a tremendous help.

It returns the hardware family of the  Interface. See:

   if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0)
        memset(ife->hwaddr, 0, 32);
    else
        memcpy(ife->hwaddr, ifr.ifr_hwaddr.sa_data, 8);

    ife->type = ifr.ifr_hwaddr.sa_family;

Normally  you can't change  it. Or only in some limited way (different
ethernet oncoding styles). 

In case of tun interfaces it is IMHO changed by attaching it. Normally in
tun-mode the device is set up as PPP, in TAP mode it is set up as Ethernet.
In the unspec case I guess it is set up wrong, and this ImHO means the user
mode program is not matching the kernel version (i.e. expecting another
ioctl or device). 

There is also a tunctl command, not sure if it helps you.

Greetings
Bernd




-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux