From 6ef549c7bac21806589e50882afc88ea04505058 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 21 Sep 2010 06:13:07 +0000 Subject: No need to m_freem() a NULL pointer and change the error for unknown protocols to EPFNOSUPPORT. --- sys/net/if_mpe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 870360f2beb..965390fec42 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.22 2010/08/25 13:57:07 claudio Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.23 2010/09/21 06:13:06 claudio Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -242,7 +242,6 @@ mpeoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, off = sizeof(sa_family_t) + sizeof(in_addr_t); M_PREPEND(m, sizeof(shim) + off, M_DONTWAIT); if (m == NULL) { - m_freem(m); error = ENOBUFS; goto out; } @@ -253,7 +252,7 @@ mpeoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, #endif default: m_freem(m); - error = ENETDOWN; + error = EPFNOSUPPORT; goto out; } -- cgit v1.2.3