Skip to contentSkip to conversation

Fix return value at nfattr_bad_size

PATCH Applied Pablo Neira 2 participants 2 messages Nov 8, 2005

Subsystems (2)
lore
Share & tools
lore

Pablo Neira

author maintainer
#0 lore raw

PATCH 1/8 Fix return value at nfattr_bad_size

Return -EINVAL if the size isn't OK instead of -EPERM.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

Return -EINVAL if the size isn't OK instead of -EPERM.

net/ipv4/netfilter/ip_conntrack_netlink.c +1 -1
Index: netfilter-2.6.14.git/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
@@ -593,7 +593,7 @@ static int ctnetlink_parse_nat_proto(str
 	nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr);
 
 	if (nfattr_bad_size(tb, CTA_PROTONAT_MAX, cta_min_protonat))
-		return -1;
+		return -EINVAL;
 
 	npt = ip_nat_proto_find_get(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum);
 	if (!npt)
Applied
#1 lore raw
Quoted 1 line · Pablo Neira

Return -EINVAL if the size isn't OK instead of -EPERM.

thanks, applied.

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie