From: Sepherosa Ziehau Date: Sat, 26 Jul 2008 04:58:41 +0000 (+0000) Subject: MFC if_ethersubr.c rev1.77: X-Git-Tag: v2.0.1~57 X-Git-Url: https://repo.or.cz/w/dragonfly.git/commitdiff_plain/3d77cc8ec2e38e674eb8441cc11e0bd3d86ccf27 MFC if_ethersubr.c rev1.77: Simplify ether_mport(). This also fixes the bug that m0 is not cleared in the first place, which causes caller panik. Reported-by: elekktretterr@exemail.com.au --- diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6070eefd8e..069ed6a18d 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -32,7 +32,7 @@ * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.33 2003/04/28 15:45:53 archie Exp $ - * $DragonFly: src/sys/net/if_ethersubr.c,v 1.76 2008/07/08 13:50:52 sephe Exp $ + * $DragonFly: src/sys/net/if_ethersubr.c,v 1.76.2.1 2008/07/26 04:58:41 sephe Exp $ */ #include "opt_atalk.h" @@ -1658,11 +1658,8 @@ ether_init_netpacket(int num, struct mbuf *m) } static __inline struct lwkt_port * -ether_mport(int num, struct mbuf **m0) +ether_mport(int num, struct mbuf **m) { - struct lwkt_port *port; - struct mbuf *m = *m0; - if (num == NETISR_MAX) { /* * All packets whose target msgports can't be @@ -1671,13 +1668,7 @@ ether_mport(int num, struct mbuf **m0) */ return cpu_portfn(0); } - - port = netisr_find_port(num, &m); - if (port == NULL) - return NULL; - - *m0 = m; - return port; + return netisr_find_port(num, m); } void