Simplify some code by eliminating duplicate if-else clauses in packet_do_bind().
Signed-off-by: Urs Thuermann <[EMAIL PROTECTED]> --- net-2.6/net/packet/af_packet.c.orig 2007-11-05 13:07:28.000000000 +0100 +++ net-2.6/net/packet/af_packet.c 2007-11-08 12:14:25.000000000 +0100 @@ -886,20 +886,14 @@ static int packet_do_bind(struct sock *s if (protocol == 0) goto out_unlock; - if (dev) { - if (dev->flags&IFF_UP) { - dev_add_pack(&po->prot_hook); - sock_hold(sk); - po->running = 1; - } else { - sk->sk_err = ENETDOWN; - if (!sock_flag(sk, SOCK_DEAD)) - sk->sk_error_report(sk); - } - } else { + if (!dev || (dev->flags & IFF_UP)) { dev_add_pack(&po->prot_hook); sock_hold(sk); po->running = 1; + } else { + sk->sk_err = ENETDOWN; + if (!sock_flag(sk, SOCK_DEAD)) + sk->sk_error_report(sk); } out_unlock: - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html