Bug 21798 - Rule replacing sets mask /0
Summary: Rule replacing sets mask /0
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: iptables (show other bugs)
Version: unstable
Hardware: all Linux
: P3 critical
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-01 01:46 MSD by Nikolay A. Fetisov
Modified: 2010-06-27 10:42 MSD (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay A. Fetisov 2009-10-01 01:46:32 MSD
Для iptables 1.4.5-alt1 при перезаписи правил в адресах маска заменяется на /0.

Пример:

Чистая таблица:
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

Добавляем пару правил:
# iptables -A INPUT -d 1.2.3.4/32 -p tcp --dport 22 -j ACCEPT
# iptables -A INPUT -d 2.3.4.0/24 -p tcp --dport 22 -j ACCEPT
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -d 2.3.4.0/24 -p tcp -m tcp --dport 22 -j ACCEPT

Перезаписываем на то же самое:
# iptables -R INPUT 1 -d 1.2.3.4/32 -p tcp --dport 22 -j ACCEPT
# iptables -R INPUT 2 -d 2.3.4.0/24 -p tcp --dport 22 -j ACCEPT

Получаем:
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -d 1.2.3.4/0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -d 2.3.4.0/0 -p tcp -m tcp --dport 22 -j ACCEPT
Comment 1 Nikolay A. Fetisov 2010-06-27 10:41:54 MSD
Исправлено в upstream начиная с 1.4.6, текущие 1.4.8-alt1 в Sisyphus и 1.4.7-alt1 в M51 данной ошибки не содержат.