← Commit list

ffc3a93d0

Denys Vlasenko
Denys Vlasenko
2014-02-19
SUCCESS Duration: 147s

Subject

udhcpc: fix BPF filter. Hopefully fixes the root cause of 4598 and 6746

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/d6_dhcpc.c+1 -1
@@ -711,7 +711,7 @@ static int d6_raw_socket(int ifindex)
/* jump to L3 if udp dport is CLIENT_PORT6, else to L4 */
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, 68, 0, 1),
/* L3: accept packet */
- BPF_STMT(BPF_RET|BPF_K, 0xffffffff),
+ BPF_STMT(BPF_RET|BPF_K, 0x7fffffff),
/* L4: discard packet */
BPF_STMT(BPF_RET|BPF_K, 0),
};
networking/udhcp/dhcpc.c+4 -3
@@ -1025,9 +1025,10 @@ static int udhcp_raw_socket(int ifindex)
BPF_STMT(BPF_LD|BPF_H|BPF_IND, 2),
/* jump to L3 if udp dport is CLIENT_PORT, else to L4 */
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, 68, 0, 1),
- /* L3: accept packet */
- BPF_STMT(BPF_RET|BPF_K, 0xffffffff),
- /* L4: discard packet */
+ /* L3: accept packet ("accept 0x7fffffff bytes") */
+ /* Accepting 0xffffffff works too but kernel 2.6.19 is buggy */
+ BPF_STMT(BPF_RET|BPF_K, 0x7fffffff),
+ /* L4: discard packet ("accept zero bytes") */
BPF_STMT(BPF_RET|BPF_K, 0),
};
static const struct sock_fprog filter_prog = {