}
}
-bool relayd_handle_dhcp_packet(struct relayd_interface *rif, void *data, int len, bool forward)
+bool relayd_handle_dhcp_packet(struct relayd_interface *rif, void *data, int len, bool forward, bool parse)
{
struct ip_packet *pkt = data;
struct udphdr *udp;
if (dhcp->op == 2) {
host = relayd_refresh_host(rif, pkt->eth.ether_shost, (void *) &pkt->iph.saddr);
- if (host)
+ if (host && parse)
parse_dhcp_options(host, dhcp, udplen - sizeof(struct udphdr));
}
static int inet_sock;
static int forward_bcast;
static int forward_dhcp;
+static int parse_dhcp;
uint8_t local_addr[4];
int local_route_table;
if (!forward_bcast && !forward_dhcp)
continue;
- if (relayd_handle_dhcp_packet(rif, pktbuf, pktlen, forward_dhcp))
+ if (relayd_handle_dhcp_packet(rif, pktbuf, pktlen, forward_dhcp, parse_dhcp))
continue;
if (forward_bcast)
" -T <table> Set routing table number for automatically added routes\n"
" -B Enable broadcast forwarding\n"
" -D Enable DHCP forwarding\n"
+ " -P Disable DHCP options parsing\n"
" -L <ipaddr> Enable local access using <ipaddr> as source address\n"
"\n",
progname);
host_ping_tries = 5;
forward_bcast = 0;
local_route_table = 0;
+ parse_dhcp = 1;
uloop_init();
- while ((ch = getopt(argc, argv, "I:i:t:p:BDdT:G:R:L:")) != -1) {
+ while ((ch = getopt(argc, argv, "I:i:t:p:BDPdT:G:R:L:")) != -1) {
switch(ch) {
case 'I':
managed = true;
case 'D':
forward_dhcp = 1;
break;
+ case 'P':
+ parse_dhcp = 0;
+ break;
case 'T':
route_table = atoi(optarg);
if (route_table <= 0)
void relayd_add_pending_route(const uint8_t *gateway, const uint8_t *dest, uint8_t mask, int timeout);
void relayd_forward_bcast_packet(struct relayd_interface *from_rif, void *packet, int len);
-bool relayd_handle_dhcp_packet(struct relayd_interface *rif, void *data, int len, bool forward);
+bool relayd_handle_dhcp_packet(struct relayd_interface *rif, void *data, int len, bool forward, bool parse);
#endif