This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur /root/dhclient/clparse.c sbin/dhclient/clparse.c | |
--- /root/dhclient/clparse.c 2023-06-15 11:41:32.754958000 -0230 | |
+++ sbin/dhclient/clparse.c 2023-06-15 12:23:19.363379000 -0230 | |
@@ -47,6 +47,7 @@ | |
#include "dhcpd.h" | |
#include "dhctoken.h" | |
+#include <netinet/ip.h> | |
struct client_config top_level_config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur /root/dhclient/bpf.c sbin/dhclient/bpf.c | |
--- /root/dhclient/bpf.c 2023-06-15 11:41:32.749372000 -0230 | |
+++ sbin/dhclient/bpf.c 2023-06-15 16:12:19.135346000 -0230 | |
@@ -365,7 +365,7 @@ | |
if (to.s_addr == INADDR_BROADCAST) | |
assemble_hw_header(interface, buf, &bufp); | |
assemble_udp_ip_header(buf, &bufp, from.s_addr, to.s_addr, | |
- htons(REMOTE_PORT), (unsigned char *)&raw, len); | |
+ htons(REMOTE_PORT), (unsigned char *)&raw, len, interface); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# to get a eeprom dump from the stick: | |
# ethtool -m pon0 raw on | base64 | |
function dH(int $dec) { $hex = strtoupper(dechex($dec)); $l = strlen($hex); return "0x".str_pad($hex, ceil($l / 2) * 2, "0", STR_PAD_LEFT); } | |
function sH(string $string) { return strtoupper(bin2hex($string)); } | |
function cH(string $char) { return dH(ord($char)); } | |
function dB(int $dec) { $bin = decbin($dec); $l = strlen($bin); return str_pad($bin, ceil($l/8) * 8, "0", STR_PAD_LEFT); } | |
function bl(bool $bool) { return $bool ? 'true' : 'false'; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: DO NOT RUN THIS AS A SCRIPT, RUN THE COMMANDS MANUALLY | |
# Make rootfs persistent (yes, this command must be run twice) | |
fw_setenv bootcmd "run ubi_init; run flash_flash" | |
fw_setenv bootcmd "run ubi_init; run flash_flash" | |
# Confirm the change: | |
strings /dev/mtd1 | grep bootcmd | |
strings /dev/mtd2 | grep bootcmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$source_ip = '192.168.1.2'; | |
$source_port = 0; | |
$dest_ip = '192.168.1.1'; | |
$dest_port = 13456; | |
$block_size = 1436; | |
############################################################################### | |
function _err(string $message = '', int $code = 1): void { | |
if (strlen($message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
__author__ = "Visual Studio" | |
__credits__ = ["djGrrr", "Visual Studio"] | |
__license__ = "MIT" | |
__version__ = "1.0.0.0" | |
# Credit: https://gist.github.com/djGrrr/4413dacee0df28429306e9fdf4624e02 | |
from signal import * |