Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45876
b: refs/heads/master
c: d5e76b0
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jan 26, 2007
1 parent 65e6d64 commit d6cbb2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95743deb34de29defbb98ad477700aaf344f93f3
refs/heads/master: d5e76b0a280f71b20bdd20d1c1b4d6812ceb8c3a
16 changes: 8 additions & 8 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
if (dev == NULL)
goto out_unlock;

err = -ENETDOWN;
if (!(dev->flags & IFF_UP))
goto out_unlock;

/*
* You may not queue a frame bigger than the mtu. This is the lowest level
* raw protocol and you must do your own fragmentation at this level.
Expand Down Expand Up @@ -407,10 +411,6 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
if (err)
goto out_free;

err = -ENETDOWN;
if (!(dev->flags & IFF_UP))
goto out_free;

/*
* Now send it
*/
Expand Down Expand Up @@ -738,6 +738,10 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
if (sock->type == SOCK_RAW)
reserve = dev->hard_header_len;

err = -ENETDOWN;
if (!(dev->flags & IFF_UP))
goto out_unlock;

err = -EMSGSIZE;
if (len > dev->mtu+reserve)
goto out_unlock;
Expand Down Expand Up @@ -770,10 +774,6 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
skb->dev = dev;
skb->priority = sk->sk_priority;

err = -ENETDOWN;
if (!(dev->flags & IFF_UP))
goto out_free;

/*
* Now send it
*/
Expand Down

0 comments on commit d6cbb2d

Please sign in to comment.