Option 50 not showing
ca408901 opened this issue · 2 comments
Option 50 (Requestd IP) is not propery passed to the script on relayed request packet.
Here is debug of script compared against tcpdump (some info are masked)
debug script output
pkt4_receive
KEA_QUERY4_TYPE : DHCPREQUEST
KEA_QUERY4_INTERFACE : ens192
KEA_QUERY4_IFINDEX : 2
KEA_QUERY4_HWADDR : ec:4f:82:11:09:86
KEA_QUERY4_HWADDR_TYPE : 1
KEA_QUERY4_HWADDR_SOURCE : 0
KEA_QUERY4_CIADDR : 0.0.0.0
KEA_QUERY4_SIADDR : 0.0.0.0
KEA_QUERY4_YIADDR : 0.0.0.0
KEA_QUERY4_GIADDR : xxx.71.223.1
KEA_QUERY4_RELAYED : 1
KEA_QUERY4_RELAY_HOPS : 0
KEA_QUERY4_OPTION60 : 844E-1.ENT.dslforum.org
tcpdump
09:54:05.494581 IP (tos 0x0, ttl 30, id 47192, offset 0, flags [none], proto UDP (17), length 356)
xxx.71.223.1 > xxx.19.180.2: [udp sum ok] BOOTP/DHCP, Request from ec:4f:82:11:09:86 (oui Unknown), length 328, xid 0x31e4c05, Flags [none] (0x0000)
Gateway-IP xxx.71.223.1
Client-Ethernet-Address ec:4f:82:11:09:86 (oui Unknown)
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Vendor-Class Option 60, length 23: "844E-1.ENT.dslforum.org"
T125 Option 125, length 32: -------removed string------------
Requested-IP Option 50, length 4: xxx.71.223.28
Server-ID Option 54, length 4: xxx.19.180.2
Parameter-Request Option 55, length 10:
Subnet-Mask, Classless-Static-Route, Vendor-Option, FQDN
Option 120, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR
END Option 255, length 0
PAD Option 0, length 0
Hi,
Indeed, for now only option 60 is parsed. See #3 and #13 for a discussion on adding new options.
In the case of option 50, it seems simpler: there is no suboption, and the format is simply an IP address.
You can try adding support for option 50 based on https://github.com/zorun/kea-hook-runscript/blob/master/src/callouts.cc#L60 , and then feel free to open a PR.
Hi Zorun,
Thank you so much for a quick response. I'll try that and see if I make it work.