]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/if_ethersubr.c
xnu-1504.15.3.tar.gz
[apple/xnu.git] / bsd / net / if_ethersubr.c
index df6d5c284ccd49f255bb3a0ee48dba9b8a9294c0..e407e009fa8fe6e3d498bc026affbd3cef26aa88 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2009 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
 extern struct ifqueue pkintrq;
 #endif
 
-#if BRIDGE
-#include <net/bridge.h>
-#endif
-
 /* #include "vlan.h" */
 #if NVLAN > 0
 #include <net/if_vlan_var.h>
@@ -154,6 +150,8 @@ ether_resolvemulti(
                        return EADDRNOTAVAIL;
                MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
                       M_WAITOK);
+               if (sdl == NULL)
+                       return ENOBUFS;
                sdl->sdl_len = sizeof *sdl;
                sdl->sdl_family = AF_LINK;
                sdl->sdl_index = ifp->if_index;
@@ -181,6 +179,8 @@ ether_resolvemulti(
                 }
                 MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
                        M_WAITOK);
+               if (sdl == NULL)
+                       return ENOBUFS;
                 sdl->sdl_len = sizeof *sdl;
                 sdl->sdl_family = AF_LINK;
                 sdl->sdl_index = ifp->if_index;