I was testing running ovs-vswitchd as non-root, so socket()
failed and set_nonblocking() logged an error.

On Thu, May 12, 2011 at 06:48:56PM -0700, Ethan Jackson wrote:
> Out of curiosity, how did you notice this?  Some sort of static
> analyzer, or just poking around the code?
>
> Ethan
> 
> On Mon, May 2, 2011 at 12:58, Ben Pfaff <[email protected]> wrote:
> > ---
> > ?lib/netdev-linux.c | ? ?5 +++--
> > ?1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> > index 384fdaf..1c5ddc5 100644
> > --- a/lib/netdev-linux.c
> > +++ b/lib/netdev-linux.c
> > @@ -451,11 +451,12 @@ netdev_linux_init(void)
> > ? ? ? ? ? ? /* Create AF_PACKET socket. */
> > ? ? ? ? ? ? af_packet_sock = socket(AF_PACKET, SOCK_RAW, 0);
> > ? ? ? ? ? ? status = af_packet_sock >= 0 ? 0 : errno;
> > - ? ? ? ? ? ?if (status) {
> > + ? ? ? ? ? ?if (!status) {
> > + ? ? ? ? ? ? ? ?set_nonblocking(af_packet_sock);
> > + ? ? ? ? ? ?} else {
> > ? ? ? ? ? ? ? ? VLOG_ERR("failed to create packet socket: %s",
> > ? ? ? ? ? ? ? ? ? ? ? ? ?strerror(status));
> > ? ? ? ? ? ? }
> > - ? ? ? ? ? ?set_nonblocking(af_packet_sock);
> > ? ? ? ? }
> >
> > ? ? ? ? /* Create rtnetlink socket. */
> > --
> > 1.7.4.4
> >
> > _______________________________________________
> > dev mailing list
> > [email protected]
> > http://openvswitch.org/mailman/listinfo/dev
> >
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to