← Commit list

744ee5db1

Denys Vlasenko
Denys Vlasenko
2014-02-07
SUCCESS Duration: 143s

Subject

udhcpc: in comments, explain the kind of raw socket we create

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/udhcp/dhcpc.c+4 -2
@@ -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 <[email protected]>.
* License: GPL v2.
- *
- * TODO: make conditional?
*/
static const struct sock_filter filter_instr[] = {
/* load 9th byte (protocol) */