DHCP over PPP - or how to use sockets instead of BPF?
plahti at qnx.com
Thu Apr 15 18:51:17 UTC 2010
I tired to search the archives but couldn't find anything definitive on
this. So apologies if this is a repeat.
When I start dhclient or dhcpd (this is version 4.1.1) to run over a PPP
interface I get: "Unsupported device type 23 for "ppp0"" This comes from
bpf.c:get_hw_info(). But I think it's about more than simply not being
able to get the hardware address.
AFAICT from the code, this is because the packets are sent/received in
the raw link form through BPF, and so the code will have to
encapsulate/decapsulate link, IP and UDP headers. And that's probably
why PPP interfaces aren't supported, the code to doe the link
encap/decap isn't implemented (yet). Is this the correct understanding?
One way to get around this would be to implement support for PPP. Is
there anyone else who has already done this? Would more than encap/decap
AFAIU, BPF is used because of problems with BSD sockets when e.g.
sending to 255.255.255.255 broadcast address, sending direct without
issuing ARP, and sending when interface is not configured (has address
0.0.0.0) etc. Could using BSD sockets get around the need to implement
encap/decap for PPP but still get by without running into too much
trouble with the BSD sockets?
To attempt at getting around this, I was trying to build the package
such that it would use regular BSD sockets instead of BPF and avoid the
encap/decap problem altogether. I understand there's a socket fallback
mechanism, but I can't seem to get the #define-s correctly. I tried
#define USE_SOCKETS in site.h but then get_hw_addr is undefined. What
combination of #defines will allow me to compile and try using BSD
sockets instead of BPF?
PS. I know IPCP provides IPv4 addresses and link-local IPv6 addresses,
but DHCP over PPP is useful to get other configuration (such as name
servers) as well as IPv6 (global/UL scope) address configuration.
Regards and thanks in advance,
More information about the dhcp-users