fixed wirelesscontrol and included in core 8

git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1223 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2008-02-19 20:09:19 +00:00
parent 605cbe361b
commit 87f7ed9683
4 changed files with 23 additions and 28 deletions

View File

@@ -2,8 +2,8 @@ bin/ntfs-3g
#lib/libntfs-3g.a
#lib/libntfs-3g.la
lib/libntfs-3g.so
lib/libntfs-3g.so.21
lib/libntfs-3g.so.21.0.0
lib/libntfs-3g.so.23
lib/libntfs-3g.so.23.0.0
sbin/mount.ntfs-3g
#usr/include/ntfs-3g
#usr/include/ntfs-3g/attrib.h

View File

@@ -4,3 +4,4 @@ lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8169.ko
lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8168.ko
srv/web/ipfire/cgi-bin/logs.cgi/log.dat
etc/ntp
usr/local/bin/wirelessctrl

View File

@@ -2,3 +2,5 @@
. /opt/pakfire/lib/functions.sh
extract_files
depmod -a
echo "DROPWIRELESSFORWARD=on" >> /var/ipfire/optionsfw/settings
echo "DROPWIRELESSINPUT=on" >> /var/ipfire/optionsfw/settings

View File

@@ -25,30 +25,6 @@ FILE *fd = NULL;
char blue_dev[STRING_SIZE] = "";
char command[STRING_SIZE];
void exithandler(void)
{
struct keyvalue *kv = NULL;
char buffer[STRING_SIZE];
if(strlen(blue_dev))
{
if(findkey(kv, "DROPWIRELESSINPUT", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG --log-prefix 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
}
if(findkey(kv, "DROPWIRELESSFORWARD", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG --log-prefix 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
if (fd)
fclose(fd);
}
int main(void)
{
char green_dev[STRING_SIZE] = "";
@@ -110,8 +86,24 @@ int main(void)
exit(0);
}
/* register exit handler to ensure the block rule is always present */
atexit(exithandler);
if(strlen(blue_dev))
{
if(findkey(kv, "DROPWIRELESSINPUT", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG --log-prefix 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
}
if(findkey(kv, "DROPWIRELESSFORWARD", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG --log-prefix 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j DROP -m comment --comment 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
if (fd)
fclose(fd);
if (!(fd = fopen(CONFIG_ROOT "/wireless/config", "r")))
{