summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-08-29 19:12:18 +0000
committerrwatson <rwatson@FreeBSD.org>2003-08-29 19:12:18 +0000
commit6980f2b7ee2c0655cdc6b753384a9c67db9ecc4e (patch)
tree9187272707f38de3c86f55daf69a0d09a465f209 /sys/net/if_ethersubr.c
parent4f2bccb6d1f59846b09d2a70a8587ab04006e2f2 (diff)
downloadFreeBSD-src-6980f2b7ee2c0655cdc6b753384a9c67db9ecc4e.zip
FreeBSD-src-6980f2b7ee2c0655cdc6b753384a9c67db9ecc4e.tar.gz
Introduce error checking for calls to M_PREPEND():
ether_output() when prepending netatalk AFA_PHASE2 llc headers (TRYWAIT). ether_output() when prepending ethernet header to a frame (DONTWAIT).
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 2a5de54..9624e11 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -212,6 +212,8 @@ ether_output(ifp, m, dst, rt0)
struct llc llc;
M_PREPEND(m, LLC_SNAPFRAMELEN, M_TRYWAIT);
+ if (m == NULL)
+ senderr(ENOBUFS);
llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
llc.llc_control = LLC_UI;
bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
@@ -249,7 +251,7 @@ ether_output(ifp, m, dst, rt0)
* allocate another.
*/
M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
eh = mtod(m, struct ether_header *);
(void)memcpy(&eh->ether_type, &type,
OpenPOWER on IntegriCloud