summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Sekletar <msekleta@redhat.com>2014-07-07 15:27:24 +0200
committerMichal Sekletar <msekleta@redhat.com>2014-07-07 15:59:13 +0200
commitffc90a11962274ac597b7838f31a4aff0362aa46 (patch)
tree4018c4717b48fe6d5aa05fb916a8831b01143b79
parentb064329fd80b8d0fe2e46c561f92886090fa20d1 (diff)
dhcp-network: make clear that we are ANDing Fragment offset field with mask
Reading BPF assembly written as C macros is inherently difficult. Don't make it harder than necessary and provide clearer explanation in the comment.
-rw-r--r--src/libsystemd-network/dhcp-network.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c
index 17020b0a00..16411cc41a 100644
--- a/src/libsystemd-network/dhcp-network.c
+++ b/src/libsystemd-network/dhcp-network.c
@@ -46,7 +46,7 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link,
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 1, 0), /* A == 0 ? */
BPF_STMT(BPF_RET + BPF_K, 0), /* ignore */
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(DHCPPacket, ip.frag_off)), /* A <- Flags + Fragment offset */
- BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0x1fff), /* A <- A & 0x1fff */
+ BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0x1fff), /* A <- A & 0x1fff (Fragment offset) */
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 1, 0), /* A == 0 ? */
BPF_STMT(BPF_RET + BPF_K, 0), /* ignore */
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(DHCPPacket, udp.dest)), /* A <- UDP destination port */