From f42c29d2172e953887542bf7fb31d2b739563887 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 27 Sep 2015 18:50:11 +0200 Subject: pfinet: convert to trivfs dynamic classes and buckets libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * pfinet/main.c: Convert to dynamic classes and buckets. * pfinet/options.c: Likewise. * pfinet/pfinet.h: Likewise. * pfinet/socket-ops.c: Likewise. --- pfinet/options.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pfinet/options.c') diff --git a/pfinet/options.c b/pfinet/options.c index daffcd59..ae44759d 100644 --- a/pfinet/options.c +++ b/pfinet/options.c @@ -133,7 +133,7 @@ parse_interface_copy_device(struct device *src, && FIB_RES_GW(res) != INADDR_ANY) dst->gateway = FIB_RES_GW (res); #ifdef CONFIG_IPV6 - if (trivfs_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) + if (pfinet_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) idev = ipv6_find_idev(src); if (idev) @@ -452,7 +452,7 @@ parse_opt (int opt, char *arg, struct argp_state *state) { #ifdef CONFIG_IPV6 struct inet6_dev *idev = NULL; - if (trivfs_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL + if (pfinet_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL && in->device) idev = ipv6_find_idev(in->device); #endif @@ -570,7 +570,7 @@ parse_opt (int opt, char *arg, struct argp_state *state) /* Set IPv6 default router. */ #ifdef CONFIG_IPV6 - if (trivfs_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) + if (pfinet_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) { struct rt6_info *rt6i = ipv6_get_dflt_router (); @@ -710,7 +710,7 @@ trivfs_append_args (struct trivfs_control *fsys, char **argz, size_t *argz_len) #ifdef CONFIG_IPV6 struct inet6_dev *idev = NULL; - if (trivfs_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) + if (pfinet_protid_portclasses[PORTCLASS_INET6] != MACH_PORT_NULL) idev = ipv6_find_idev(dev); if (idev) -- cgit v1.2.3