chiark / gitweb /
dhcp-network: remove TODO
authorMichal Sekletar <msekleta@redhat.com>
Wed, 18 Jun 2014 16:14:51 +0000 (18:14 +0200)
committerMichal Sekletar <msekleta@redhat.com>
Wed, 18 Jun 2014 16:14:51 +0000 (18:14 +0200)
There is no need to explicitly check version of L3 protocol in the
ethernet header because we bind socket with .sll_protocol set to
ETH_P_IP, thus we only receive IPv4 packets on the socket.

src/libsystemd-network/dhcp-network.c

index 266bf1317899b00e822f2e668b27df774dc3e1d9..d7ba0efa1281c9f80244614a9fa49d7684518fd3 100644 (file)
@@ -38,7 +38,6 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link,
             BPF_STMT(BPF_LD + BPF_W + BPF_LEN, 0),                                 /* A <- packet length */
             BPF_JUMP(BPF_JMP + BPF_JGE + BPF_K, sizeof(DHCPPacket), 1, 0),         /* packet >= DHCPPacket ? */
             BPF_STMT(BPF_RET + BPF_K, 0),                                          /* ignore */
-            /* TODO: match ip.version */
             BPF_STMT(BPF_LD + BPF_B + BPF_ABS, offsetof(DHCPPacket, ip.protocol)), /* A <- IP protocol */
             BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 1, 0),                /* IP protocol == UDP ? */
             BPF_STMT(BPF_RET + BPF_K, 0),                                          /* ignore */