[PATCH 1/1] ws2_32: Selectively bind UDP sockets to interfaces while still allowing broadcast packets (try 3).

Erich E. Hoover ehoover at mines.edu
Thu Dec 22 13:39:43 CST 2011

Real Name:
    Erich Hoover

    I know it's been quite a while, but I'm back with another solution
for Bug #7929 (broadcast packets on a socket bound to a specific
interface).  This patch uses SO_BINDTODEVICE in order to bind a socket
to a specific interface while still allowing broadcast packets (a
Linux-only feature).  While this feature normally requires root
privileges, it can also be enabled by giving wine-preloader the
CAP_NET_RAW capability.  Should insufficient permissions be available,
the patch outputs an appropriate error message notifying the user that
broadcast packets will not function properly.
    Marcus Meissner's mentioned that no sane distributor will enable
CAP_NET_RAW on the preloader, I don't feel that that is necessary for
the inclusion of this patch.  In my mind this functionality falls
under the same category as ICMP and raw socket creation (two other
features requiring CAP_NET_RAW).  So, if an end-users wants/needs this
feature then they will need to enable it themselves.
    Per Juan Lang's suggestions, this version includes a much better
comment describing the intended behavior and a BOOL return type.  I'm
leaving the #ifdef where it is for now, as I believe the current
location is the most appropriate, but I can change it if necessary.

    ws2_32: Selectively bind UDP sockets to interfaces while still
allowing broadcast packets.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ws2_32-Selectively-bind-UDP-sockets-to-interfaces-wh.patch
Type: text/x-patch
Size: 5376 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20111222/0e853305/attachment.bin>

More information about the wine-patches mailing list