IP_PKTINFO how to use

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

 



Hi,

I am receiving message thru a raw socket using recvfrom. I have set the
IP_PKTINFO flag by

int on=1;
setsockopt(sd,SOL_IP,IP_PKTINFO,&on,sizeof(on));

this call succeeds. But i want to know the info stored in struct
ip_pktinfo.
I receive the message using recvfrom. BUt man page of recvfrom says

" If from is not NULL, and the socket is not connection-oriented, the
source  address  of  the  message  is filled  in. "

But i specifically need the interface index which is present in the
ip_pktinfo structure. How to do it. Kindly help me in this regard.

Thanks,
Ramesh



-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
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