Skip to contentSkip to conversation

: Backport fixes for ip6t_multiport

PATCH In review Patrick McHardy 1 participant 1 message Dec 20, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 15/18 : Backport fixes for ip6t_multiport

Backport fixes for ip6t_multiport.

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/12/05 23:32:41+01:00 [email protected]
# [NETFILTER]: Backport fixes for ip6t_multiport
#
# This patch fixes following bugs in ip6t_multiport.c,
#
# - missing check the size of the preference data.
# - IP6T_INV_PROTO should check with not ip->flags but ip->invflags.
#
# Signed-off-by: Yasuyuki KOZAKAI <[email protected]>
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/ipv6/netfilter/ip6t_multiport.c
#   2004/12/05 23:32:39+01:00 [email protected] +4 -1
#   [NETFILTER]: Backport fixes for ip6t_multiport
#   
#   This patch fixes following bugs in ip6t_multiport.c,
#   
#     - missing check the size of the preference data.
#     - IP6T_INV_PROTO should check with not ip->flags but ip->invflags.
#   
#   Signed-off-by: Yasuyuki KOZAKAI <[email protected]>
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
diff -Nru a/net/ipv6/netfilter/ip6t_multiport.c b/net/ipv6/netfilter/ip6t_multiport.c
--- a/net/ipv6/netfilter/ip6t_multiport.c	2004-12-20 07:01:28 +01:00
+++ b/net/ipv6/netfilter/ip6t_multiport.c	2004-12-20 07:01:28 +01:00
@@ -74,9 +74,12 @@
 {
 	const struct ip6t_multiport *multiinfo = matchinfo;

+ if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_multiport)))
+ return 0;
+
/* Must specify proto == TCP/UDP, no unknown flags or bad count */ return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP)
- && !(ip->flags & IP6T_INV_PROTO)
+ && !(ip->invflags & IP6T_INV_PROTO)
&& matchsize == IP6T_ALIGN(sizeof(struct ip6t_multiport)) && (multiinfo->flags == IP6T_MULTIPORT_SOURCE
|| multiinfo->flags == IP6T_MULTIPORT_DESTINATION