[ovs-dev] [PATCH 1/2] netdev-linux: Support 'send' for netdevs opened with NETDEV_ETH_TYPE_NONE.

Ethan Jackson ethan at nicira.com
Fri Apr 1 21:15:04 UTC 2011


>  /* A Netlink routing socket that is not subscribed to any multicast groups. */
>  static struct nl_sock *rtnl_sock;
> @@ -443,6 +444,14 @@ netdev_linux_init(void)
>         status = af_inet_sock >= 0 ? 0 : errno;
>         if (status) {
>             VLOG_ERR("failed to create inet socket: %s", strerror(status));
> +        } else {
> +            /* Create AF_PACKET socket. */
> +            af_packet_sock = socket(AF_PACKET, SOCK_RAW, 0);
> +            status = af_packet_sock >= 0 ? 0 : errno;
> +            if (status) {
> +                VLOG_ERR("failed to create packet socket: %s",
> +                         strerror(status));
> +            }
>         }

It's not clear to me why this is an else condition.  Is it possible to
create an af_packet_socket when an af_inet_socket fails?  It seems
like they are orthogonal.

Looks Good to me.



More information about the dev mailing list