diff options
author | Denys Vlasenko | 2014-02-07 17:38:52 +0100 |
---|---|---|
committer | Denys Vlasenko | 2014-02-07 17:38:52 +0100 |
commit | 744ee5db1c2d6c34c1988343728b2fc37a908f83 (patch) | |
tree | 643dba8df1dd7629d2e8021e60518d2972909576 /networking/udhcp | |
parent | 3ba2df874ca27f075a0897210d8dce6c56646e60 (diff) | |
download | busybox-744ee5db1c2d6c34c1988343728b2fc37a908f83.zip busybox-744ee5db1c2d6c34c1988343728b2fc37a908f83.tar.gz |
udhcpc: in comments, explain the kind of raw socket we create
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/dhcpc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index ee19f55..bdb1e2b 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -979,6 +979,10 @@ static int udhcp_raw_socket(int ifindex) log1("Opening raw socket on ifindex %d", ifindex); //log2? fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); + /* ^^^^^ + * SOCK_DGRAM: remove link-layer headers on input (SOCK_RAW keeps them) + * ETH_P_IP: want to receive only packets with IPv4 eth type + */ log1("Got raw socket fd"); //log2? sock.sll_family = AF_PACKET; @@ -1005,8 +1009,6 @@ static int udhcp_raw_socket(int ifindex) * * Copyright: 2006, 2007 Stefan Rompf <sux@loplof.de>. * License: GPL v2. - * - * TODO: make conditional? */ static const struct sock_filter filter_instr[] = { /* load 9th byte (protocol) */ |