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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:18:25+00:00 2026-06-12T21:18:25+00:00

I am capturing some packets using iptables queue, and analysing them in a libnetfilter_queue

  • 0

I am capturing some packets using iptables queue, and analysing them in a libnetfilter_queue module, now i wish to make some changes in the packet, but even if i change a single character, the packet is rejected, perhaps, while checking the checksum! Is there any way to prevent it from being rejected:

static int callBack(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg,struct nfq_data *nfa, void *data)
{
 int len=0,id=0;
 char *pktData;
 string pktString;
 struct nfqnl_msg_packet_hdr *pktHeader;
 pktHeader = nfq_get_msg_packet_hdr(nfa);
 if (pktHeader) 
 {
   id = ntohl(pktHeader->packet_id);
 }
 len = nfq_get_payload(nfa, &pktData);
 if(len) 
 {
  int pos;
  pktString.assign(pktData,len);
  pos=pktString.find("oldstring",0);
  if(pos>0)
 {
    pktString.replace(pos,9,"newstring");
    unsigned char* newPktData=(unsigned char*)pktString.c_str();
    len=pktString.size();
    return nfq_set_verdict(qh, id, NF_ACCEPT,len,newPktData);
}
}   
return nfq_set_verdict(qh, id, NF_ACCEPT, 0, NULL);
}
  • 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-06-12T21:18:26+00:00Added an answer on June 12, 2026 at 9:18 pm

    If you change anything you have to update the checksum to prevent rejection, otherwise the packet will be considered to be corrupted…
    edit: assuming you are working on IP packets, the above only applies for changes in the IP header, since only the header, not the payload, is ‘protected’ by the IP checksum.

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

Sidebar

Related Questions

I am using a capturing software, Abbyy FlexiCapture, after user done the verification (some
I would like to make some kind of thumbnail with capturing BitmapData or ImageSnapshot
how to disable structure padding...i am capturing the packets using pacp while displaying i
I am capturing some events in a C# program that come back with the
For IE7 and IE8, I am capturing some JSONp to use in my webpage.
I need some way of capturing the text between square brackets. So for example,
I'd like to log some contextual information when tests fail (like capturing screenshots). Is
my app involves some work with the camera, therefore it needs to handle capturing
I'm having trouble capturing the digits in a string of this format (t|b|bug_|task_|)1234 using
I am capturing some points on an X, Y plane to represent some values.

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.