]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: drop route_drop
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 14 May 2016 20:46:01 +0000 (16:46 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 14 May 2016 20:46:01 +0000 (16:46 -0400)
It is just an alias for route_free which requires that route is not null,
but it was only used in one place where it was checked that route is not
null anyway. Let's just call route_free instead.

src/network/networkd-manager.c
src/network/networkd-route.c
src/network/networkd-route.h

index 5dcd4df5361cf4d78a208afbf4b067e572f77b89..9174dcc7f48c7f868ae325fdba8b867b395fb27a 100644 (file)
@@ -457,11 +457,9 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, vo
                 break;
 
         case RTM_DELROUTE:
-
-                if (route)
-                        route_drop(route);
-
+                route_free(route);
                 break;
+
         default:
                 assert_not_reached("Received invalid RTNL message type");
         }
index 43f37266d8b2f085abc75e5f1bffcfcc73b573bd..ab4a94f41a5c70e6d26f41c8b7de5d81b225f214 100644 (file)
@@ -324,12 +324,6 @@ int route_update(Route *route,
         return 0;
 }
 
-void route_drop(Route *route) {
-        assert(route);
-
-        route_free(route);
-}
-
 int route_remove(Route *route, Link *link,
                sd_netlink_message_handler_t callback) {
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
index 84d74992c994086df7ee6f428b3d3c8e35ddcd52..39de8363edd32a2f93c89db82a4e88fc77681101 100644 (file)
@@ -61,7 +61,6 @@ int route_get(Link *link, int family, union in_addr_union *dst, unsigned char ds
 int route_add(Link *link, int family, union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, unsigned char table, Route **ret);
 int route_add_foreign(Link *link, int family, union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, unsigned char table, Route **ret);
 int route_update(Route *route, union in_addr_union *src, unsigned char src_prefixlen, union in_addr_union *gw, union in_addr_union *prefsrc, unsigned char scope, unsigned char protocol);
-void route_drop(Route *route);
 
 int route_expire_handler(sd_event_source *s, uint64_t usec, void *userdata);