mpetazzoni / ptftpd

A TFTP/PXE tool suite written in Python
GNU General Public License v3.0
98 stars 43 forks source link

cannot stat /proc/sys/net/inet/udp/maxdgram #32

Open alex-eri opened 3 years ago

alex-eri commented 3 years ago

Linux 5.10.20-1-lts

INFO(tftpd): Serving file tp_recovery.bin to host 192.168.0.2...
sysctl: cannot stat /proc/sys/net/inet/udp/maxdgram: Нет такого файла или каталога
INFO(tftpd): Serving file tp_recovery.bin to host 192.168.0.2...
sysctl: cannot stat /proc/sys/net/inet/udp/maxdgram: Нет такого файла или каталога
MatthewTingum commented 1 year ago

This seems to be a duplicate of #19

grupofaster commented 7 months ago

Hello, I have corrected it by placing an exception in the get_max_udp_datagram_size() method in tftpserver.py file as follows:

def get_max_udp_datagram_size(): """Retrieve the maximum UDP datagram size allowed by the system.""" try: val = subprocess.check_output(['sysctl', '-n', 'net.inet.udp.maxdgram']) except Exception as err: val = subprocess.check_output(['sysctl', '-n', 'net.core.rmem_max']) return int(val)

We noticed that syctl does not get this system variable net.inet.udp.maxdgram, so we add the one that in my case (ubuntu server) finds: net.core.rmem_max

image

Regards, Franklin frincon@grupofaster.com www.grupofaster.com