Skip to content

DHCP segfault #2

@kurojishi

Description

@kurojishi

i'm using this click configuration with dhcp as a ethernet level router, when there is a dhcp requests the click instance crash 100% of the times

the problem seems to be in checkDHCPMsg, this element seems to assume that all packets are valid ip packets doing a jump of 28 bytes.
i can change my conf to let i work but there is need of safety

//elements declaration 
require(package dhcp) 
ControlSocket(unix, /tmp/eth2.clicksocket) 
switch :: EtherSwitch; 
from_bs :: FromDevice(eth1, PROMISC true); 
to_bs :: ToDevice(eth1); 
from_net :: FromDevice(eth2, PROMISC true); 
to_net :: ToDevice(eth2); 

elementclass DHCPServer { 
$eth, $ip | 
lease :: DHCPLeaseHash($eth, $ip); 
checker :: CheckDHCPMsg; 
classifier :: DHCPClassifier(discover, requests, release, -); 
input -> checker; 
checker[1] -> output; 
checker[0] -> classifier; 
classifier[0] -> offer :: DHCPServerOffer(lease) -> output; 
classifier[1] -> ack :: DHCPServerACKorNAK(lease) -> output; 
classifier[2] -> release :: DHCPServerRelease(lease); 
classifier[3] -> sink :: Discard; 
} 


//dest address whitelist, the 2 Addresses are example and will be more than 2 
filter_from_network :: { 
filter_1 :: HostEtherFilter(00:1e:42:02:02:02, DROP_OWN false, DROP_OTHER true); 
filter_2 :: HostEtherFilter(00:1e:42:02:02:02, DROP_OWN false, DROP_OTHER true); 
input -> filter_1; 
filter_1[0], filter_2[0] -> output; 
filter_1[1] -> filter_2[1] -> sink :: Discard; 
} 

//source address whitelist, the 2 Addresses are example and will be more than 2 
filter_from_bs :: { 
filter_1 :: HostEtherFilter(00:1e:42:02:02:02, DROP_OWN true, DROP_OTHER false); 
filter_2 :: HostEtherFilter(00:1e:42:02:02:02, DROP_OWN true, DROP_OTHER false); 
input -> filter_1; 
filter_1[1] -> dhcp_1 :: DHCPServer(00:1e:42:02:02:02, 192.168.1.200) -> output; filter_2[1] -> dhcp_2 :: DHCPServer(00:1e:42:02:03:03, 192.168.1.150) -> output; 
filter_1[0] -> filter_2[0] -> sink :: Discard; 
} 


bs_queue :: Queue -> to_bs; 
net_queue :: Queue -> to_net; 

//take packet from the network, apply a whitelist of the destination addresses, remove vlan header and put them in the switch 
from_net -> filter_from_network -> [0]switch;  
// setting vlan annotation for the packets directed to the network and putting them in queue 
switch[0] -> net_queue; 

//take packet from the BS, apply a whitelist of the source addresses, remove vlan header and put them in the switch 
from_bs -> filter_from_bs -> [1]switch; 
//setting the vlan annotation for packets for the Baystation and putting them in queue 
switch[1] -> bs_queue;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions