Simultaneous iptables calls

Linux Advanced Routing and Traffic Control

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

 



Run this as one process:

#!/bin/sh
while [ 1 = 1 ]; do
    iptables -t mangle -F chain1
    iptables -t mangle -X chain1
    iptables -t mangle -N chain1 || exit 1
done

Run this as another process:

#!/bin/sh
while [ 1 = 1 ]; do
    iptables -t mangle -F chain2
    iptables -t mangle -X chain2
    iptables -t mangle -N chain2 || exit 1
done

and you get:

iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: Unknown error 4294967295
iptables: Unknown error 4294967295
iptables: Chain already exists
iptables: Unknown error 4294967295
iptables: Unknown error 4294967295
iptables: Unknown error 4294967295
iptables v1.3.5: can't initialize iptables table `mangle': Bad file descriptor
Perhaps iptables or your kernel needs to be upgraded.

<... etc>

I'm don't understand the things going on under the surface, so maybe there is
a reason it's impossible to have some kind of locking to prevent this, like
for example, with chmod:

#!/bin/sh
while [ 1 = 1 ]; do
    chmod 777 mod_me
done

#!/bin/sh
while [ 1 = 1 ]; do
    chmod 666 mod_me
done

(no errors)

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux