From c805d895b772a18b2a1cc9c575a6ed9c8aa47536 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 20 Apr 2008 19:48:02 +0000 Subject: [PATCH] Validate MAC addresses git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8466 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Chains.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 8c1593875..470264c61 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1194,6 +1194,8 @@ sub mac_match( $ ) { $mac =~ s/^!// if my $invert = ( $1 ? '! ' : ''); $mac =~ tr/-/:/; + fatal_error "Invalid MAC address ($mac)" unless $mac =~ /^([0-9a-fA-f]{2}:){5}[0-9a-fA-f]{2}$/; + "--match mac --mac-source ${invert}$mac "; }