OS-4979: lxbrand SOCK_PACKET not supported


Issue Type:Bug
Priority:4 - Normal
Created at:2015-11-23T18:30:04.000Z
Updated at:2019-08-28T17:24:34.309Z


Created by:Former user
Reported by:Former user




Reported by nash_ via IRC:

isc-dhcpd is failing during initialization:

18356 socket(PF_PACKET, SOCK_PACKET, 768) = -1 ESOCKTNOSUPPORT (Socket type not supported)
18356 sendto(3, "<187>Nov 23 18:06:41 dhcpd: sock"..., 73, MSG_NOSIGNAL, NULL, 0) = 73

The PF_PACKET sockmod does not yet support this type.


Comment by Former user
Created at 2015-11-23T19:49:04.000Z

The packet(7) man page from Linux notes the difference between SOCK_RAW and SOCK_PACKET:

       Linux   2.0   only   supported   SOCK_RAW   as   (PF_INET,
       SOCK_PACKET). This is still supported but deprecated.  The
       main  difference  between SOCK_RAW and SOCK_PACKET is that
       that SOCK_PACKET uses the old  sockaddr_pkt  structure  to
       specify an interface.

              struct sockaddr_pkt
              unsigned short spkt_family;
              unsigned char spkt_device[14];
              unsigned short spkt_protocol;

       spkt_family contains the device type, spkt_protocol is the
       IEEE 802.3 protocol type as defined in the  sys/if_ether.h
       include.   spkt_device is the device name as a null termi-
       nated string, e.g. eth0.

       This structure is obsolete and should not be used  in  new

Comment by Former user
Created at 2015-11-23T20:41:25.000Z

Since it appears that the other facilities are largely the same for SOCK_PACKET, this should be relatively straightforward to emulate in the LX layer. Translation from the PACKET sockaddr to sockaddr_ll can be performed in ltos_sockaddr_copyin, triggered off SOCK_PACKET state stored in the lx_socket_aux data.

Comment by Former user
Created at 2015-12-03T16:12:04.000Z

Looking more closely at the docs for PF_PACKET and our implementation in sockmod_pfp, it appears that there might be more wrong than originally thought.