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 6050239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:39:59+00:00 2026-05-23T07:39:59+00:00

once again, i need your help to my kernel module. I have implemented an

  • 0

once again, i need your help to my kernel module. I have implemented an client module, but each time, connect function return errno=110 (Timeout). I don’t understand why ? To test this module, i’ve started netcat in listen mode (nc -vl -p4242). Do you have any suggestion about this mystical bug

int             init_module(void)
{
  struct socket*        sock = NULL;
  struct sockaddr_in*   dest = {0};
  int                   retVal = 0;

  dest = (struct sockaddr_in*)kmalloc(sizeof(struct sockaddr_in), GFP_KERNEL);
  sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
  dest->sin_family = AF_INET;
  dest->sin_addr.s_addr = htonl(in_aton("127.0.0.1"));
  dest->sin_port = htons(4242);
  printk(KERN_EMERG "Connect to %X:%u\n", dest->sin_addr.s_addr, 4242);

  retVal = sock->ops->connect(sock, (struct sockaddr*)dest, sizeof(struct sockaddr_in), !O_NONBLOCK);
  if (retVal >= 0) {
    printk(KERN_EMERG "Connected\n");
    sock_release(sock);
  }
  else
    printk(KERN_EMERG "Error %d\n", -retVal);

  return (0);
}

Debug output (dmesg)

Message from syslogd@century at Sun Jun 19 08:41:33 2011 ...
century kernel: Connect to 7F000001:4242

Message from syslogd@century at Sun Jun 19 08:41:54 2011 ...
century kernel: Error 110

Error code 110 is “Timeout”.

  • 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-23T07:40:00+00:00Added an answer on May 23, 2026 at 7:40 am

    in_aton("127.0.0.1"); already gives the address in network byte order.

    By doing htonl(in_aton("127.0.0.1")); you’re actually trying to connect to 1.0.0.127

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

Sidebar

Related Questions

I need your expertise once again. I have a java class that searches a
Once again I need some help. I'm working with a table that contains 3
I am once again looking for some help. I have found this stopwords script
Once again a very beginner-ish question, but here I go: I would like to
I received some great help here the other day and hope once again I
Once again one of those: Is there an easier built-in way of doing things
Once I have all the files I require in a particular folder, I would
Well this probably isn't specific to rails, but in my rails app, I have
I'm (once again) struggling with the creation of precompiled headers in conjunction with gcc
I have created a MySQL function to determine if a set of latitude and

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.