]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/route.c
xnu-3789.31.2.tar.gz
[apple/xnu.git] / bsd / net / route.c
index 4e5dd5af797045e9148aa5ce7774f2e8bf0c0320..94750b9e887608731e184017d5efe1e9485f5ef7 100644 (file)
@@ -770,6 +770,17 @@ rtm_scrub(int type, int idx, struct sockaddr *hint, struct sockaddr *sa,
                }
                break;
        }
+       case RTAX_GATEWAY: {
+               /*
+                * Break if the gateway is not AF_LINK type (indirect routes)
+                *
+                * Else, if is, check if it is resolved. If not yet resolved
+                * simply break else scrub the link layer address.
+                */
+               if ((sa->sa_family != AF_LINK) || (SDL(sa)->sdl_alen == 0))
+                       break;
+               /* fallthrough */
+       }
        case RTAX_IFP: {
                if (sa->sa_family == AF_LINK && credp) {
                        struct sockaddr_dl *sdl = SDL(buf);