Using IsValid on the RadiusPacket

This commit is contained in:
Jakob A. Dam 2015-04-08 12:52:12 +02:00 committed by Jakob Aarøe Dam
parent 8bbd742aaa
commit 6afe01e932
2 changed files with 10 additions and 14 deletions

View file

@ -118,11 +118,19 @@ Public Class CICRadarR
' will fire up the callback procedure. Invalid requests are dropped, per RFC.
Private Sub ProcessPacket1812(ByVal packet As RADIUSPacket)
'Console.WriteLine("packet " & Now)
ProcessPacket(radius1812, packet)
If packet.IsValid Then
ProcessPacket(radius1812, packet)
Else
Console.WriteLine("Packet is not valid. Dropping.")
End If
End Sub
Private Sub ProcessPacket1645(ByVal packet As RADIUSPacket)
ProcessPacket(radius1645, packet)
If packet.IsValid Then
ProcessPacket(radius1645, packet)
Else
Console.WriteLine("Packet is not valid. Dropping.")
End If
End Sub
Private Sub AccessLog(ByVal message)

View file

@ -30,10 +30,6 @@ Public Class RDSHandler
End Sub
Public Sub ProcessRequest()
If ValidPacket() = False Then
Exit Sub
End If
ExtractAttributes()
If mIsAppLaunchRequest Then
@ -231,14 +227,6 @@ Public Class RDSHandler
Return email
End Function
Private Function ValidPacket()
If mPacket.UserName Is Nothing Then
Console.WriteLine("Not a valid radius packet.. No username present.. Drop!")
Return False
End If
Return True
End Function
Private Sub ExtractAttributes()
packetUsername = mPacket.UserName.ToLower
packetPassword = mPacket.UserPassword