Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, i try to sent a VLAN Frame with the help of a PF_Packet RAW Socket but if i write in the protocol field of the frame the ammount 0x8100, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    2

    VLAN Frames RAW Socket


    Hello,

    i try to sent a VLAN Frame with the help of a PF_Packet RAW Socket but if i write in the protocol field of the frame the ammount 0x8100, Linux remove the field and sent it without this 2 bytes. For example i capture this two frames with Wireshark.
    If i write 0x8000 the frame send as i create it in the memory.
    00 11 22 33 44 55 01 11 22 33 44 55 80 00 22 22 22 22 22 22

    But i write 0x8100 the frame send without this 2 bytes
    00 11 22 33 44 55 01 11 22 33 44 55 22 22 22 22 22 22

    I thought with a RAW Socket i can send what i want.
    I use the Linux Kernel 2.6.31 and include the VLAN Support Packet.

    With best Regards
    Christian
    Last edited by soch0082; 03-31-2011 at 10:41 AM.

  2. #2
    Just Joined!
    Join Date
    Jan 2012
    Posts
    2
    Quote Originally Posted by soch0082 View Post
    Hello,

    i try to sent a VLAN Frame with the help of a PF_Packet RAW Socket but if i write in the protocol field of the frame the ammount 0x8100, Linux remove the field and sent it without this 2 bytes. For example i capture this two frames with Wireshark.
    If i write 0x8000 the frame send as i create it in the memory.
    00 11 22 33 44 55 01 11 22 33 44 55 80 00 22 22 22 22 22 22

    But i write 0x8100 the frame send without this 2 bytes
    00 11 22 33 44 55 01 11 22 33 44 55 22 22 22 22 22 22

    I thought with a RAW Socket i can send what i want.
    I use the Linux Kernel 2.6.31 and include the VLAN Support Packet.

    With best Regards
    Christian
    Hi Christian,

    Did you find a solution for this? I am seeing the same problem on my system (Ubuntu 3.0.0-14-generic-pae). The odd thing is that when I ran my test applications (same binaries) on another system (Ubuntu 2.6.38-8-generic) everything looks correct and I get the 802.1q tagging from the raw socket.

    Thanks!
    Shlomo

  3. #3
    Just Joined!
    Join Date
    Mar 2011
    Posts
    2
    Hallo Shlomo.
    In my case i note that linux on my embedded system sent the right frame. Wireshark displayed the frame without 2 bytes on a windows PC, on a other PC Wireshark display the right frame. So in my case not linux was the problem. Windows with Wireshark caused the problem.
    Greetings

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2012
    Posts
    2

    Thanks!

    Thanks!

    I found out that when using recvmsg(...), I can get the vlan tagging from the auxdata. It's more complicated solution, but still a solution.

    Is someone is interested, I can publish the code.

    Shlomo

  6. #5
    Just Joined!
    Join Date
    Nov 2012
    Posts
    1
    Quote Originally Posted by shlomosh View Post
    Thanks!

    I found out that when using recvmsg(...), I can get the vlan tagging from the auxdata. It's more complicated solution, but still a solution.

    Is someone is interested, I can publish the code.

    Shlomo
    Hi Shlomo - I am facing similar issue. Instead of fixing the driver issue, i would like to fix my application. So can you please provide the code?

    Thanks in advance
    Manvi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •