Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-16-2010, 07:12 AM   #1
LQ Newbie
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
Linux ioctl help.......................

HEY GUYZZZ plz plz plz help help me.
im actually making a packet sniffer using raw socket.
Its just that when i use the command '
if((ioctl(rawsock, SIOCGIFINDEX, &ifr)) == -1)
to get the interface index...

its gives me an error saying :invalid argument....?????
Any slutions
Old 11-16-2010, 07:16 AM   #2
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Do NOT double post -

This is against the LQ Rules. Posting more than once WILL NOT result in you being helped quicker.

We all help people here voluntarily, so there's no need to beg. If someone can help you, they will. Increase your chances of getting an answer by making your post clearer with more detail.
Old 11-17-2010, 01:06 AM   #3
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
It depends on how you have defined your ioclt and is SIOCGIFINDEX a predefined IOCTL command or is it being defined by you. Make sure the expected arguments in the definition and what you are passing are the same.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with using ioctl and SIOCGARP to get ARP entry on Linux Kernal bostan Programming 1 08-04-2014 10:59 AM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 07:45 PM
How to add a gateway address using ioctl in C in linux ? sweta Linux - Networking 1 12-28-2006 12:26 AM
Linux, closing CD door with ioctl()? ljubak Programming 12 09-05-2006 05:45 AM
I_CONSLOG in linux for ioctl how to dharanikumar Linux - General 0 01-03-2005 04:38 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration