diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-01-30 01:20:23 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-01-30 01:20:23 +0100 |
commit | 99c53218e3f0611eafde4f6375c4c5e4c2865875 (patch) | |
tree | 4fdf474772bc20768b79c4308d5ef2e341b3d1cf /pfinet | |
parent | a9a4f69ad7bd02209fdce02b28c701c23fe48a15 (diff) |
Fix crash on fsysopts when pfinet has no IPv6
* pfinet/options.c (add_dev_opts): Use a for loop over `idev->addr_list'
instead of a while loop which assumes that it is not empty.
Diffstat (limited to 'pfinet')
-rw-r--r-- | pfinet/options.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pfinet/options.c b/pfinet/options.c index 1d0a9e1f..e9b81a9c 100644 --- a/pfinet/options.c +++ b/pfinet/options.c @@ -540,16 +540,15 @@ trivfs_append_args (struct trivfs_control *fsys, char **argz, size_t *argz_len) if (idev) { - struct inet6_ifaddr *ifa = idev->addr_list; + struct inet6_ifaddr *ifa; static char addr_buf[INET6_ADDRSTRLEN]; /* Push all IPv6 addresses assigned to the interface. */ - do + for (ifa = idev->addr_list; ifa; ifa = ifa->if_next) { inet_ntop (AF_INET6, &ifa->addr, addr_buf, INET6_ADDRSTRLEN); ADD_OPT ("--address6=%s/%d", addr_buf, ifa->prefix_len); } - while ((ifa = ifa->if_next)); /* Last not least push --gateway6 option. */ struct rt6_info *rt6i = ipv6_get_dflt_router (); |