Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6810595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:13:28+00:00 2026-05-26T20:13:28+00:00

I setup a raw Packet socket using the following: sockFd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)

  • 0

I setup a raw Packet socket using the following:

sockFd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL) );

Then I am trying to set the socket option IP_HDRINCL using:

int one = 1;
if (setsockopt (sockFd, IPPROTO_IP, IP_HDRINCL, &one, sizeof(one)) < 0)
    LogPrint(LOG_UNKNOWN,"Warning: Cannot set HDRINCL!\n");

But I am unable to set this option (I get an error with errno 92 and message “Protocol not available”. If I change PF_PACKET to PF_INET then the options is set but I have to use PF_PACKET. So is there a way to set this option with the socket created above?

Thanks a bunch.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:13:29+00:00Added an answer on May 26, 2026 at 8:13 pm

    PF_PACKET sockets don’t have any option that I asked in the question to be set. That option is only available on PF_INET or PF_INET6 sockets with type SOCK_RAW.

    If one wants the IP headers to be added by the kernel, the one must use the PF_INET socket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add the following custom element using TinyMCE... <g:plusone size=small callback=plusone_vote></g:plusone> I've
Setup is following: Drupal project, one svn repo with trunk/qa/production-ready branches, vhosts for every
Setup: Contact database using 4 tables Contacts Cities States Zips Structure: CREATE TABLE `contacts`
I was writing a setup.py for a Python package using setuptools and wanted to
I have a setup where I am using amcharts that is feed data via
I have the following setup for my daily/main/only development environment Hardware/Tin = 4gb ram,
I want to generate raw xml from a REST service using Spring. Something is
I'm writing a bulk insert script using Django's ORM + custom raw SQL. The
I'd like to setup a simple Sinatra app up to capture the raw POST
I'm using org.apache.commons.httpclient.HttpClient and need to setup response encoding (for some reason server returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.