Opened 5 years ago

Closed 4 months ago

#11977 closed Bug Report - General (Won't Fix)

HDHomerun library calls spurious ioctl when discovering devices

Reported by: david.madsen@… Owned by: Karl Egly
Priority: minor Milestone: unknown
Component: MythTV - HDHomeRun Version: 0.27-fixes
Severity: low Keywords: hdhomerun CAP_SYS_MODULE
Cc: Ticket locked: no

Description

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.

Attachments (1)

mythtv_fix_hdhr_ioctl.patch (553 bytes) - added by david.madsen@… 5 years ago.
patch for ioctl fix in libhdhomerun

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by david.madsen@…

Attachment: mythtv_fix_hdhr_ioctl.patch added

patch for ioctl fix in libhdhomerun

comment:1 Changed 5 years ago by david.madsen@…

Some of the code in libhdhomerun was restructured in a more recent version. The problematic loop is actually in hdhomerun_local_ip_info().

I've attached a simple patch based on the fixes/0.27 branch.

comment:2 Changed 5 years ago by david.madsen@…

Somewhat delayed followup here. I made a post about the issue in the SiliconDust? forums, and the developers fixed the problem in the upstream libs.

Just adding a note here for future reference if a new revision of the libraries are pulled into MythTV.

comment:3 Changed 3 years ago by Karl Egly

Owner: changed from Silicondust to Karl Egly
Status: newaccepted

comment:4 Changed 4 months ago by David Hampton

Resolution: Won't Fix
Status: acceptedclosed

In v30, MythTV has been updated to use the external system version of the hdhomerun library.

Note: See TracTickets for help on using tickets.