Validate MAC addresses

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8466 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-04-20 19:48:02 +00:00
parent 5052246e9c
commit c805d895b7

View File

@ -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 ";
}