Skip to content
Snippets Groups Projects
Commit 469df055 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Tom's fix to the packet filter makes it possible for BOOTP to work... and now it does.

parent 63ac3c7b
No related merge requests found
......@@ -246,6 +246,11 @@ void pfilter_init_default()
pfilter_logic3(14, 1, AND, 6, OR, 5); /* r14 = ARP(broadcast) or PTPv2 */
pfilter_logic3(15, 10, AND, 7, OR, 14); /* r15 = ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
/* Ethernet = 14 bytes, IPv4 = 20 bytes, offset to dport: 2 = 36/2 = 18 */
pfilter_cmp(18, 0x0044, 0xffff, MOV, 14); /* r14 = 1 when dport = BOOTPC */
pfilter_logic3(14, 14, AND, 8, AND, 11); /* r14 = BOOTP/UDP/IP(unicast|broadcast) */
pfilter_logic2(15, 14, OR, 15); /* r15 = BOOTP/UDP/IP(unicast|broadcast) or ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
pfilter_logic3(20, 11, AND, 8, OR, 15); /* r16 = Something we accept */
pfilter_logic2(R_DROP, 20, NOT, 0); /* None match? drop */
......
......@@ -127,7 +127,6 @@ int process_bootp(uint8_t* buf, int len)
uint8_t mac[6];
get_mac_addr(mac);
mprintf("recvd: %d %x %d %d %d\n", len, buf[IP_VERSION], buf[IP_PROTOCOL], buf[UDP_DPORT+1], buf[UDP_SPORT+1]);
if (len != BOOTP_END) return 0;
if (buf[IP_VERSION] != 0x45) return 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment