Changeset 32709


Ignore:
Timestamp:
Jul 16, 2017, 1:15:56 PM (10 days ago)
Author:
brainslayer
Message:

Only flush IPv4 rules on IPv4 address event. Only flush IPv6 rules on IPv6 address event.

Location:
src/linux/universal
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.10/net/shortcut-fe/fast-classifier.c

    r32659 r32709  
    13891389        struct net_device *dev = SFE_DEV_EVENT_PTR(ptr);
    13901390
    1391         switch (event) {
    1392         case NETDEV_DOWN:
    1393                 if (dev) {
    1394                         sfe_ipv4_destroy_all_rules_for_dev(dev);
     1391        if (dev && (event == NETDEV_DOWN)) {
     1392                sfe_ipv4_destroy_all_rules_for_dev(dev);
    13951393#ifdef SFE_SUPPORT_IPV6
    1396                         sfe_ipv6_destroy_all_rules_for_dev(dev);
    1397 #endif
    1398                 }
    1399                 break;
    1400         }
    1401 
     1394                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1395#endif
     1396        }
    14021397        return NOTIFY_DONE;
    14031398}
     
    14091404{
    14101405        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
    1411         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1406
     1407        if (dev && (event == NETDEV_DOWN)) {
     1408                sfe_ipv4_destroy_all_rules_for_dev(dev);
     1409        }
    14121410}
    14131411
     
    14181416{
    14191417        struct net_device *dev = ((struct inet6_ifaddr *)ptr)->idev->dev;
    1420         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1418
     1419        if (dev && (event == NETDEV_DOWN)) {
     1420                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1421        }
    14211422}
    14221423
  • src/linux/universal/linux-3.18/net/shortcut-fe/fast-classifier.c

    r32659 r32709  
    13891389        struct net_device *dev = SFE_DEV_EVENT_PTR(ptr);
    13901390
    1391         switch (event) {
    1392         case NETDEV_DOWN:
    1393                 if (dev) {
    1394                         sfe_ipv4_destroy_all_rules_for_dev(dev);
     1391        if (dev && (event == NETDEV_DOWN)) {
     1392                sfe_ipv4_destroy_all_rules_for_dev(dev);
    13951393#ifdef SFE_SUPPORT_IPV6
    1396                         sfe_ipv6_destroy_all_rules_for_dev(dev);
    1397 #endif
    1398                 }
    1399                 break;
    1400         }
    1401 
     1394                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1395#endif
     1396        }
    14021397        return NOTIFY_DONE;
    14031398}
     
    14091404{
    14101405        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
    1411         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1406
     1407        if (dev && (event == NETDEV_DOWN)) {
     1408                sfe_ipv4_destroy_all_rules_for_dev(dev);
     1409        }
    14121410}
    14131411
     
    14181416{
    14191417        struct net_device *dev = ((struct inet6_ifaddr *)ptr)->idev->dev;
    1420         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1418
     1419        if (dev && (event == NETDEV_DOWN)) {
     1420                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1421        }
    14211422}
    14221423
  • src/linux/universal/linux-3.2/net/shortcut-fe/fast-classifier.c

    r32659 r32709  
    13921392        struct net_device *dev = SFE_DEV_EVENT_PTR(ptr);
    13931393
    1394         switch (event) {
    1395         case NETDEV_DOWN:
    1396                 if (dev) {
    1397                         sfe_ipv4_destroy_all_rules_for_dev(dev);
     1394        if (dev && (event == NETDEV_DOWN)) {
     1395                sfe_ipv4_destroy_all_rules_for_dev(dev);
    13981396#ifdef SFE_SUPPORT_IPV6
    1399                         sfe_ipv6_destroy_all_rules_for_dev(dev);
    1400 #endif
    1401                 }
    1402                 break;
    1403         }
    1404 
     1397                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1398#endif
     1399        }
    14051400        return NOTIFY_DONE;
    14061401}
     
    14121407{
    14131408        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
    1414         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1409
     1410        if (dev && (event == NETDEV_DOWN)) {
     1411                sfe_ipv4_destroy_all_rules_for_dev(dev);
     1412        }
    14151413}
    14161414
     
    14211419{
    14221420        struct net_device *dev = ((struct inet6_ifaddr *)ptr)->idev->dev;
    1423         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1421
     1422        if (dev && (event == NETDEV_DOWN)) {
     1423                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1424        }
    14241425}
    14251426
  • src/linux/universal/linux-4.4/net/shortcut-fe/fast-classifier.c

    r32659 r32709  
    13891389        struct net_device *dev = SFE_DEV_EVENT_PTR(ptr);
    13901390
    1391         switch (event) {
    1392         case NETDEV_DOWN:
    1393                 if (dev) {
    1394                         sfe_ipv4_destroy_all_rules_for_dev(dev);
     1391        if (dev && (event == NETDEV_DOWN)) {
     1392                sfe_ipv4_destroy_all_rules_for_dev(dev);
    13951393#ifdef SFE_SUPPORT_IPV6
    1396                         sfe_ipv6_destroy_all_rules_for_dev(dev);
    1397 #endif
    1398                 }
    1399                 break;
    1400         }
    1401 
     1394                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1395#endif
     1396        }
    14021397        return NOTIFY_DONE;
    14031398}
     
    14091404{
    14101405        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
    1411         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1406
     1407        if (dev && (event == NETDEV_DOWN)) {
     1408                sfe_ipv4_destroy_all_rules_for_dev(dev);
     1409        }
    14121410}
    14131411
     
    14181416{
    14191417        struct net_device *dev = ((struct inet6_ifaddr *)ptr)->idev->dev;
    1420         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1418
     1419        if (dev && (event == NETDEV_DOWN)) {
     1420                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1421        }
    14211422}
    14221423
  • src/linux/universal/linux-4.9/net/shortcut-fe/fast-classifier.c

    r32659 r32709  
    13891389        struct net_device *dev = SFE_DEV_EVENT_PTR(ptr);
    13901390
    1391         switch (event) {
    1392         case NETDEV_DOWN:
    1393                 if (dev) {
    1394                         sfe_ipv4_destroy_all_rules_for_dev(dev);
     1391        if (dev && (event == NETDEV_DOWN)) {
     1392                sfe_ipv4_destroy_all_rules_for_dev(dev);
    13951393#ifdef SFE_SUPPORT_IPV6
    1396                         sfe_ipv6_destroy_all_rules_for_dev(dev);
    1397 #endif
    1398                 }
    1399                 break;
    1400         }
    1401 
     1394                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1395#endif
     1396        }
    14021397        return NOTIFY_DONE;
    14031398}
     
    14091404{
    14101405        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
    1411         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1406
     1407        if (dev && (event == NETDEV_DOWN)) {
     1408                sfe_ipv4_destroy_all_rules_for_dev(dev);
     1409        }
    14121410}
    14131411
     
    14181416{
    14191417        struct net_device *dev = ((struct inet6_ifaddr *)ptr)->idev->dev;
    1420         return sfe_propagate_dev_event(fast_classifier_device_event, this, event, dev);
     1418
     1419        if (dev && (event == NETDEV_DOWN)) {
     1420                sfe_ipv6_destroy_all_rules_for_dev(dev);
     1421        }
    14211422}
    14221423
Note: See TracChangeset for help on using the changeset viewer.