Pushes the flow rules also when devices are available (with DEVICE_AVAILABLLITY_CHANGED event).

Change-Id: Ia92df8c5da5828a9db2492e93a42bfd9a5136d25
diff --git a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
index ee07183..d669d72 100644
--- a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
+++ b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
@@ -265,10 +265,17 @@
         @Override
         public void event(DeviceEvent event) {
             Device device = event.subject();
-            if (event.type() == DeviceEvent.Type.DEVICE_ADDED) {
-                for (PacketRequest request : store.existingRequests()) {
-                    pushRule(device, request);
-                }
+            switch (event.type()) {
+                case DEVICE_ADDED:
+                case DEVICE_AVAILABILITY_CHANGED:
+                    if (deviceService.isAvailable(event.subject().id())) {
+                        for (PacketRequest request : store.existingRequests()) {
+                            pushRule(device, request);
+                        }
+                    }
+                    break;
+                default:
+                    break;
             }
         }
     }