Actually no compile errors whatsoever. Not at computer at the momment
so can't try the character w.
Ming original email was for advice on how to change the rules, it did
spin off to a debug my code post,I apologize. Thank you all for the help
Sent from my iPhone.
On Apr 21, 2008, at 20:46, "Ming-Ching Tiew"
<mingching.tiew@xxxxxxxxxxx> wrote:
Charles Romestant wrote:
Ok im trying to add the rule to a table named charz, here is the code
:
char *command;
FILE *fp = popen("/sbin/iptables",'w');
if (fp==NULL){
printf("\nerror opening pipe\n");
return -1;
}else{
sprintf(command,"-A charz -p tcp --dport %s --source %s -j
%s\0",port,currentIp,action2);
printf("\n\n\n%s\n\n\n",command);
fwrite(command,strlen(command),1,fp);
pclose(fp);
Oh my, this is not netfilter at all ! Please post it to C programming
for beginners please ! There are quite a few bugs in these few lines,
the compiler would already have warned you !
--
To unsubscribe from this list: send the line "unsubscribe netfilter"
in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html