﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
11977	HDHomerun library calls spurious ioctl when discovering devices	david.madsen@…	Karl Egly	"After updating my kernel several months ago I started receiving lots of these kernel messages.

[9032269.637115] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[9032335.163087] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[9032345.164423] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.

After several months of on and off debugging I've finally traced where they are coming from.  

When the HDHR library attempts to discover the IP address of the device, it is utilizing ioctls to enumerate the network interfaces on the host.  Inside the function hdhomerun_discover_sock_detect_internal() it calls SIOCGIFCONF and loops over the result to retrieve the status of the various network interfaces.

The loop control ""(ptr <= end)"" however is running past the end of the data returned from SIOCGIFCONF and makes an extra call to SIOCGIFADDR without valid data.  This results in this error (from an strace):

ioctl(4, SIOCGIFFLAGS, {ifr_name="""", ???}) = -1 ENODEV (No such device)

The error return is handled gracefully, but this ioctl call also triggers the kernel to attempt to load modules to add a network device named """", which then results in the previously mentioned warnings in the kernel log.

I've modified the while loop to ""ptr < end"" without any issues other than resolving the kernel log spam.

This is really an upstream issue in the HDHR libraries themselves, but since MythTV uses a local version of them I've filed it here.  I'm not sure where specifically to file the issue for the Silicondust guys to address so if anyone knows where to do that please pass the info along."	Bug Report - General	closed	minor	unknown	MythTV - HDHomeRun	0.27-fixes	low	Won't Fix	hdhomerun CAP_SYS_MODULE		0
