Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137530544
D21812.id69424.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21812.id69424.diff
View Options
Index: sbin/ipfw/ipfw2.c
===================================================================
--- sbin/ipfw/ipfw2.c
+++ sbin/ipfw/ipfw2.c
@@ -3717,11 +3717,10 @@
if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
inet_pton(AF_INET6, host, &a) == 1)
ret = add_srcip6(cmd, av, cblen, tstate);
- /* XXX: should check for IPv4, not !IPv6 */
- if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
- inet_pton(AF_INET6, host, &a) != 1))
+ else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
+ inet_pton(AF_INET, host, &a) == 1)
ret = add_srcip(cmd, av, cblen, tstate);
- if (ret == NULL && strcmp(av, "any") != 0)
+ else if (ret == NULL && strcmp(av, "any") == 0)
ret = cmd;
return ret;
@@ -3748,11 +3747,10 @@
if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
inet_pton(AF_INET6, host, &a) == 1)
ret = add_dstip6(cmd, av, cblen, tstate);
- /* XXX: should check for IPv4, not !IPv6 */
- if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
- inet_pton(AF_INET6, host, &a) != 1))
+ else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
+ inet_pton(AF_INET6, host, &a) == 1)
ret = add_dstip(cmd, av, cblen, tstate);
- if (ret == NULL && strcmp(av, "any") != 0)
+ else if (ret == NULL && strcmp(av, "any") == 0)
ret = cmd;
return ret;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 25, 4:45 AM (9 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26099808
Default Alt Text
D21812.id69424.diff (1 KB)
Attached To
Mode
D21812: ipfw(8): When checking for IPv4 in add_src() and add_dat(), don't assume !IPv6 is IPv4
Attached
Detach File
Event Timeline
Log In to Comment